ljmerza / ha-our-groceries

Our Groceries Integration for Home Assistant
MIT License
38 stars 8 forks source link

Could not find session cookie when booting up HA. #17

Closed jampez77 closed 3 years ago

jampez77 commented 3 years ago

Version of the custom_component

1.3.6

Configuration


ourgroceries:
      username: !secret jamie_email
      password: !secret our_groceries_password

Describe the bug

This morning OG will not work with HA. I upgraded from core-2021.3.4 to core-2021.4.0 and immediately recieved the following error.

I tried to revert back to last known working back up but the problem still persists.

Debug log

2021-04-08 09:11:13 WARNING (MainThread) [homeassistant.loader] You are using a custom integration ourgroceries which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-04-08 09:11:13 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'ourgroceries'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'ourgroceries'
2021-04-08 09:11:17 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'media_player', 'device_tracker', 'shopping_list', 'alexa_media', 'panel_iframe', 'ourgroceries', 'notify', 'ring', 'logbook', 'map', 'homekit', 'group', 'zeroconf', 'mail_and_packages', 'sonoff', 'profiler', 'ffmpeg', 'openweathermap', 'script', 'camera', 'nodered', 'tts', 'xbox', 'automation', 'zone', 'scheduler', 'python_script', 'sun', 'input_boolean', 'conversation', 'blueprint', 'tasmota', 'switch', 'my', 'history', 'tag', 'tuya', 'input_select', 'zha', 'mqtt', 'weather', 'input_text', 'persistent_notification', 'input_datetime', 'hacs', 'system_health', 'rest_command', 'input_number', 'updater', 'binary_sensor', 'skyq', 'mobile_app', 'upnp', 'fullykiosk', 'sensor', 'ipp', 'ios', 'discovery', 'google'}
2021-04-08 09:11:17 INFO (MainThread) [homeassistant.setup] Setting up ourgroceries
2021-04-08 09:11:17 DEBUG (MainThread) [custom_components.ourgroceries] creating og instance
2021-04-08 09:11:17 DEBUG (MainThread) [custom_components.ourgroceries] logging into og
2021-04-08 09:11:17 DEBUG (MainThread) [ourgroceries] ourgroceries _get_session_cookie2021-04-08 09:11:26 ERROR (MainThread) [ourgroceries] ourgroceries Could not find cookie session
2021-04-08 09:11:26 ERROR (MainThread) [homeassistant.setup] Error during setup of component ourgroceries
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/ourgroceries/__init__.py", line 66, in async_setup
    await og.login()
  File "/usr/local/lib/python3.8/site-packages/ourgroceries/__init__.py", line 78, in login
    await self._get_session_cookie()
  File "/usr/local/lib/python3.8/site-packages/ourgroceries/__init__.py", line 98, in _get_session_cookie
    raise InvalidLoginException('Could not find session cookie')
ourgroceries.exceptions.InvalidLoginException: Could not find session cookie
2021-04-08 09:11:27 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following integrations and platforms could not be set up:

 - [ourgroceries](https://www.home-assistant.io/components/our-groceries)

Please check your config and [logs](/config/logs)., notification_id=invalid_config>
2021-04-08 09:11:27 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, friendly_name=Invalid config, message=The following integrations and platforms could not be set up:

 - [ourgroceries](https://www.home-assistant.io/components/our-groceries)

Please check your config and [logs](/config/logs). @ 2021-04-08T09:11:27.873782+01:00>>
Logger: homeassistant.setup
Source: custom_components/ourgroceries/__init__.py:66
First occurred: 8:51:45 (1 occurrences)
Last logged: 8:51:45

Error during setup of component ourgroceries
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/ourgroceries/__init__.py", line 66, in async_setup
    await og.login()
  File "/usr/local/lib/python3.8/site-packages/ourgroceries/__init__.py", line 78, in login
    await self._get_session_cookie()
  File "/usr/local/lib/python3.8/site-packages/ourgroceries/__init__.py", line 98, in _get_session_cookie
    raise InvalidLoginException('Could not find session cookie')
ourgroceries.exceptions.InvalidLoginException: Could not find session cookie
Drewskieza commented 3 years ago

Same issue on my side.

rpitera commented 3 years ago

Same issue here; I'm still on core-2021.3.4 and haven't upgraded yet. Reinstalled, also deleted and reinstalled but no difference. For me this started happening after a restart last night. I wrote it off, thinking it may have been a temporary issue with the site but it's persisting. No issues logging in from web or any of my devices to OG.

Same error message as @jampez77, Could not find find session cookie.

2021-04-08 11:10:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component ourgroceries
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/ourgroceries/__init__.py", line 66, in async_setup
    await og.login()
  File "/usr/local/lib/python3.8/site-packages/ourgroceries/__init__.py", line 78, in login
    await self._get_session_cookie()
  File "/usr/local/lib/python3.8/site-packages/ourgroceries/__init__.py", line 98, in _get_session_cookie
    raise InvalidLoginException('Could not find session cookie')
ourgroceries.exceptions.InvalidLoginException: Could not find session cookie

System Health

version core-2021.3.4
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.4.109
arch x86_64
timezone America/New_York
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4326 Installed Version | 1.11.3 Stage | running Available Repositories | 779 Installed Repositories | 53
AccuWeather can_reach_server | ok -- | -- remaining_requests | 47
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | April 16, 2021, 8:00 PM relayer_connected | true remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Hass.io host_os | Home Assistant OS 5.13 -- | -- update_channel | stable supervisor_version | supervisor-2021.03.9 docker_version | 19.03.15 disk_total | 30.8 GB disk_used | 19.9 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.1.0), ADB - Android Debug Bridge (0.8.0), ESPHome (1.16.2), Visual Studio Code (3.3.0), Let's Encrypt (4.11.0), Node-RED (8.2.1), Home Assistant Google Drive Backup (0.103.1), MariaDB (2.3.0), Check Home Assistant configuration (3.6.0), Glances (0.11.2), Bitwarden RS (0.9.0), Portainer (1.4.0), Tautulli (2.0.5), phpMyAdmin (0.2.0), ozwcp (1.1.2), php-nginx Docker Image (latest), Eufy Home Assistant MQTT Bridge (1.13.0), rest980 Docker Image (20200205), ioBroker (0.8.0)
Lovelace dashboards | 2 -- | -- resources | 45 views | 28 mode | storage
ljmerza commented 3 years ago

so unfortunately, our groceries also redesigned their site breaking the python library. the python library is an unofficial api. ill let you know when i have a fix

ljmerza commented 3 years ago

fixed in v1.3.8

rpitera commented 3 years ago

Wow, that was faster than expected!! Thanks buddy!

EDIT: Solved my problems. Thanks once again for your quick response; I use this component more than I use the WebUI and I really appreciate it.

rpitera commented 3 years ago

Just bought you a couple of coffees; wish I could afford more!

Kippy74 commented 1 year ago

And today it happened once again..

”Our groceries - Could not find coocie session”

Any ideas how to fix this?