Skip to content
New issue

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

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

Already on GitHub? # to your account

Unknown error when trying to set up the integration and # #10

Open
reebgogs opened this issue Jan 8, 2024 · 10 comments
Open

Unknown error when trying to set up the integration and # #10

reebgogs opened this issue Jan 8, 2024 · 10 comments

Comments

@reebgogs
Copy link

reebgogs commented Jan 8, 2024

"Unknown error occurred"

I confirmed that I am using the correct username/password by signing into wm.com

Please advise

@schergr
Copy link

schergr commented Jan 12, 2024

I had a similair problem when installing this morning. I messed up the paspword entry on the first try. Second try I got it right, but the flow had broken. I had to remove the integration, and re-add it. Then it worked.

@reebgogs
Copy link
Author

Thanks for the tip. Unfortunately, it didn't help mine.
I uninstalled Waste Management from HACS, restarted HA, added Waste Management to HACS, restarted HA, added Waste Management as an Integration and got the same error. I confirmed that my username/password works on the wm.com site.

@dcmeglio
Copy link
Owner

Unfortunately I no longer have waste management service, so I'm not able to test as I can't access the system without a username and password. If someone else raises a PR to fix the issue I'm happy to review and merge.

@azchohfi
Copy link

It listed my service address properly, but it fails when I select the address and click on Submit.
On the logs, I see an error on this line:

self.wmData.services = await self._wmclient.async_get_services(

@azchohfi
Copy link

Logger: custom_components.waste_management.config_flow
Source: custom_components/waste_management/config_flow.py:122
integration: Waste Management ([documentation](https://github.com/dcmeglio/homeassistant-waste_management/blob/master/README.md), [issues](https://github.com/dcmeglio/homeassistant-waste_management/issues))
First occurred: 5:52:03 PM (7 occurrences)
Last logged: 6:02:05 PM

Unexpected exception Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/config/custom_components/waste_management/config_flow.py", line 122, in async_step_services
    self.wmData.services = await self._wmclient.async_get_services(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/waste_management/client.py", line 154, in async_get_services
    jsonData = await self.async_api_get(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/waste_management/client.py", line 271, in async_api_get
    return json.loads(response.content.decode("UTF-8"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@azchohfi
Copy link

There was another log with more details:

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/waste_management/config_flow.py", line 114, in async_step_accounts
    return await self.async_step_services()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/waste_management/config_flow.py", line 128, in async_step_services
    self._services = {x.id: x.name for x in self.wmData.services}
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

@dcmeglio
Copy link
Owner

Unfortunately I no longer have a Waste Management account. WM significantly increased prices in my area forcing me to switch providers. If someone is interested in submitting a PR, I'd be happy to include it, but unfortunately without an account I can't fix it myself.

@azchohfi
Copy link

I'm happy to help debug this on my instance, but I'm not that familiar with Home Assistant extensions. Any pointers into how I can debug this?

@dcmeglio
Copy link
Owner

You'd run Home Assistant in a vscode dev container and step through the extension using debugpy. https://developers.home-assistant.io/docs/development_environment/
https://www.home-assistant.io/integrations/debugpy/

@azchohfi
Copy link

azchohfi commented Aug 2, 2024

I'll give that a go later, thank you!

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

No branches or pull requests

4 participants