home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.74k forks source link

Asuswrt broken after 2021.5 #50132

Closed ramakersr closed 3 years ago

ramakersr commented 3 years ago

The problem

Problem with Asuswrt. After installing 2021.5, the asuswrt integration was broken. I removed the integration and tried to install it again without success. Can’t connect to the router. Credentials are ok. In the router I see this: “No matching algo hostkey”

What is version of Home Assistant Core has the issue?

2021.5.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Asuswrt

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.asuswrt.config_flow
Source: components/asuswrt/config_flow.py:115 
Integration: asuswrt (documentation, issues) 
First occurred: 5 mei 2021 22:36:50 (15 occurrences) 
Last logged: 5 mei 2021 23:28:39

Error connecting to the AsusWrt router at 192.168.168.230

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

asuswrt documentation asuswrt source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @kennedyshead, @ollo69, mind taking a look at this issue as its been labeled with an integration (asuswrt) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

ollo69 commented 3 years ago

Looks like the issue is in the ssh key / algorithm used to connect with the router. Can you provide more details on the authentication method used? What was the last working version of Home Assistant Core? Did you also update router firmware recently?

ramakersr commented 3 years ago

Hello, Authentication with username and password. Previous version: 2021.4.6 No firmware update of the router recently.

Verstuurd vanaf mijn iPhone

Op 6 mei 2021 om 00:27 heeft ollo69 @.***> het volgende geschreven:

 Looks like the issue is in the ssh key / algorithm used to connect with the router. Can you provide more details on the authentication method used? What was the last working version of Home Assistant Core? Did you also update router firmware recently?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

bojo-4-sho commented 3 years ago

Same issue after upgrading to 2021.5 from 2021.4.6. No changes to router recently

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 269, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/usr/src/homeassistant/homeassistant/components/asuswrt/init.py", line 123, in async_setup_entry await router.setup() File "/usr/src/homeassistant/homeassistant/components/asuswrt/router.py", line 219, in setup await self._api.connection.async_connect() File "/usr/local/lib/python3.8/site-packages/aioasuswrt/connection.py", line 77, in async_connect self._client = await asyncssh.connect(self._host, **kwargs) File "/usr/local/lib/python3.8/site-packages/asyncssh/connection.py", line 6685, in connect return await _connect(options, loop, flags, conn_factory, File "/usr/local/lib/python3.8/site-packages/asyncssh/connection.py", line 228, in _connect await conn.wait_established() File "/usr/local/lib/python3.8/site-packages/asyncssh/connection.py", line 2161, in wait_established await self._waiter asyncssh.misc.ConnectionLost: Connection lost

efbick commented 3 years ago

Same issue as stated above after upgrading to 2021.5. Removed integration and now cannot add it back due to failed login.

ollo69 commented 3 years ago

I have no issue after update. What OS are u using?

vlumikero commented 3 years ago

+1 here. Happy to help with troubleshooting if I can.

efbick commented 3 years ago

I have no issue after update. What OS are u using?

I'm using a RPI4 with Home Assistant OS 5.13

bojo-4-sho commented 3 years ago

I have no issue after update. What OS are u using?

I am also on RPI4 with Home Assistant OS 5.13.

severholm commented 3 years ago

+1. Same issue as stated above after upgrading to 2021.5. Removed integration and now cannot add it back due to failed login. Ssh. Ligin, password. Home Assistant Supervised, Debian GNU/Linux 10 (buster) 4.19.0-16-amd64.

ollo69 commented 3 years ago

Because Asus library is not changed, I suppose that there is some conflict with new HA version. May be there are some relation in with issue in PR #48582?

ramakersr commented 3 years ago

Verstuurd vanaf mijn iPhone

Op 6 mei 2021 om 13:42 heeft ollo69 @.***> het volgende geschreven:

 I have no issue after update. What OS are u using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

pergolafabio commented 3 years ago

i just updated, no issue here on my side, running HassOS , on esxi , asus rt-ac88u

murkumurdok commented 3 years ago

Same issue on 2021.5, no recent ASUS firmware update, worked fine on 4.6

