sabeechen / hassio-google-drive-backup

Automatically create and sync Home Assistant backups into Google Drive
MIT License
3.15k stars 193 forks source link

ERROR trouble starting sensors? 403 error Forbidden #221

Closed kuroi8989 closed 4 years ago

kuroi8989 commented 4 years ago
08-14 16:18:37 INFO Starting server on port 8099
08-14 16:18:37 ERROR Trouble updating Home Assistant sensors.
08-14 16:18:37 INFO Server started
08-14 16:18:37 INFO Syncing Snapshots
08-14 16:18:37 ERROR 
  addon/backup/model/coordinator.py:148 (_sync)
  addon/backup/model/model.py:133 (sync)
  addon/backup/model/model.py:216 (_syncSnapshots)
  addon/backup/ha/hasource.py:203 (get)
  addon/backup/ha/hasource.py:272 (init)
  addon/backup/ha/hasource.py:304 (_refreshInfo)
  addon/backup/ha/hasource.py:280 (_refreshInfo)
  addon/backup/ha/harequests.py:25 (wrap_and_call)
  addon/backup/ha/harequests.py:96 (selfInfo)
  addon/backup/ha/harequests.py:25 (wrap_and_call)
  addon/backup/ha/harequests.py:183 (_getHassioData)
  addon/backup/ha/harequests.py:148 (_validateHassioReply)
  /site-packages/aiohttp/client_reqrep.py:941 (raise_for_status)
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://hassio/addons/self/info')

can't even start. On latest version: 0.114.0 with frontend version: 20200811.0

I just lost like, 3 months of work cause I didn't make sure this was configured properly on my previous build. So I"m making sure this works now.

sabeechen commented 4 years ago

I've seen this pop up once or twice before, but have been unable to narrow down why it happens. Haven't ever been able to reproduce it on my testing machines. The error indicates that the supervisor doesn't think the addon has permission to ask about its configuration, which is necessary for the addon to work at all. Especially weird because the Supervisor is the one that tells the addon what credentials to use when it starts up! I suspect this is a bug in Home Assistant or the Supervisor.

Could you try this:

Alternatively if you can get to the Addon's Web-UI, you can go to "Actions" -> "Report a bug" -> "Copy Details" to a bunch preformatted debugging info in markdown format that might help.

kuroi8989 commented 4 years ago

sabeechan! Gotcha, I got the logs let me paste it. I've restarted IT AND my Pi via a terminal command reboot. Still nada


###### Description:

If you have anything else that could help explain what happened, click "Markdown" above and write it here.


 Addon version: `0.101.0`
 Home Assistant Version: `Uninitialized`
 Supervisor Version: `Uninitialized`
 Architecture: `Uninitialized`
 Date: `2020-08-15T00:16:09.729316+00:00`
 Timezone: `Uninitialized`
 Failure Time: `2020-08-14T23:36:39.233049+00:00`
 Last Good Sync: `2020-08-14T23:36:39.217899+00:00`
 ###### Exception:

addon/backup/model/coordinator.py:148 (_sync) addon/backup/model/model.py:133 (sync) addon/backup/model/model.py:216 (_syncSnapshots) addon/backup/ha/hasource.py:203 (get) addon/backup/ha/hasource.py:272 (init) addon/backup/ha/hasource.py:304 (_refreshInfo) addon/backup/ha/hasource.py:280 (_refreshInfo) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:96 (selfInfo) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:183 (_getHassioData) addon/backup/ha/harequests.py:148 (_validateHassioReply) /site-packages/aiohttp/client_reqrep.py:941 (raise_for_status) aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://hassio/addons/self/info')

 Snapshots:

{ "HomeAssistant": { "snapshots": 0, "retained": 0, "deletable": 0, "name": "HomeAssistant", "latest": null, "size": "0.0 B" }, "GoogleDrive": { "snapshots": 0, "retained": 0, "deletable": 0, "name": "GoogleDrive", "latest": null, "size": "0.0 B" } }

 ###### Config:

{}

 ###### Addon Logs:

08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory changed 08-14 16:36:33 DEBUG [backup.worker.watcher] Backup directory modified event 08-14 16:36:39 INFO [backup.worker.watcher] Backup directory changed 08-14 16:36:39 DEBUG [backup.model.syncer] Sync requested by Backup Directory Watcher 08-14 16:36:39 INFO [backup.model.coordinator] Syncing Snapshots 08-14 16:36:39 DEBUG [backup.ha.harequests] Making Hassio request: http://hassio/addons/self/info 08-14 16:36:39 DEBUG [backup.ha.hasource] Failed to connect to supervisor 08-14 16:36:39 DEBUG [backup.ha.hasource] addon/backup/ha/hasource.py:280 (_refreshInfo) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:96 (selfInfo) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:183 (_getHassioData) addon/backup/ha/harequests.py:148 (_validateHassioReply) /site-packages/aiohttp/client_reqrep.py:941 (raise_for_status) aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://hassio/addons/self/info')

