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

Error setting up entry Netgear LM1200 for netgear_lte #108524

Closed
KSchmeeds opened this issue Jan 20, 2024 · 31 comments
Closed

Error setting up entry Netgear LM1200 for netgear_lte #108524

KSchmeeds opened this issue Jan 20, 2024 · 31 comments

Comments

@KSchmeeds
Copy link

The problem

Netgear LTE Modem Add-On has stopped working. Attempted to remove the device and add it again, but same error occurs.

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 12:38:48 AM (6 occurrences)
Last logged: 11:40:57 AM

Error setting up entry Netgear LM1200 for netgear_lte
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/netgear_lte/init.py", line 223, in async_setup_entry
await _login(hass, modem_data, password)
File "/usr/src/homeassistant/homeassistant/components/netgear_lte/init.py", line 269, in _login
await modem_data.modem.login(password=password)
File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 114, in login
await self._login(password)
File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 128, in _login
async with self.websession.get(url) as response:
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 421, in _request
raise RuntimeError("Session is closed")
RuntimeError: Session is closed

What version of Home Assistant Core has the issue?

core-2024.1.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Netgear LTE

Link to integration documentation on our website

https://www.home-assistant.io/integrations/netgear_lte

Diagnostics information

home-assistant_netgear_lte_2024-01-20T17-48-43.511Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-01-20 11:38:53.162 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Netgear LM1200 for netgear_lte
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/__init__.py", line 223, in async_setup_entry
    await _login(hass, modem_data, password)
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/__init__.py", line 269, in _login
    await modem_data.modem.login(password=password)
  File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 114, in login
    await self._login(password)
  File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 128, in _login
    async with self.websession.get(url) as response:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 421, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed

Additional information

No response

@home-assistant
Copy link

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (netgear_lte) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of netgear_lte can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign netgear_lte Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


netgear_lte documentation
netgear_lte source
(message by IssueLinks)

@cmccallu
Copy link

As another data point I'm seeing the same issue after I upgrade from a Netgear M1 -> M2.

@mdo77
Copy link

mdo77 commented Feb 4, 2024

I'm seeing the same thing. I have a Netgear LB2120.

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 4:19:40 PM (1 occurrences)
Last logged: 4:19:40 PM

Error setting up entry Netgear LB2120 for netgear_lte in HA v2024.1.6

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/__init__.py", line 223, in async_setup_entry
    await _login(hass, modem_data, password)
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/__init__.py", line 269, in _login
    await modem_data.modem.login(password=password)
  File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 114, in login
    await self._login(password)
  File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 128, in _login
    async with self.websession.get(url) as response:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1194, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 425, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed

@cmccallu
Copy link

cmccallu commented Feb 4, 2024

Upgrading to HA 2024.1.6 has fixed the issue for me with the Netgear MR2100

@def1149
Copy link

def1149 commented Feb 5, 2024

I have recently acquired an LM1200 and can't figure out how to get HA to send or receive SMS. The integration seems to be working because I can see the SMS inbound message count increase when i send sms to the device, and I can use the delete SMS service but can't figure out how to retrieve the SMS text or send outbound SMS

@KSchmeeds
Copy link
Author

@cmccallu I am on 2024.1.6 and still experiencing this issue with an LM1200.

@def1149 Please open a separate issue

@tkdrob
Copy link
Contributor

tkdrob commented Feb 5, 2024

I have recently acquired an LM1200 and can't figure out how to get HA to send or receive SMS. The integration seems to be working because I can see the SMS inbound message count increase when i send sms to the device, and I can use the delete SMS service but can't figure out how to retrieve the SMS text or send outbound SMS

Hi there. Please refer to the docs for information on receiving SMS events. https://www.home-assistant.io/integrations/netgear_lte

We use Github to only track issues with the code itself as this issue is given the OP's information. If you still cannot figure it out from the instructions, please head over to the Home Assistant Community forum or the Discord channel for support.

As for this issue, I have been watching the comments and was not confident the latest patch release had anything to do with this issue. I am still trying to find out why the websocket is closed when we use it almost immediately. This seems to happen on slower machines which could make the case for a race condition.

I assume everyone here has only one modem? All modems should work but I just wanted to ask. Has everyone removed the yaml config? What about removing yaml, restarting, and then setting up? This config flow update went through a lot of testing but alas I can't get everything right the first time around.

@KSchmeeds
Copy link
Author

I never used the original YAML version, but only the newer one available in the GUI. It worked fine for while, then I noticed it stopped working, even after deleting the device and readding it. I got it to work again briefly once, but no luck since.

I did notice that there is a 302 redirect if I attempt to use curl to the modem LTE IP address and the ip address /index.html. Is there perhaps an issue with following the redirect?

@mdo77
Copy link

mdo77 commented Feb 5, 2024

As for this issue, I have been watching the comments and was not confident the latest patch release had anything to do with this issue. I am still trying to find out why the websocket is closed when we use it almost immediately. This seems to happen on slower machines which could make the case for a race condition.

I assume everyone here has only one modem? All modems should work but I just wanted to ask. Has everyone removed the yaml config? What about removing yaml, restarting, and then setting up? This config flow update went through a lot of testing but alas I can't get everything right the first time around.

Only one modem here. The yaml config has been removed for some time. I have removed the integration completely and re-added it with no improvement.

