Thanks for your efforts @diffhome. I’ve tried several different automations, but so far have failed to
Automatically delete old backups and
Automatically sync backups anywhere off HA.
Unfortunately, I’m having no more luck with your automation. Backup works fine but no syncing with dropbox and no removal of old files. Config is all set up fine with dropbox settings so far as I can see.
Traces don’t show anything useful. Have tried using Developer Tools to run just the following part of the automation:
@yebaws sorry to hear you’re having trouble. When you run dropbak via the developer tools service call, what output do you see in the “Log” tab of the add-on? Any captured errors should show up in there
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?
@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:
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
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.
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?
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)
Sorry for delay in getting back, Just got back to looking at this, and re-tried with same result.
re the debug curl command sorry but I don’t know what this is or how to use it.
Is there some instructions on this anywhere?
I can show the latest log results if that helps, but pretty much the same as before.
Does the Dropback log output show a url to generate an access Token (the screenshot seems clipped)?
The log line that says “invalid_client: Inavlid client_id or client_secret null” is the message coming directly back from Dropbox.com for the passed credentials - so either the credentials are wrong or there’s something else going on with them somehow. So using the above curl command would be a way to help validate.