08-14 16:36:39 ERROR [backup.model.coordinator] addon/backup/model/coordinator.py:148 (_sync) addon/backup/model/model.py:133 (sync) addon/backup/model/model.py:216 (_syncSnapshots) addon/backup/ha/hasource.py:203 (get) addon/backup/ha/hasource.py:272 (init) addon/backup/ha/hasource.py:304 (_refreshInfo) addon/backup/ha/hasource.py:280 (_refreshInfo) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:96 (selfInfo) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:183 (_getHassioData) addon/backup/ha/harequests.py:148 (_validateHassioReply) /site-packages/aiohttp/client_reqrep.py:941 (raise_for_status) aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://hassio/addons/self/info')

08-14 16:36:39 INFO [backup.model.coordinator] I'll try again in an hour 08-14 16:41:37 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors. 08-14 16:46:47 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors. 08-14 16:51:57 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors. 08-14 16:57:07 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors. 08-14 17:02:17 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors. 08-14 17:07:27 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors. 08-14 17:12:37 ERROR [backup.ha.haupdater] Trouble updating Home Assistant sensors.

 ###### Supervisor Logs:

addon/backup/debugworker.py:129 (buildBugReportData) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:136 (getSuperLogs) /site-packages/aiohttp/client_reqrep.py:941 (raise_for_status) aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://hassio/supervisor/logs')

 ###### Home Assistant Core Logs:

addon/backup/debugworker.py:133 (buildBugReportData) addon/backup/ha/harequests.py:25 (wrap_and_call) addon/backup/ha/harequests.py:143 (getCoreLogs) /site-packages/aiohttp/client_reqrep.py:941 (raise_for_status) aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('http://hassio/core/logs')

sabeechen commented 4 years ago

Ah it looks like the addon wasn't able to grab the supervisor's logs conveniently. I should have anticipated that, the supervisor doesn't think the addon has permission to do anything :(

Could you get me the supervisor logs by navigating to "Supervisor" > "System" > Log Provider: Supervisor > "Refresh"? I'm really hoping some helpful error message shows up there.

kuroi8989 commented 4 years ago

Hey, so I made sure to restart the Google Drive add-on before grabbing these logs.

20-08-15 17:36:44 ERROR (MainThread) [supervisor.api.security] Invalid token for access /addons/self/info
20-08-15 17:39:07 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-08-15 17:39:07 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-08-15 17:39:07 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/sabeechen/hassio-google-drive-backup repository
20-08-15 17:39:08 INFO (MainThread) [supervisor.store] Load add-ons from store: 67 all - 0 new - 0 remove
20-08-15 17:41:31 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 17:46:41 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 17:51:51 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 17:57:01 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:02:11 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:07:21 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:12:31 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:17:41 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:22:51 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:28:01 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:33:11 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:36:45 ERROR (MainThread) [supervisor.api.security] Invalid token for access /addons/self/info
20-08-15 18:38:21 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:39:07 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/stable.json
20-08-15 18:43:31 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:48:41 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:52:27 INFO (MainThread) [supervisor.host.info] Update local host information
20-08-15 18:52:27 INFO (MainThread) [supervisor.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
20-08-15 18:52:28 INFO (MainThread) [supervisor.host.services] Update service information
20-08-15 18:52:28 INFO (MainThread) [supervisor.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
20-08-15 18:52:28 INFO (MainThread) [supervisor.host.network] Update local network DNS information
20-08-15 18:52:28 INFO (MainThread) [supervisor.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/DnsManager
20-08-15 18:52:28 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
Failed to load cookie file from cookie: No such file or directory
20-08-15 18:53:51 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 18:59:01 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:04:11 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:09:21 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:14:31 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:19:42 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:24:52 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:30:02 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:35:12 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:36:45 ERROR (MainThread) [supervisor.api.security] Invalid token for access /addons/self/info
20-08-15 19:40:22 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:45:32 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:50:42 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 19:55:52 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:01:02 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:06:12 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:11:22 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:16:32 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:21:42 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:26:52 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:32:02 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:36:45 ERROR (MainThread) [supervisor.api.security] Invalid token for access /addons/self/info
20-08-15 20:37:12 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:39:07 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-08-15 20:39:07 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/sabeechen/hassio-google-drive-backup repository
20-08-15 20:39:07 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-08-15 20:39:08 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/stable.json
20-08-15 20:39:09 INFO (MainThread) [supervisor.store] Load add-ons from store: 67 all - 0 new - 0 remove
20-08-15 20:42:22 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:46:55 WARNING (SyncWorker_0) [supervisor.docker.addon] SSH & Web Terminal run with disabled protected mode!
20-08-15 20:46:55 INFO (SyncWorker_0) [supervisor.docker.interface] Clean addon_a0d7b954_ssh application
20-08-15 20:46:56 INFO (SyncWorker_0) [supervisor.docker.addon] Start Docker add-on hassioaddons/ssh-armv7 with version 7.4.1
20-08-15 20:47:32 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:52:42 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:57:52 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 20:59:07 INFO (MainThread) [supervisor.host.info] Update local host information
20-08-15 20:59:07 INFO (MainThread) [supervisor.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
20-08-15 20:59:10 INFO (MainThread) [supervisor.host.services] Update service information
20-08-15 20:59:10 INFO (MainThread) [supervisor.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
20-08-15 20:59:10 INFO (MainThread) [supervisor.host.network] Update local network DNS information
20-08-15 20:59:10 INFO (MainThread) [supervisor.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/DnsManager
20-08-15 20:59:10 INFO (MainThread) [supervisor.host.sound] Update PulseAudio information
Failed to load cookie file from cookie: No such file or directory
20-08-15 21:03:02 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 21:04:29 WARNING (SyncWorker_1) [supervisor.docker.addon] SSH & Web Terminal run with disabled protected mode!
20-08-15 21:04:29 INFO (SyncWorker_1) [supervisor.docker.interface] Clean addon_a0d7b954_ssh application
20-08-15 21:04:30 INFO (SyncWorker_1) [supervisor.docker.addon] Start Docker add-on hassioaddons/ssh-armv7 with version 7.4.1
20-08-15 21:04:33 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62749 ssl:default [Connection refused]
20-08-15 21:04:36 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62749 ssl:default [Connection refused]
20-08-15 21:04:38 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.32.1:62749 ssl:default [Connection refused]
20-08-15 21:04:59 WARNING (SyncWorker_4) [supervisor.docker.addon] SSH & Web Terminal run with disabled protected mode!
20-08-15 21:04:59 INFO (SyncWorker_4) [supervisor.docker.interface] Clean addon_a0d7b954_ssh application
20-08-15 21:05:02 INFO (SyncWorker_4) [supervisor.docker.addon] Start Docker add-on hassioaddons/ssh-armv7 with version 7.4.1
20-08-15 21:05:42 WARNING (SyncWorker_5) [supervisor.docker.addon] SSH & Web Terminal run with disabled protected mode!
20-08-15 21:05:42 INFO (SyncWorker_5) [supervisor.docker.interface] Clean addon_a0d7b954_ssh application
20-08-15 21:05:44 INFO (SyncWorker_5) [supervisor.docker.addon] Start Docker add-on hassioaddons/ssh-armv7 with version 7.4.1
20-08-15 21:08:12 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 21:13:22 WARNING (MainThread) [supervisor.api.proxy] Unknown Home Assistant API access!
20-08-15 21:17:37 INFO (SyncWorker_1) [supervisor.docker.interface] Stop addon_cebe7a76_hassio_google_drive_backup application
20-08-15 21:17:39 INFO (SyncWorker_1) [supervisor.docker.interface] Clean addon_cebe7a76_hassio_google_drive_backup application
20-08-15 21:17:40 INFO (SyncWorker_0) [supervisor.docker.addon] Start Docker add-on sabeechen/hassio-google-drive-backup-armv7 with version 3.12
20-08-15 21:17:41 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.1:8099 ssl:default [Connection refused]
20-08-15 21:17:42 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /homeassistant/info access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /snapshots access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /snapshots/1c5a660c/info access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /snapshots/5c63a11f/info access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /snapshots/89f1dbee/info access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:42 INFO (MainThread) [supervisor.api.security] /snapshots/fe4f7cd2/info access from cebe7a76_hassio_google_drive_backup
20-08-15 21:17:44 INFO (MainThread) [supervisor.api.security] /snapshots access from cebe7a76_hassio_google_drive_backup
sabeechen commented 4 years ago

I've opened an issue with the supervisor authors here, since I'm pretty sure the addon is doing things right. Could I have you post there with the HassOS version, Home Assistant version, and any details you're willign to provide about the environment you run it in (eg an Rpi, linux VM, etc)

sabeechen commented 4 years ago

Do you run the portainer addon? I'm suspicious it would cause problems unless you did something wrong, but the guy over at the supervisor bug thinks it might be the problem.

kuroi8989 commented 4 years ago

Nope. Fairly fresh build but haven't touched Portainer or any other Docker like program.

sabeechen commented 4 years ago

Alright, I've let him know. I'm not sure if that bug is going to go anywhere useful. If you get tired of waiting, in the past I've had users with similar problems solve it by reinstalling the addon, though that would also probably make it impossible to figure out what went wrong in the first place. Your call.

sabeechen commented 4 years ago

The supervisor guy would like you to turn on crash reports, which you can get to from "Supervisor" > "System" > "Supervisor" panel > Toggle on "Share Diagnostics". Hopefully this will get him something he can work with.

sabeechen commented 4 years ago

I don't think there is anything else I'm going to be able to do with this, since its in the supervisors hands. If there is anything else you'd like me to look into, please feel free to reopen this.