Error setting up entry 192.168.3.1 for asuswrt Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 269, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/usr/src/homeassistant/homeassistant/components/asuswrt/__init__.py", line 123, in async_setup_entry await router.setup() File "/usr/src/homeassistant/homeassistant/components/asuswrt/router.py", line 219, in setup await self._api.connection.async_connect() File "/usr/local/lib/python3.8/site-packages/aioasuswrt/connection.py", line 77, in async_connect self._client = await asyncssh.connect(self._host, **kwargs) File "/usr/local/lib/python3.8/site-packages/asyncssh/connection.py", line 6685, in connect return await _connect(options, loop, flags, conn_factory, File "/usr/local/lib/python3.8/site-packages/asyncssh/connection.py", line 228, in _connect await conn.wait_established() File "/usr/local/lib/python3.8/site-packages/asyncssh/connection.py", line 2161, in wait_established await self._waiter asyncssh.misc.ConnectionLost: Connection lost

gazzaman2k commented 3 years ago

killed my asus wrt too when upgrading to latest home assistant, cannot log back into router when re adding the intergration but can log in fine via putty

im on intel nuc image

smarjancic commented 3 years ago

Same issue as others, integration cannot be setup, but can normally ssh to router using either password or public key.

ollo69 commented 3 years ago

Could someone check in router logs what happen when HA try to connect?

bojo-4-sho commented 3 years ago

Could someone check in router logs what happen when HA try to connect?

Heres a log from two attempts trying to add the integration.

May 7 20:22:08 dropbear[5792]: Exit before auth from <192.168.1.147:55352>: No matching algo hostkey May 7 20:22:24 dropbear[5796]: Exit before auth from <192.168.1.147:55426>: No matching algo hostkey

The above two are with username:password. Attempting with a SSH that works fine in putty yields similar results but has one additional line.

May 7 20:36:50 dropbear[6097]: Child connection from 192.168.1.147:60406 May 7 20:36:50 dropbear[6097]: Exit before auth from <192.168.1.147:60406>: No matching algo hostkey

ramakersr commented 3 years ago

Same error here in the log(in yellow)

Verstuurd vanaf mijn iPhone

Op 7 mei 2021 om 14:23 heeft bojo-4-sho @.***> het volgende geschreven:

 Could someone check in router logs what happen when HA try to connect?

May 7 20:22:08 dropbear[5792]: Exit before auth from <192.168.1.147:55352>: No matching algo hostkey May 7 20:22:24 dropbear[5796]: Exit before auth from <192.168.1.147:55426>: No matching algo hostkey

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ollo69 commented 3 years ago

I think that someone with more experience in ssh should attend here to provide additional help. I suppose that something is changed HA side and so the ssh algorithm used to connect with the router is not available anymore client side. An additional info that could probably help is the type and version of firmware that you are using on the router, may be an update to last version of firmware on the router will help. From my side I can say that my router is running the last version of AsusWRT-Merlin (386.2_4) and everything works fine .

smarjancic commented 3 years ago

Working for me after updating firmware to AsusWRT-Merlin (386.2_4).

ramakersr commented 3 years ago

Too bad. Here stuck to merlin 384.13_10 , the last Merlin firmware for the RT-AC87U. Until this version of HA, the asuswrt integration was ok…

Verstuurd vanaf mijn iPhone

Op 7 mei 2021 om 18:09 heeft Sasa Marjancic @.***> het volgende geschreven:

 Working for me after updating firmware to AsusWRT-Merlin (386.2_4).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

gazzaman2k commented 3 years ago

I have ac87u too and cannot update any more as merlin has been cancelled for that router

ollo69 commented 3 years ago

Don't now if you have special requirement, but Asus released a more recent versions of firmware for this router that in some case include some of the features implemented in merlin version.

esdcmc commented 3 years ago

same here: everything was ok until the day before yesterday, Then I updated to core 2021.5.0 and got Asuswrt failed to setup with about 100 tracked device all showing failed/off-line. Router is DSL-AC52U, always worked ok, initially through telnet and lately through SSH I am now trying to restore core 4.6: finger crossed! (I never tried to restored back-up cores before)

kangaroomadman commented 3 years ago

I'm in the same boat as a few others with the AC87U so cannot upgrade to a later version of firmware.

I've had a little dig around this, and my current assumption is that it may actually be broken by an updated version of asyncssh which aioasuswrt uses.

A similar problem has occurred previously in #37269 which was fixed by pinning the asyncssh version to 2.3.0. This pinning was then removed in aioasuswrt 1.3.1 (which was in use by home assistant until 2021.5).

Basically - I can get v1.3.1 and v.1.3.3 to both fail dependent on the asyncssh version in use, so it's not a direct problem with aioasuswrt. asyncssh v2.2 fails, v2.3 to v2.5 works and v2.6 fails again. So there is an assumption here that home assistant is using v2.6.

