Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Addon stopped working #22

Open
simon-mueller opened this issue Feb 18, 2024 · 8 comments
Open

Addon stopped working #22

simon-mueller opened this issue Feb 18, 2024 · 8 comments
Labels
bug Something isn't working Dependency A issue within the backend dependency and not the integration itself

Comments

@simon-mueller
Copy link

simon-mueller commented Feb 18, 2024

The problem

The addon doesn't retrieve any data.

What version of Home Assistant Core has the issue?

2024.2.2

What version of Rewe Integration has the issue?

2024.01.0

What type of installation are you running?

Home Assistant OS

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-02-17 10:30:38.490 DEBUG (MainThread) [custom_components.rewe.sensor] Sensor async_setup_entry
2024-02-17 10:30:38.811 ERROR (MainThread) [custom_components.rewe.sensor] Cannot retrieve discounts for: 840377 - Maybe a typo or the server rejected the request.
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/rewe/sensor.py", line 135, in async_update
    data = await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/rewe/sensor.py", line 202, in fetch_rewe_discounts
    data = self._session.get(url).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-02-17 10:30:38.816 ERROR (MainThread) [custom_components.rewe.sensor] Cannot retrieve data for: '840377'
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/rewe/sensor.py", line 135, in async_update
    data = await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/rewe/sensor.py", line 202, in fetch_rewe_discounts
    data = self._session.get(url).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/rewe/sensor.py", line 193, in async_update
    _LOGGER.exception('{}'.format(url, data['error']))
                                  ^^^
NameError: name 'url' is not defined

Additional information

It stopped working on Feb, 7th. I install the homeassistant updates quite promptly. So maybe this has to do with a new version of homeassistant itself.

@olant
Copy link

olant commented Feb 25, 2024

This happened due to API changes in the REWE backend and is fixed in a dedicated branch: https://github.com/foo-git/rewe-discounts/tree/additional_retrieval_method

@DominikLudwig1995
Copy link

Do you have a corresponding github issue in the REWE backend repository to fix this problem?

@FaserF
Copy link
Owner

FaserF commented Mar 4, 2024

Do you have a corresponding github issue in the REWE backend repository to fix this problem?

Not needed, its fixed in the backend repo. I will need to merge it within the HA integration which I haven't had the time yet. But a fix will definitely come.

https://github.com/foo-git/rewe-discounts/releases/tag/v2.6

@FaserF FaserF added bug Something isn't working Dependency A issue within the backend dependency and not the integration itself labels Mar 4, 2024
FaserF added a commit that referenced this issue Mar 17, 2024
@FaserF
Copy link
Owner

FaserF commented Mar 17, 2024

Should now be working again with the latest version of this integration 2024.03.0

@simon-mueller
Copy link
Author

It's still not working for me. In the logs I can see this:

2024-03-17 15:44:57.824 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for sensor.rewe_840377 exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

@FaserF
Copy link
Owner

FaserF commented Mar 17, 2024

It's still not working for me. In the logs I can see this:

2024-03-17 15:44:57.824 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for sensor.rewe_840377 exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

This has nothing to do with this here, see: #14

@simon-mueller
Copy link
Author

Did they make changes to the API again?

This error originated from a custom integration.

Logger: custom_components.rewe.sensor
Source: custom_components/rewe/sensor.py:204
integration: Rewe Discounts (documentation, issues)
First occurred: March 31, 2024 at 09:54:29 (4 occurrences)
Last logged: 16:00:28

FAIL: In the returned query, no data was found. The API output seems to have changed and the code needs to be adjusted. Please report it to https://github.com/foo-git/rewe-discounts and not the HA integration developer!
Traceback (most recent call last):
  File "/config/custom_components/rewe/sensor.py", line 166, in async_update
    for category in data['categories']:
                    ~~~~^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/rewe/sensor.py", line 204, in async_update
    for filter in data['filters']:
                  ~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

@FaserF
Copy link
Owner

FaserF commented Apr 3, 2024

Yes, has changed again, see: foo-git/rewe-discounts#19

@FaserF FaserF pinned this issue Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Dependency A issue within the backend dependency and not the integration itself
Projects
None yet
Development

No branches or pull requests

4 participants