Before posting, and to avoid disappointment, please read the following:

  • This forum is not for 2BrightSparks to provide technical support. It's primarily for users to help other users. Do not expect 2BrightSparks to answer any question posted to this forum.
  • If you find a bug in any of our software, please submit a support ticket. It does not matter if you are using our freeware, a beta version or you haven't yet purchased the software. We want to know about any and all bugs so we can fix them as soon as possible. We usually need more information and details from you to reproduce bugs and that is better done via a support ticket and not this forum.

Backup to "Box" Requires New "Box Code" Every Day

For technical support visit https://support.2brightsparks.com/
Post Reply
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

I have changed my backup location from Dropbox to Box (more space available). When the daily backup was being done to Dropbox it was successful every time. With Box I've encountered the same "Scan Failure" each day. This is the error:
Scan Failure - Failed to prepare Box : HTTP/1.1 400 Bad Request

I then go through the "authorization process yet again:
Capture.PNG
Capture.PNG (98.89 KiB) Viewed 7727 times
Once I authorize, I can then do manual backups as many times as I'd like, with success. The next day, at the scheduled backup time I get the same error: Scan Failure - Failed to prepare Box : HTTP/1.1 400 Bad Request

Any other reports of this issue, or am I missing something in the setup process that is causing this error?
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

OK, this morning the backup to Box ran perfectly, on schedule. Then, I changed a few files and decided to do a manual backup to make sure those files were secure. The manual run failed with the same exact "scan failed" error. So, possibly it's a random failure, run sometimes, fail other times. I really need some help with this or I need to temporarily change my method of backup to Box.
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

And yes, the Box account is linked.
Capture.PNG
Capture.PNG (95.56 KiB) Viewed 7691 times
Kostas
2BrightSparks Staff
2BrightSparks Staff
Posts: 368
Joined: Thu Sep 18, 2014 2:08 am

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Kostas »

Hi,

You may be using shared settings but do you also use other third party apps or Box's own website to manage your files? Because that will invalidate any refresh token SyncbackPro may already have.

Thanks,
Kostas
[2bs]
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

Kostas,

Thank you. I just started with Box and all of my experience so far with SyncBack Pro has been with Google Drive and Dropbox. Those two cloud services were not affected the way Box seems to be. I could schedule backups and they would run on schedule with no requirement that I not use the web browser access to those files in-between SyncBack Pro scheduled backups.

So, just so I am clear, with Box, any login to my Box storage via a web browser will invalidate the token that SyncBack has currently stored and a new authorization will need to be granted. And Dropbox and Google Drive do not have this limitation. If I am understanding this correctly I can live with that. Having just started with Box the logins via a web browser were only to check if things were in fact being backed up correctly to the locations I selected. Now that I have confirmed that everything is working correctly I really have no need to poke around on the Box site.
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

OK, no visits to Box via a web browser or any other method, yet, this morning the backup failed again. So, even though going up on the Box web site may be one possible issue, there has to be something else going on.

I also use CCleaner on a pretty regular basis. I'll do a bit of experimenting to see if it may have something to do with these backups failing. Any help would be appreciated.
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

Did some research online and found the Box developer support forums. These two posts I copied seem to point to either SyncBack not handling the Box "tokens" properly, or, as I said in the previous post, the "tokens" are being deleted by CCleaner. The other question I have is this. If I knew where SyncBack stores the Box "tokens" I could make sure that they are preserved during the CCleaner scans.

First Box Developer Post:
Since OAuth 2.0 is a new protocol, there aren’t defined standards for using access and refresh tokens. Without a defined standard for tokens, when developers integrate with multiple document management services they must keep in mind various expiration intervals to maintain access across the board.

Some document management services’ tokens expire in a matter of months and others never do. For example, Box’s access token expires after 1 hour while Dropbox’s never does. Whatsmore, finding information about expiration intervals is a taxing process; In researching this topic, it took much longer than expected to compile a list of this critical information.

Here are the OAuth access/refresh token expiration intervals for the five leading cloud document management services:
Box: Access token: 1 hour, Refresh token: 60 days (resets 60 days when retrieving new access token)

Second Developer Post:
You do need to save your tokens in some kind of file or Keychain or registry. So, that you can get access to those tokens later again when app restarts. Even after the accesstoken gets expired, you can still read RefreshToken and request new tokens and save the new tokens again.

So, during the next cycle, first read the tokens first, check if they are valid, if yes call the apis. If tokens are not valid, user shoudl be login again. The tokens will never expire if you at least make 1 API call in 60 days becuase RT lasts 60 days. Or else what you can do is make app refresh new token once every time app restarts that will assure you there will always be valid token during the program run time.

And same applies for username/ password change. The tokens will still work even if you change password even though it's good idea to request new token in case of password change.
Kostas
2BrightSparks Staff
2BrightSparks Staff
Posts: 368
Joined: Thu Sep 18, 2014 2:08 am

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Kostas »

Hi,

I had a look at it yesterday, testing two profiles using a common linked account but didn't have any issues. I'll do some more extensive testing when I get a chance (hopefully tomorrow).

We are aware of the refresh token and how it should be managed/stored. We always store the latest refresh token we've received and use that the next time a profile needs it. There must be something else at play here.. Hopefully we can find out.

Thanks,
Kostas
[2bs]
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

Kostas,

Thank you. Did a few backup runs just to see if I could find something repeatable. So far nothing.

After the failed backup I went and authorized once again. Did a few successful backups, waiting with a couple well past the one hour time limit for the initial token. So that means that the refresh token thing seems to be working/active.

Then did a restart of the laptop. Success once again with backup to Box. I then launched CCleaner and had it do it's thing, both application and registry cleaning. Again, successful backups to Box.

Just thought I'd try to eliminate any possible obvious (to the non-programmer) issues. Any information/data/log files you may need I'd be happy to provide. Now I think I'll just let things be and see if the run scheduled for tomorrow (7:35 AM) is successful. Maybe it's a clock/date thing.
Kostas
2BrightSparks Staff
2BrightSparks Staff
Posts: 368
Joined: Thu Sep 18, 2014 2:08 am

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Kostas »

Hi,

Just to clarify, since you mentioned schedules, do you happen to schedule your Box profiles to run at the same time? If yes, then that definitely won't work since both will be changing the refresh token at the same time, thus the problem.

Either you schedule them to run at different times (just make sure they still don't overlap) or better, create a group with those Box profiles and then schedule the group itself to start at your preferred time. (Remember to delete the schedules from the individual profiles in this case).

Thanks,
Kostas
[2bs]
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

It sounds as though I have my schedules set up just the way you suggest that they should be to work with Box. The Group is set to run at 7:35 AM each morning and the Profiles within the Group run in sequence. One is running while the others are paused, and so forth down the line.
Capture.PNG
Capture.PNG (55.9 KiB) Viewed 7499 times
Kostas
2BrightSparks Staff
2BrightSparks Staff
Posts: 368
Joined: Thu Sep 18, 2014 2:08 am

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Kostas »

Hi,

Can you edit your group and make sure it's not set to run its profiles in parallel :)

Thanks,
Kostas
[2bs]
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

Looked everywhere but I see no setting in the schedule that mentions running in parallel. The way I have things set up, individual profiles have no schedule, only the group has a schedule.

Also, this morning the first profile in the group failed with the error: Critical Error, Failed to prepare Box : Socket Error # 11001 Host not found. The rest of the profiles ran successfully (strange).
Capture.PNG
Capture.PNG (56.63 KiB) Viewed 7441 times
I then did a manual run of the group and all profiles failed with error: Critical Error, Failed to prepare Box : HTTP/1.1 400 Bad Request
Capture_1.PNG
Capture_1.PNG (53.93 KiB) Viewed 7441 times
I did one last thing last night so as to test this morning. I duplicated the Box group/profiles and the only modification I made was to point the backup location to Dropbox. All profiles ran successfully.

So, I suspect that this will end up being a Box/token/date/time issue as (each day, after a scheduled Box backup failure) once I reauthorize the Box/SyncBack connection I can right click on the group and click run all day long and each and every backup is successful.
Kostas
2BrightSparks Staff
2BrightSparks Staff
Posts: 368
Joined: Thu Sep 18, 2014 2:08 am

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Kostas »

What I meant is that in your SyncBackPro's group settings (the one you named Box Backups) there is an option that says "Run profiles in parallel" so make sure that this is not enabled. 8)

From what you've said it seems that this option is not enabled but just wanted to make sure. Also I would suggest you to go back to each one of your Box profiles and double check again the cloud settings and ensure that all of them use the Linked Account. If any of the profiles' cloud settings has the button saying "Use my account" then that means that it is not using the linked account so most likely it's the one causing problems.

Thanks,
Kostas
[2bs]
Homer712
Experienced
Experienced
Posts: 32
Joined: Fri May 26, 2017 1:10 pm

Re: Backup to "Box" Requires New "Box Code" Every Day

Post by Homer712 »

Totally missed the "obvious" box while concentrating on minutia detail (hits head against wall!) . . . no, parallel is not checked.
Capture.PNG
Capture.PNG (22.1 KiB) Viewed 7420 times
Also, each of the profiles have this status under the "Cloud" heading.
Capture_1.PNG
Capture_1.PNG (6.05 KiB) Viewed 7420 times
Post Reply