core icon indicating copy to clipboard operation
core copied to clipboard

Error setting up entry Netgear LM1200 for netgear_lte

Open KSchmeeds opened this issue 1 year ago • 25 comments

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

KSchmeeds avatar Jan 20 '24 17:01 KSchmeeds

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)

home-assistant[bot] avatar Jan 20 '24 17:01 home-assistant[bot]

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

cmccallu avatar Jan 29 '24 22:01 cmccallu

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

mdo77 avatar Feb 04 '24 21:02 mdo77

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

cmccallu avatar Feb 04 '24 22:02 cmccallu

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

def1149 avatar Feb 05 '24 18:02 def1149

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

@def1149 Please open a separate issue

KSchmeeds avatar Feb 05 '24 18:02 KSchmeeds

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.

tkdrob avatar Feb 05 '24 18:02 tkdrob

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?

KSchmeeds avatar Feb 05 '24 19:02 KSchmeeds

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 avatar Feb 05 '24 19:02 mdo77

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

mdo77 avatar Feb 05 '24 20:02 mdo77

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 avatar Feb 09 '24 08:02 ausfas

Since some have reported occasional issue, the developer of this code believes it's an ad-hoc issue and my issue was closed. But I have confirmed it's fully broken in 2024.2.0, without fixing the code L2120 is useless to me.

On Sat, 10 Feb 2024, 12:07 am mdo77, @.***> wrote:

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.

Sorry, not sure I'm understand your wording there. If I have LB2120 and upgrade to 2024.2 is it fixed? Or permanently erroring?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/108524#issuecomment-1935899128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVKPZHS5DIYJ45Q6IAVIXHLYSYNSPAVCNFSM6AAAAABCDK6J36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVHA4TSMJSHA . You are receiving this because you commented.Message ID: @.***>

ausfas avatar Feb 09 '24 23:02 ausfas

On 2024.2.1 with LM1200, same issue.

ahrens26 avatar Feb 09 '24 23:02 ahrens26

I knew, convince tkdrob to fix this issue. I have started looking at buying Huwavi LTE can't afford to wait and have it fixed.

On Sat, 10 Feb 2024, 10:46 am Rich Ahrens, @.***> wrote:

On 2024.2.1 with LM1200, same issue.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/108524#issuecomment-1936746569, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVKPZHUNT35V7M3QD4JUB2TYS2YOXAVCNFSM6AAAAABCDK6J36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWG42DMNJWHE . You are receiving this because you commented.Message ID: @.***>

ausfas avatar Feb 10 '24 00:02 ausfas

Broken on 2024.2.1 with my Netgear MR2100

cmccallu avatar Feb 10 '24 00:02 cmccallu

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

nonobzh29 avatar Feb 10 '24 08:02 nonobzh29

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

spaulson500 avatar Feb 10 '24 20:02 spaulson500

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

DarKOrange75 avatar Feb 11 '24 09:02 DarKOrange75

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.

tkdrob avatar Feb 12 '24 20:02 tkdrob

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 avatar Feb 16 '24 19:02 KSchmeeds

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

KSchmeeds avatar Feb 16 '24 19:02 KSchmeeds

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

DarKOrange75 avatar Feb 16 '24 21:02 DarKOrange75

All good for me, thanks ☺️

ausfas avatar Feb 16 '24 23:02 ausfas

Works here too. Appreciate the help!

mdo77 avatar Feb 17 '24 01:02 mdo77

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

obatiuk avatar Feb 17 '24 03:02 obatiuk

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.

mingaldrichgan avatar Feb 18 '24 15:02 mingaldrichgan

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'

ausfas avatar Mar 25 '24 09:03 ausfas

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!

cmccallu avatar Mar 25 '24 09:03 cmccallu

Not sure, rebooted RPI and modem yesterday didn't work but after your message rebooted RPI...bingo ...all good, thanks

On Mon, 25 Mar 2024, 8:43 pm Chris McCallum, @.***> wrote:

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!

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/108524#issuecomment-2017593447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVKPZHXRBUD3HDKXWZUUOZDYZ7WSXAVCNFSM6AAAAABCDK6J36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJXGU4TGNBUG4 . You are receiving this because you commented.Message ID: @.***>

ausfas avatar Mar 25 '24 12:03 ausfas

Glad it's work for you now!

cmccallu avatar Mar 25 '24 12:03 cmccallu