hassio-google-drive-backup icon indicating copy to clipboard operation
hassio-google-drive-backup copied to clipboard

Where do I put the Client ID & Client Secret in the Add-On?

Open simonk1969 opened this issue 2 years ago • 5 comments

I'm getting the 'backup.exceptions.exceptions.GoogleRateLimitError' issue, I have created a new google account and also set up my own credentials for use but I cannot see where I put the Client ID & Client Secret in the Add-On

Addon version: 0.110.4 Home Assistant Version: 2023.6.2 Supervisor Version: 2023.06.2 Supervisor Channel: stable Hassos Version: 10.2 Docker Version: 23.0.6 Architecture: amd64 Machine: qemux86-64 Date: 2023-06-16T17:53:29.614196+00:00 Timezone: Europe/London Failure Time: 2023-06-16T17:53:06.210045+00:00 Last Good Sync: 2023-06-16T17:52:02.269648+00:00 Next Sync: 2023-06-16T19:53:06.210045+00:00 Next Backup: 2023-06-17T02:00:00+00:00 Next Cache Warm: 2023-06-16T19:45:39.252130+00:00 Time Offset: 0.0

Exception:

 addon/backup/model/coordinator.py:198 (_sync)
 addon/backup/model/model.py:246 (sync)
 addon/backup/drive/drivesource.py:202 (save)
 addon/backup/drive/driverequests.py:229 (create)
 addon/backup/drive/driverequests.py:369 (retryRequest)
 addon/backup/util/backoff.py:37 (backoff)
 addon/backup/drive/driverequests.py:363 (retryRequest)
 addon/backup/creds/driverequester.py:41 (request)
backup.exceptions.exceptions.GoogleRateLimitError

Backups:

