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
71.14k stars 29.81k forks source link

Netgear - "Failed to get info from router" #122777

Open heyhewmike opened 1 month ago

heyhewmike commented 1 month ago

The problem

I am unable to connect to the router via the integration. I have been able to reach the router UI from various subnets without issues. I have installed pynetgear on my laptop and have been able to login via my terminal session however HA is failing to login.

All host, user, passwords are all confirmed to be the same but redacted for security.

HA_Integration HA_Logs Win_Terminal

What version of Home Assistant Core has the issue?

core-2024.7.0

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

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No YAML configuration option available

Anything in the logs that might be useful for us?

Please see screenshots.

Additional information

This appears to be a repeatedly opened issue and repeatedly closed by a bot due to inactivity.

home-assistant[bot] commented 1 month ago

Hey there @hacf-fr, @quentame, @starkillerog, mind taking a look at this issue as it has been labeled with an integration (netgear) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `netgear` 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` 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 documentation netgear source (message by IssueLinks)

heyhewmike commented 1 month ago

Hello @starkillerOG, I believe the issue might be able to be resolved here: https://github.com/home-assistant/core/blob/master/homeassistant/components/netgear/strings.json

By allowing a user to change the default port used as for my unit, MR80, is using port 443 and I have no way to edit this in the configuration UI.

Unless we update here: https://github.com/home-assistant/core/blob/master/homeassistant/components/netgear/const.py For PORT_443 = 443 and begin to define the models with the model I am using MR80

I am not sure which would be best nor comfortable enough to clone core or edit the integration.

starkillerOG commented 1 month ago

port 443 is already tried during setup of the homeassistant integration here: https://github.com/MatMaul/pynetgear/blob/d9b34149b110cd91fbccc5fff7a285a1221af5dd/pynetgear/const.py#L10

please enable debug logging of the netgear integration and then try to setup the integration again. Post the debug log here and I can try to see if I can resolve the issue.

heyhewmike commented 1 month ago

How do I enable debug on the integration without installing the integration?

heyhewmike commented 1 month ago

@starkillerOG I would like to assist in getting this addressed however I am not aware of how to get debug logs without first installing the netgear integration and I can not install the netgear integration without getting past this bug.

Do you have any guidance on next steps on how I can get the requested logs?

starkillerOG commented 1 month ago

You can enable the debug logger from the configurations.yaml file, see here: https://www.home-assistant.io/integrations/logger/

logger:
  logs:
    homeassistant.components.reolink: debug
heyhewmike commented 1 month ago

@starkillerOG Please see attached. Line 15 & Line 19 might be evidence of the issue. My device does not have a valid SSL Cert. Would it be possible to include (443, false) with ALL_PORTS?

Successful Debug config: image Debug log: netgear.debug.txt

starkillerOG commented 1 month ago

@heyhewmike could you try temporarily removing all special chars from your password (change the password) to only include a-z A-Z 0-9? Then try it again with the simpler password?

Maybe it is just a problem in the encoding of the password. Port 443 (which is a HTTPS port) seems to at least connect and get a initial good response, but then it fails when trying to actualy get some data from the router.

heyhewmike commented 1 month ago

@starkillerOG My original password was a 15 Character Alphanumeric password with no special characters. I just changed it to 'adminAdmin' and still got the same error.

Here is the debug logfile: netgear.debug.easy_password.txt

Although https is port 443 the ssl is not valid which is why it might be failing. image

Here is the password requirements for my device. image

starkillerOG commented 1 month ago

@heyhewmike the SSL certificate check is already ignored in the netgear integration: https://github.com/MatMaul/pynetgear/blob/d9b34149b110cd91fbccc5fff7a285a1221af5dd/pynetgear/router.py#L126C1-L132C10

will have to think about what else could be wrong.