I guess a couple of ways this can be fixed in aioasuswrt:

  1. pin the asyncssh version again to v2.5 but this may not be ideal
  2. force the host key algorithm used by asyncssh to one that works with older versions of ASUS FW
esdcmc commented 3 years ago

much respect for the explanation you gave above, but I'll be damned if I can follow any word of it :) I successfully got back to 4.6 (thus re-establishing normal communication to the router) and will keep tracking this post to understand when to allow a new core update. I cannot afford to live without the tracker as I've got quite a few Node-Red algorithms that are based on it.

Twit123 commented 3 years ago

I run AsusWRT Merlin 384.12 and had the same issue. I went into the router and changed the "enable ssh" from LAN to LAN+WAN, restarted HASS and the error went away.

I then changed the router back to LAN only and rebooted HASS again and the problem has not come back.

I'm not sure if this forces a new key or something. Maybe someone else can try this.

Simon

bojo-4-sho commented 3 years ago

Im on Asus Merlin 384.13_10 for a RT-AC87U.

I run AsusWRT Merlin 384.12 and had the same issue. I went into the router and changed the "enable ssh" from LAN to LAN+WAN, restarted HASS and the error went away.

I then changed the router back to LAN only and rebooted HASS again and the problem has not come back.

I'm not sure if this forces a new key or something. Maybe someone else can try this.

Simon

Im on Asus Merlin 384.13_10 for a RT-AC87U. and adjusted those settings (LAN+WAN) and restarted everything. No joy, same faults as above.

GoNzCiD commented 3 years ago

I have also the same issue with AC87U after upgrade to 2021.5. I have to go back to 2021.4, and it works like a charm again...

kangaroomadman commented 3 years ago

Looking at my install of 2021.5, it does appear asynsssh v2.6 is currently used:

bash-5.0# pip show asyncssh
Name: asyncssh
Version: 2.6.0
Summary: AsyncSSH: Asynchronous SSHv2 client and server library
Home-page: http://asyncssh.timeheart.net
Author: Ron Frederick
Author-email: ronf@timeheart.net
License: Eclipse Public License v2.0
Location: /usr/local/lib/python3.8/site-packages
Requires: cryptography
Required-by: aioasuswrt

If I install the older v2.5 version (pip install asyncssh==2.5.0) and restart home assistant then the asuswrt integration springs back to life.

ollo69 commented 3 years ago

If I install the older v2.5 version (pip install asyncssh==2.5.0) and restart home assistant then the asuswrt integration springs back to life.

Asyncssh 2.6.0 was released on May 1st as reported by change-log, so does make sense that update of the library change something and caused the issue. As I see in the setup file aioasuswrt library do not require a specific version of asyncssh, I don't know if this should be changed. Probably this issue should be moved to the library repo.

vlumikero commented 3 years ago

Does anyone have an idea on how this should proceed? Is someone here still troubleshooting?Should an issue be raised in the aiosuswrt repo?

kangaroomadman commented 3 years ago

I have submitted a PR (https://github.com/kennedyshead/aioasuswrt/pull/74) to the aioasuswrt library.

There is a question over whether my particular fix will break SSH connections to newer versions of ASUS firmware so, if possible, if someone with a 386.* version FW could try my aioasuswrt patch to confirm and comment on the PR that would probably help speed things up (It's probably simplest to try outside of HA).

kennedyshead commented 3 years ago

Sorry been away! Tested @kangaroomadman PR and it looks ok for me on my merlin (latest version)

kennedyshead commented 3 years ago

version 1.3.4 of aioasuswrt is now available on pypi

Mariusthvdb commented 3 years ago

will this be a .x update, or do we have to wait for the 2021.6? Hope this can be squeezed in the next patch release?

ollo69 commented 3 years ago

Think will be in next minor release because it fix an issue, but not sure about this.

Mariusthvdb commented 3 years ago

afraid not: https://github.com/home-assistant/core/releases/tag/2021.5.3

kangaroomadman commented 3 years ago

Not exactly sure on the process, but I think the milestone needs setting for https://github.com/home-assistant/core/pull/50414 to 2021.5.4

ollo69 commented 3 years ago

Also not sure about the process, I'm afraid the problem is that the PR hasn't been tagged as bug fix. No milestone set for now.

kangaroomadman commented 3 years ago

Can that be done after the PT has been closed? Perhaps something the owner (@kennedyshead) or the reviewer (@Danielhiversen) can do?

Danielhiversen commented 3 years ago

I added 2021.5.4 milestone now