{
   "HomeAssistant": {
       "backups": 3,
       "retained": 0,
       "deletable": 3,
       "name": "HomeAssistant",
       "title": "Home Assistant",
       "latest": "2023-06-16T03:47:29Z",
       "max": 3,
       "enabled": true,
       "icon": "home-assistant",
       "ignored": 0,
       "detail": "",
       "size": "1.1 GB",
       "ignored_size": "0.0 B",
       "free_space": "19.9 GB"
   },
   "GoogleDrive": {
       "backups": 0,
       "retained": 0,
       "deletable": 0,
       "name": "GoogleDrive",
       "title": "Google Drive",
       "latest": null,
       "max": 14,
       "enabled": true,
       "icon": "google-drive",
       "ignored": 0,
       "detail": "[email protected]",
       "size": "0.0 B",
       "ignored_size": "0.0 B",
       "free_space": "15.0 GB"
   }
}
Config:
{
   "Setting.MAX_BACKUPS_IN_HA": 3,
   "Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE": 14,
   "Setting.DAYS_BETWEEN_BACKUPS": 1.0,
   "Setting.IGNORE_UPGRADE_BACKUPS": false,
   "Setting.BACKUP_TIME_OF_DAY": "03:00"
}
Addon Logs:
06-16 18:37:53 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 8 seconds
06-16 18:38:01 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 16 seconds
06-16 18:38:17 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 32 seconds
06-16 18:38:44 INFO [backup.ui.restarter] Restarting Web-UI server
06-16 18:38:44 ERROR [backup.model.coordinator] Sync was cancelled by you
06-16 18:38:44 INFO [backup.model.coordinator] I'll try again in 2 hours
06-16 18:38:44 INFO [backup.model.coordinator] Syncing Backups
06-16 18:38:44 INFO [backup.ui.uiserver] Starting server on port 8099
06-16 18:38:44 INFO [backup.ui.uiserver] Server started
06-16 18:38:44 INFO [backup.drive.drivesource] Uploading 'Full Backup 2023-06-16 04:47:27' to Google Drive
06-16 18:38:44 DEBUG [backup.drive.driverequests] Attempting to resume a previously failed upload where we left off
06-16 18:38:44 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 2 seconds
06-16 18:38:46 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 4 seconds
06-16 18:38:50 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 8 seconds
06-16 18:38:58 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 16 seconds
06-16 18:39:14 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 32 seconds
06-16 18:39:46 ERROR [backup.model.coordinator] The addon has made too many requests to Google Drive, and will back off
06-16 18:39:46 INFO [backup.model.coordinator] I'll try again in 2 hours
06-16 18:52:02 INFO [backup.drive.drivesource] Saving new Google Drive credentials
06-16 18:52:02 DEBUG [backup.model.syncer] Sync requested by GoogleDrive
06-16 18:52:02 INFO [backup.model.coordinator] Syncing Backups
06-16 18:52:03 INFO [backup.drive.drivesource] Uploading 'Full Backup 2023-06-16 04:47:27' to Google Drive
06-16 18:52:03 DEBUG [backup.drive.driverequests] Attempting to resume a previously failed upload where we left off
06-16 18:52:03 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 2 seconds
06-16 18:52:05 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 4 seconds
06-16 18:52:10 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 8 seconds
06-16 18:52:18 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 16 seconds
06-16 18:52:34 ERROR [backup.drive.driverequests] The addon has made too many requests to Google Drive, and will back off: we'll retry in 32 seconds
06-16 18:53:06 ERROR [backup.model.coordinator] The addon has made too many requests to Google Drive, and will back off
06-16 18:53:06 INFO [backup.model.coordinator] I'll try again in 2 hours
Supervisor Logs:
[32m23-06-16 18:25:51 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:25:52 INFO (MainThread) [supervisor.api.middleware.security] /backups/8fc8ad5c/download access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:25:52 INFO (MainThread) [supervisor.api.backups] Downloading backup 8fc8ad5c[0m
[32m23-06-16 18:33:29 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:33:29 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:33:29 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:36:57 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:36:57 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:36:57 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:37:46 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:37:46 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:37:47 INFO (MainThread) [supervisor.api.middleware.security] /backups/8fc8ad5c/download access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:37:47 INFO (MainThread) [supervisor.api.backups] Downloading backup 8fc8ad5c[0m
[32m23-06-16 18:37:52 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:37:52 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:37:52 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:38:44 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:38:44 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:38:44 INFO (MainThread) [supervisor.api.middleware.security] /backups/8fc8ad5c/download access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:38:44 INFO (MainThread) [supervisor.api.backups] Downloading backup 8fc8ad5c[0m
[32m23-06-16 18:38:49 INFO (MainThread) [supervisor.api.middleware.security] /core/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:38:49 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:38:49 INFO (MainThread) [supervisor.api.middleware.security] /addons access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:42:22 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token[0m
[32m23-06-16 18:52:02 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:52:02 INFO (MainThread) [supervisor.api.middleware.security] /backups access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:52:03 INFO (MainThread) [supervisor.api.middleware.security] /backups/8fc8ad5c/download access from cebe7a76_hassio_google_drive_backup[0m
[32m23-06-16 18:52:03 INFO (MainThread) [supervisor.api.backups] Downloading backup 8fc8ad5c[0m
[32m23-06-16 18:53:29 INFO (MainThread) [supervisor.api.middleware.security] /supervisor/logs access from cebe7a76_hassio_google_drive_backup[0m

Home Assistant Core Logs:
[31m2023-06-16 15:21:13.374 ERROR (MainThread) [homeassistant.components.shelly] Error fetching bathroom-relays data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 15:28:31.375 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 15:34:35.327 ERROR (MainThread) [homeassistant.components.shelly] Error fetching nodezero_electricitymonitor data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 15:37:36.079 ERROR (MainThread) [homeassistant.components.shelly] Error fetching livingroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 15:52:53.375 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 15:59:06.375 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:03:37.079 ERROR (MainThread) [homeassistant.components.shelly] Error fetching livingroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:06:28.249 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Kitchen Cabinet Lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:09:29.198 ERROR (MainThread) [homeassistant.components.shelly] Error fetching sparebedroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:14:07.374 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:35:57.080 ERROR (MainThread) [homeassistant.components.shelly] Error fetching masterbedroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:40:41.375 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:44:29.079 ERROR (MainThread) [homeassistant.components.shelly] Error fetching livingroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:52:51.328 ERROR (MainThread) [homeassistant.components.shelly] Error fetching nodezero_electricitymonitor data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 16:54:20.374 ERROR (MainThread) [homeassistant.components.shelly] Error fetching bathroom-relays data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:04:01.328 ERROR (MainThread) [homeassistant.components.shelly] Error fetching nodezero_electricitymonitor data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:05:26.331 ERROR (MainThread) [homeassistant.components.shelly] Error fetching masterbedroom-bedsidelights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:21:44.149 ERROR (MainThread) [homeassistant.components.shelly] Error fetching joshuabedroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:23:59.328 ERROR (MainThread) [homeassistant.components.shelly] Error fetching nodezero_electricitymonitor data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:26:24.375 ERROR (MainThread) [homeassistant.components.shelly] Error fetching bathroom-relays data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:40:15.375 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:41:02.486 ERROR (MainThread) [homeassistant.components.shelly] Error fetching landing-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:45:33.148 ERROR (MainThread) [homeassistant.components.shelly] Error fetching joshuabedroom-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:54:01.486 ERROR (MainThread) [homeassistant.components.shelly] Error fetching landing-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:58:35.486 ERROR (MainThread) [homeassistant.components.shelly] Error fetching landing-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 17:59:51.486 ERROR (MainThread) [homeassistant.components.shelly] Error fetching landing-lights data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 18:22:46.374 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 18:32:17.376 ERROR (MainThread) [homeassistant.components.shelly] Error fetching Garden_HotTub data: Error fetching data: DeviceConnectionError()[0m
[31m2023-06-16 18:46:39.327 ERROR (MainThread) [homeassistant.components.shelly] Error fetching nodezero_electricitymonitor data: Error fetching data: DeviceConnectionError()[0m

the info from the previous page here

simonk1969 avatar Jun 16 '23 18:06 simonk1969

Go to "Actions" > "Reauthorize Google Drive" from the addon's main page. Near the bottom of the page is a link that will step you through the process of using your own creds.

Note that when you switch to the new secret/client_id, the addon will not longer able to see any backups it perviously uploaded. (part of Drive's security model). You'll probably want to delete the old ones manually once backups are re-uploaded using the new secret/client_id.

sabeechen avatar Jun 17 '23 15:06 sabeechen

Also worth mentioning that if you have a "hot" account (ie you have a lot of other apps writing to it) then using a your own client id/secret may not help. Accounts in Google Drive have a global rate limit that can't be worked around except by creating another account or lowering how often it gets written to.

sabeechen avatar Jun 17 '23 15:06 sabeechen

I've gone through the link that steps me through the process but at the end it says 'Take these back to the Add-on, and paste them into the appropriate fields of the add-on web-UI, and follow the instructions from there.'.

The only box I can paste into is for Authorization Code, not my Cient Id or Client Secret?

simonk1969 avatar Jun 17 '23 23:06 simonk1969

The steps are:

  1. In Google: Generate the client id and secret with Google Cloud
  2. The Addon: Go to the "Reauthorize Google Drive" page. Don't click the big button.
  3. The Addon: Click the link at the bottom where it says "To generate your own private credentials with Google instead that doesn't use a third-party domain, [click here]"
  4. The addon: Enter your client id and secret, then press submit. A special code will be generated along with a link to https://www.google.com/device
  5. In Google: Go to https://www.google.com/device, enter the code presented earlier and log in to your account
  6. The addon should automatically notice and refresh the page after a few seconds.

sabeechen avatar Jun 19 '23 16:06 sabeechen