mercedes_me_api icon indicating copy to clipboard operation
mercedes_me_api copied to clipboard

Integration failed to initialize

Open lolongan opened this issue 4 years ago • 8 comments

Hi,

I followed all the instructions, including putting the token file in the config directory. Upon restarting HASS I got the following errors and mercedesme integration failed to initialize.

2021-01-10 02:38:21 ERROR (SyncWorker_4) [custom_components.mercedesmeapi.resources] Error retrieving available resources - Bad Request (400)
2021-01-10 02:38:21 ERROR (SyncWorker_4) [custom_components.mercedesmeapi.resources] Error retrieving available resources
2021-01-10 02:38:21 ERROR (SyncWorker_4) [custom_components.mercedesmeapi.resources] Error retrieving resource list.
2021-01-10 02:38:21 ERROR (SyncWorker_4) [custom_components.mercedesmeapi] Error initializing resources
2021-01-10 02:38:22 ERROR (MainThread) [homeassistant.setup] Setup failed for mercedesmeapi: Integration failed to initialize.

Can you help and point me how to fix ?

Note: the configuration.yaml file includes the followings:

mercedesmeapi:
  client_id: !secret mercedes_client_id
  client_secret: !secret mercedes_client_secret
  vehicle_id: !secret mercedes_vehicle_id
  enable_resources_file: false
  scan_interval: 120

lolongan avatar Jan 10 '21 01:01 lolongan

I had the same yesterday. However, trying now it appears to retrieve the resources. Please try again.

andilge avatar Jan 10 '21 10:01 andilge

I have just retried after reading your reply. Same errors. Note that before retrying I had also taken a ride with my car.

2021-01-10 11:31:28 ERROR (SyncWorker_0) [custom_components.mercedesmeapi.resources] Error retrieving available resources - Bad Request (400)
2021-01-10 11:31:28 ERROR (SyncWorker_0) [custom_components.mercedesmeapi.resources] Error retrieving available resources
2021-01-10 11:31:28 ERROR (SyncWorker_0) [custom_components.mercedesmeapi.resources] Error retrieving resource list.
2021-01-10 11:31:28 ERROR (SyncWorker_0) [custom_components.mercedesmeapi] Error initializing resources
2021-01-10 11:31:28 ERROR (MainThread) [homeassistant.setup] Setup failed for mercedesmeapi: Integration failed to initialize.

some more details I can grab:

1st line error: Logger: custom_components.mercedesmeapi.resources, Source: custom_components/mercedesmeapi/resources.py:159
2nd line: Logger: custom_components.mercedesmeapi.resources, Source: custom_components/mercedesmeapi/resources.py:183
3rd line: Logger: custom_components.mercedesmeapi.resources, Source: custom_components/mercedesmeapi/resources.py:142
4th line: Logger: custom_components.mercedesmeapi, Source: custom_components/mercedesmeapi/__init__.py:91
5th line: Logger: homeassistant.setup, Source: setup.py:138

lolongan avatar Jan 10 '21 10:01 lolongan

did you try

enable_resources_file: true

and

enable_resources_file: false

in HA's configuration.yaml?

andilge avatar Jan 10 '21 10:01 andilge

I think there is something wrong in Mercedes api. I have the same problem!

Il giorno dom 10 gen 2021 alle 11:49 andilge [email protected] ha scritto:

did you try

enable_resources_file: true

and

enable_resources_file: false

in HA's configuration.yaml?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xraver/mercedes_me_api/issues/28#issuecomment-757455244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJM7AYUOBH34EEDHRRMLL3SZGA5NANCNFSM4V4A56PQ .

xraver avatar Jan 10 '21 11:01 xraver

I tried enabling resources file, got one more error:

2021-01-10 12:28:28 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Resource File missing - Creating a new one.
2021-01-10 12:28:28 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Error retrieving available resources - Bad Request (400)
2021-01-10 12:28:28 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Error retrieving available resources
2021-01-10 12:28:28 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Error retrieving resource list.
2021-01-10 12:28:28 ERROR (SyncWorker_1) [custom_components.mercedesmeapi] Error initializing resources
2021-01-10 12:28:29 ERROR (MainThread) [homeassistant.setup] Setup failed for mercedesmeapi: Integration failed to initialize.

then reversed back to false and got back the 5 errors

2021-01-10 12:31:22 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Error retrieving available resources - Bad Request (400)
2021-01-10 12:31:22 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Error retrieving available resources
2021-01-10 12:31:22 ERROR (SyncWorker_1) [custom_components.mercedesmeapi.resources] Error retrieving resource list.
2021-01-10 12:31:22 ERROR (SyncWorker_1) [custom_components.mercedesmeapi] Error initializing resources
2021-01-10 12:31:23 ERROR (MainThread) [homeassistant.setup] Setup failed for mercedesmeapi: Integration failed to initialize.

lolongan avatar Jan 10 '21 11:01 lolongan

same here, here is a copy of my logs: 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi.resources] Error retrieving available resources - Forbidden (403) 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi.resources] Error retrieving available resources 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi.resources] Error retrieving resource list. 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi] Error initializing resources

elad71 avatar Jan 18 '21 04:01 elad71

same here, here is a copy of my logs: 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi.resources] Error retrieving available resources - Forbidden (403) 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi.resources] Error retrieving available resources 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi.resources] Error retrieving resource list. 2021-01-17 20:42:57 ERROR (SyncWorker_3) [custom_components.mercedesmeapi] Error initializing resources

what happens if you do this request by python script or bash? thankl

xraver avatar Jan 18 '21 08:01 xraver

I experienced this same problem today. In my case the reason was a mistyped VIN-number in the vehicle_id-parameter. So if someone else gets this error it's probably a good idea to double-check the information in the config.

h4nsen avatar May 05 '21 14:05 h4nsen