I will note that if I restart Home Assistant, sometimes it will connect as usual, but that's maybe one out of 5 times. As far as possible slowness goes, I am running on a virtual machine on a NAS server, which does well for me most of the time, but figure it may be a data point for you.

@mdo77
Copy link

mdo77 commented Feb 5, 2024

Additionally, I set up Debug Logging and then removed and re-added the integration. Here's what showed up in my logs. I truncated the big JSON blob that it pulled as it had a lot of personal info (messages, phone numbers, IMEI, etc) that shows it does successfully initally connect to the modem.

2024-02-05 14:55:41.816 DEBUG (MainThread) [eternalegypt.eternalegypt] Token: xxx

2024-02-05 14:55:41.829 DEBUG (MainThread) [eternalegypt.eternalegypt] Got cookie with status 204

2024-02-05 14:55:42.088 DEBUG (MainThread) [eternalegypt.eternalegypt] Did read information: {'custom': {'AtTcpEnable': True, 'end': 0}, 'webd': {'adminPassword': '****************', 'ownerModeEnabled': False...

2024-02-05 14:55:42.089 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Netgear LB2120 for netgear_lte

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/__init__.py", line 223, in async_setup_entry
    await _login(hass, modem_data, password)
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/__init__.py", line 269, in _login
    await modem_data.modem.login(password=password)
  File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 114, in login
    await self._login(password)
  File "/usr/local/lib/python3.11/site-packages/eternalegypt/eternalegypt.py", line 128, in _login
    async with self.websession.get(url) as response:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1194, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 425, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed

@ausfas
Copy link

ausfas commented Feb 9, 2024

Those on 2024.1.6, please get ready to live with it as I have raised it against 2024.2.0 and it was closed. With 2024.2.0 the issue will be at least permanent error for LB2120 not sure for others. Hoping others will start reporting too.

@ausfas
Copy link

ausfas commented Feb 9, 2024 via email

@ahrens26
Copy link

ahrens26 commented Feb 9, 2024

On 2024.2.1 with LM1200, same issue.

@ausfas
Copy link

ausfas commented Feb 10, 2024 via email

@cmccallu
Copy link

Broken on 2024.2.1 with my Netgear MR2100

@nonobzh29
Copy link

Same here on 2024.2.1 and Netgear LB2120.
I tried to reset the modem config to default, but still the same issue.

@spaulson500
Copy link

Same with 2024.2.1 and LM1200. All was fine when using YAML version.

@DarKOrange75
Copy link

Same issue here, the integration is broken on 2024.2.1 with MR2100

@tkdrob
Copy link
Contributor

tkdrob commented Feb 12, 2024

For everyone here, either wait for the mitigation to be in the next patch release or manually make the change IF you know what you are doing. Have a look at the the above pull request for what to do after a restart.

@KSchmeeds
Copy link
Author

I updated my HA Core 20 2024.2.2 and while the integration does load now, it will only work for a couple minutes before the entities fall to an unavailable state. I also noticed that now most of the entities are disabled by default and I needed to enable them, but no data would show up.

@KSchmeeds
Copy link
Author

It appears that after enabling the entities, a restart of Home Assistant is necessary.

@DarKOrange75
Copy link

It’s working again after the upgrade and for more than one hour now… thank you 😊

@ausfas
Copy link

ausfas commented Feb 16, 2024

All good for me, thanks ☺️

@mdo77
Copy link

mdo77 commented Feb 17, 2024

Works here too. Appreciate the help!

@obatiuk
Copy link

obatiuk commented Feb 17, 2024

It works after upgrade to 2024.2.2. Restart is necessary. Thanks!

@mingaldrichgan
Copy link

Works perfectly; thank you @tkdrob! Funnily enough, even though this is supposed to mitigate the issue by reloading the integration, it is working 100% of the time for me upon (re)starting HA, whereas on the previous release it failed 100% of the time.

@ausfas
Copy link

ausfas commented Mar 25, 2024

It's broken again with HA Core 2024.3.3.
Anyone facing the same issue. This time integration is picked up but all entries are red.

Logger: homeassistant.config_entries
Source: config_entries.py:672
First occurred: 8:26:53 AM (2 occurrences)
Last logged: 8:26:53 AM

Error unloading entry Netgear LB2120 for binary_sensor
Error unloading entry Netgear LB2120 for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 672, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 244, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

If these log files can help

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 8:12:34 AM (1 occurrences)
Last logged: 8:12:34 AM

[546861665216] 'netgear_lte'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 611, in _service_handler
    response = await self._async_start_run(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 569, in _async_start_run
    script_result = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 600, in _async_run
    return await self.script.async_run(script_vars, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1600, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1140, in async_run
    await super().async_run()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 435, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 487, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 512, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 265, in _async_notify_message_service
    await self.async_send_message(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/netgear_lte/notify.py", line 37, in async_send_message
    modem_data = self.hass.data[DOMAIN].get_modem_data(self.config)
                 ~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'netgear_lte'

@cmccallu
Copy link

I'm not seeing any issues with HA Core 2024.3.3. I restarted HA Core only and then the rpi running hassio and all good for me mate!

@ausfas
Copy link

ausfas commented Mar 25, 2024 via email

@cmccallu
Copy link

Glad it's work for you now!

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests