Backup to dropbox

Thanks for the reply. Sorry for delay, but never got a notification. Here’s the log:

[Info] Files will be uploaded to: homeassistant
[Info] Saving OAUTH_ACCESS_TOKEN to /etc/uploader.conf
[Info] Listening for messages via stdin service call…

That’s all the log output? It doesn’t look like it’s responding to the service call at all. Are you clicking the blue REFRESH link on the log page to see the latest logs?

Yes, page refreshed


@yebaws thanks for the screenshots. That doesn’t look like my add-on. It looks like you are using something called “Dropbox Sync” instead of mine which is “Dropback”. That log output looks totally different:

You can find details on how to install and use my Add-on here: https://github.com/matthewhadley/homeassistant-dropback/blob/45dc707a5ff627404db3ad5a6d8b73d961e76317/dropback/DOCS.md

Apologies for that. I have tried so many different addons I must have got them mixed up. Will have another go, double check everything and get back if it’s still not working.

ok,
made the correct service call, but read the log from the wrong addon. My apologies again. This is what I get:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[2023-10-15 12:46:41] INFO: Dropback 7.2.0
[2023-10-15 12:46:41] INFO: Initializing Dropback
[2023-10-15 12:46:42] INFO: No config file found, requesting long lived Refresh Token...
[2023-10-15 12:46:43] FATAL: Error getting Refresh Token
[2023-10-15 12:46:43] FATAL: invalid_grant code doesn't exist or has expired
[2023-10-15 12:46:43] FATAL: Please check App Key and App Secret configuration values and generate a new Access Token
[2023-10-15 12:46:43] FATAL: A new Access Token can be generated at: https://www.dropbox.com/oauth2/authorize?client_id=ncehnap4lb8wnvp{MESSAGE}token_access_type=offline{MESSAGE}response_type=code
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I generated a new key after this happened the first time and entered it in config (within a couple of minutes), then got the same error again. Everything copied and pasted very carefully

This looks like the wrong Access Code has been entered in. Make sure the app you created has the correct permissions and then visit this, but replace the XXX with the client ID of you dropbox app:
Visit https://www.dropbox.com/oauth2/authorize?client_id=XXX&token_access_type=offline&response_type=code

That should give you the code to enter as the Access Code in the configuration tab

Thanks for the reply.

Have followed all instructions carefully and I’m confident that I’ve entered the correct Access code.




I’ve gone through all the install steps on my test setup and been unable to reproduce an error. The point at which it seems to be failing is when checking the response for a call for the Refresh Token - it cannot find one in the response from dropbox.

The actual call happening is this:

curl https://api.dropbox.com/oauth2/token \
    -d grant_type=authorization_code \
    -u "APP_KEY:APP_SECRET" \
    -d code="ACCESS_CODE"

If you know how to use curl you can try that command, replacing the values for APP_KEY, APP_SECRET and ACCESS_CODE. See what the response is.

You could also try deleting the app in dropbox and re-creating it.

Interesting…I just installed your update and ran the service in developer tools . Despite getting a green tick, the log is now completely empty

My problem I think was not restarting the addon after changing the config. I think I’m now starting to get somewhere. Here’s my latest log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[2023-10-17 10:06:06] INFO: Dropback 7.2.1
[2023-10-17 10:06:06] INFO: Initializing Dropback
[2023-10-17 10:06:06] INFO: No config file found, requesting long lived Refresh Token...
[2023-10-17 10:06:08] INFO: Got Refresh Token
[2023-10-17 10:06:08] INFO: Config file saved
[2023-10-17 10:06:08] INFO: Validating Dropbox access... 
[2023-10-17 10:06:09] INFO: Dropbox access OK
[2023-10-17 10:06:09] INFO: Listening for input via stdin service call...
[2023-10-17 10:06:14] INFO: Received input: sync
[2023-10-17 10:06:14] INFO: Deleting files older than 3 days...
[2023-10-17 10:06:14] INFO: Deleted local file /backup/a3c5de07.tar
[2023-10-17 10:06:16] FATAL: Failed to delete /homeassistant/2023-10-11.tar on Dropbox
[2023-10-17 10:06:16] FATAL: 

{"error_summary": "path_lookup/not_found/..", "error": {".tag": "path_lookup", "path_lookup": {".tag": "not_found"}}}
[2023-10-17 10:06:16] INFO: Deleted local file /backup/47054ad2.tar

The first error doesn’t worry me as the file was not already on Dropbox because it wasn’t working before, but the last error is presumably the one that prevented the backup file from being uploaded to Dropbox. Any ideas?

Run it again and it’s working! Thank you for your patience.

Glad to hear things are working. That error was logged because Dropback couldn’t find the equivalent file on dropbox to delete that it had just deleted locally. I will make that a WARN instead of FATAL in those logs (just released version 7.3.1)

1 Like