Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensors unavailable #326

Open
flemmingss opened this issue Jan 17, 2025 · 1 comment
Open

Sensors unavailable #326

flemmingss opened this issue Jan 17, 2025 · 1 comment

Comments

@flemmingss
Copy link

Unless all relevant information is provided, I can't help you

Describe the bug
Sensors unavailable

Expected behavior
The sensors should be available

To Reproduce
Install with hacs, add integration, activate entities

General information to help debugging:

I had this problem the integration worked for a few days, but no more. Sensors unavailable.
Removed sensor in HA an HACS rebooted and reinstalled, still same.
The log has some error that looks related:

Logger: custom_components.grocy.coordinator
Kilde: helpers/update_coordinator.py:411
integrasjon: Grocy ([dokumentasjon](https://github.com/custom-components/grocy), [problemer](https://github.com/custom-components/grocy/issues))
Første forekomst: 22:36:48 (1 forekomster)
Sist logget: 22:36:48

Error fetching grocy data: Update failed: 1 validation error for TaskResponse due_date Input should be a valid datetime or date, input is too short [type=datetime_from_date_parsing, input_value='null', input_type=str] For further information visit https://errors.pydantic.dev/2.10/v/datetime_from_date_parsing
Logger: custom_components.grocy.config_flow
Kilde: custom_components/grocy/config_flow.py:95
integrasjon: Grocy ([dokumentasjon](https://github.com/custom-components/grocy), [problemer](https://github.com/custom-components/grocy/issues))
Første forekomst: 22:35:05 (1 forekomster)
Sist logget: 22:35:05

No connection adapters were found for ':/:9283/10.0.24.10/api/system/info'
@qxlwn
Copy link

qxlwn commented Feb 28, 2025

Hi,

Same issue here, was working good at the start, after an hour or two started to fail

2025-02-28 11:50:57.426 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Grocy for grocy
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
        (self._dns_host, self.port), self.timeout, **extra_kw
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/usr/local/lib/python3.13/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
    ~~~~~~~~~~~~^^^^
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 716, in urlopen
    httplib_response = self._make_request(
        conn,
    ...<5 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    conn.request(method, url, **httplib_request_kw)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/http/client.py", line 1336, in request
    self._send_request(method, url, body, headers, encode_chunked)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/http/client.py", line 1382, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/http/client.py", line 1091, in _send_output
    self.send(msg)
    ~~~~~~~~~^^^^^
  File "/usr/local/lib/python3.13/http/client.py", line 1035, in send
    self.connect()
    ~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.13/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
        self, "Failed to establish a new connection: %s" % e
    )
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f03725f9be0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
        method=request.method,
    ...<9 lines>...
        chunked=chunked,
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 802, in urlopen
    retries = retries.increment(
        method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
    )
  File "/usr/local/lib/python3.13/site-packages/urllib3/util/retry.py", line 594, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.141.28', port=9192): Max retries exceeded with url: /api/system/config (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f03725f9be0>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 637, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/grocy/__init__.py", line 45, in async_setup_entry
    coordinator.available_entities = await _async_get_available_entities(
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        coordinator.grocy_data
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/grocy/__init__.py", line 73, in _async_get_available_entities
    grocy_config = await grocy_data.async_get_config()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/grocy/grocy_data.py", line 94, in async_get_config
    return await self.hass.async_add_executor_job(wrapper)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/grocy/grocy_data.py", line 92, in wrapper
    return self.api.get_system_config()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pygrocy2/grocy.py", line 319, in get_system_config
    raw_system_config = self._api_client.get_system_config()
  File "/usr/local/lib/python3.13/site-packages/pygrocy2/grocy_api_client.py", line 735, in get_system_config
    parsed_json = self._do_get_request("system/config")
  File "/usr/local/lib/python3.13/site-packages/pygrocy2/grocy_api_client.py", line 347, in _do_get_request
    resp = requests.get(
        req_url, verify=self._verify_ssl, headers=self._headers, params=params
    )
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.141.28', port=9192): Max retries exceeded with url: /api/system/config (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f03725f9be0>: Failed to establish a new connection: [Errno 111] Connection refused'))
2025-02-28 12:02:52.745 ERROR (MainThread) [custom_components.grocy.config_flow] Expecting value: line 1 column 1 (char 0)
2025-02-28 12:04:03.398 ERROR (MainThread) [custom_components.grocy.coordinator] Error fetching grocy data: Update failed: 1 validation error for TaskResponse
2025-02-28 12:09:33.426 DEBUG (MainThread) [custom_components.grocy.coordinator] Finished fetching grocy data in 0.034 seconds (success: False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants