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
upnp no longer working properly #18066
Comments
Can you check if UPnP/IGD was discovered in Configuration -> Integrations ? |
Yes, sorry should have included those with the initial post: |
Interesting. Can you enable debugging for
This will silence home assistant mostly, but show debug messages and related traffic for UPnP devices, such as your router. It seems however, from the message |
Running it now, I already had most of that enabled. I do believe you are correct about it not getting XML but its strange as I've been using merlin for a while now with little to no problems, and it uses miniupnp. |
Here are the results. Sorry about the few goofy errors in there, I know its extra noise, playing with a new camera a couple of other things. |
This doesn't provide any more information, unfortunately. Are you familiar with a shell on the device Home Assistant is running on? If so, can you try this, from your virtual env:
Also, can you download the XML from your router from http://192.168.1.1:36460/rootDesc.xml and post it somewhere? |
What do I do if my rootDesc.xml address for my router is: http://192.168.1.1:54506/rootDesc.xml ? |
Replace your url with the one mentioned at other places/in commands.
|
Where would I do that? Sorry, I am new to this particular component. |
@StevenLooman, |
Command results: https://pastebin.com/A6GfG0XZ |
@Segfault198 Thank you for the information. The command I gave you was wrong, probably due to a copy/paste and edit error on my side. Can you try this?
The downloaded XML looks normal though. Currently, the software simply checks if an error occurs and reports @jmutnick Do you have the same router? You can try to download the file you mentioned ( http://192.168.1.1:54506/rootDesc.xml ), in your browser to see if this works. |
Sure, let me know what changes need made. I'll rerun the command in a little bit and get you the results |
Find this file: Find the
So, this is what the new function will look like, notice the
This will cause a traceback in the Home Assistant output, but the original error will be preserved. |
@StevenLooman I added the raise and I think this may be significant: aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.1:37891 ssl:None [Connect call failed ('192.168.1.1', 37891)] Here is all of it:
|
Oh, and this:
|
@StevenLooman @jmutnick |
|
@jmutnick @Segfault198 Thank you for testing and reporting. Your error is ConnectionRefusedError, which means Home Assistant is now allowed to connect to your router. Either no webservice serving the XML is running (which is not true, as you can run If you are willing, you can try to run with an empty Home Assistant config. I.e., no other components to ensure nothing is interfering. Be sure to backup your original configuration, of course! Perhaps your router thinks it is being hammered and blocks requests (a guess.) Another possibility is that a firewall is blocking outgoing requests from Home Assistant at your Asus VivoStick PC/Raspberry Pi or your router is blocking incoming requests. @jmutnick About
* I upgraded |
@StevenLooman, yes I use it for device_tracking/presence detection(ASUSWRT component). Which seems to work just fine. I'll give it a go with minimal configuration and update, but it'll likely take a little time. Thanks for your help! |
|
It worked on another instance I was running, but the difference seems to be the SSL settings on the one it is not working on? Does that make any sense based on the error from above when the ssl issue appeared? |
Works on a clean instance of Hass.io I stood up for testing. @jmutnick may be onto something. I have SSL setup on my primary instance as well. |
The error should not happen, but otherwise it looks like |
Let me know how I can help test. As I said I fired up that instance of Hass.io and it discovered upnp immediately and added the sensors like normal. So something odd is going on. |
@Segfault198 can you test your theory by disabling SSL for some minutes ? |
As requested here ya go. Obviously I trimmed the log a bit but if you'd like the full log I'll happily get it to you. The component still doesn't work 100% with SSL off but now I get this new set of messages repeating. Its very odd. Maybe I just need to rebuild. |
Fixed the bug @jmutnick reported. Will look into the SSL thing soon. |
@StevenLooman If you have a build I can test, please let me know where to retrieve it. |
Just released However, I am not able to reproduce any errors when SSL is enabled. Followed the steps from Self-signed certificate for SSL/TLS Are there any other specifics to your configurations with regard to SSL? @jmutnick You can test this pull request. You can either clone my repository/branch or just change the required version of |
Apparently upnp is forbidden completely from now on via #17937 by @pvizeli. While I agree with the danger by of the port forward, it was included after discussion with @dgomes. Still, simply disabling discovery, effectively destroying the functionality was a bit of an overkill. @pvizeli was there no other way, such as discussing this with @dgomes or me about other options? |
It would be dangerous if auto-discovery would enable the port-forwarding automatically. But users still needed to tick the option to open the port. Or did I miss a step ? |
I agree that it is too easy to enable the port-forward. If a user does not know what it is, it is very easy to simply tick it. If a port-forward can only be enabled via the configuration file, then users will be safer. |
On the other hand the all point of using UPnP to port-forward stuff is not to mess with configurations :) I think a warning in the GUI should have been enough (BTW I think these comments should be moved to the other thread) |
I know I shouldn't comment in closed issues, but this seems the correct place. |
Yes, it appears to be working now! |
Confirmed. All working well now. Could you link to the fix? I'd be interested to see what the issue was. Thanks! |
Great, thank you for testing and reporting. |
Home Assistant release with the issue:
0.81.2
Last working Home Assistant release (if known):
0.78
Operating environment (Hass.io/Docker/Windows/etc.):
Python virtual environment/Ubuntu 18.04 on Asus VivoStick PC (TS10)
Router Asus RT-AC3100 running ASUSWRT Merlin 384.7
Component/platform:
upnp
Description of problem:
After 0.78 upnp no longer creates sensors and no longer maps ports, before this sensors worked fine as did port mapping. Port mapping does still work for other devices in the house (i.e. xbox one)
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered: