robotpy / robotpy-installer

RobotPy installer program
MIT License
5 stars 11 forks source link

[BUG]: deploy fails with socket.gaierror #64

Closed virtuald closed 1 year ago

virtuald commented 2 years ago

Problem description

An error occurs that has socket.gaierror: [Errno 8] getaddrinfo failed in it.

I ran into this today on my team's laptop on Windows, but I've never ran into it on OSX/Linux. It kept selecting the *.local address, but didn't seem to have actually resolved it so it passes the DNS name to paramiko for the connection. When paramiko tries to use it, the connection fails for some reason.

If you look carefully at the _resolve_addr function, if none of the addresses are a SOCK_STREAM address then it will just return the original name. I'm not really sure why this is the case.

I don't have a Windows machine at home so I don't think I'll be able to diagnose this anytime soon. It would be great if someone else who has this issue could give the whole console output when running py robot.py deploy --debug.

Operating System

Windows

Installed Python Packages

No response

Reproducible example code

No response

peter9477 commented 2 years ago

If I'm reading the RobotFinder code correctly, it also appears to be waiting for all threads to terminate before finishing, even after the first successful result is found. And for the "resolve=False" addresses, it attempts an SSH connection with a 10s timeout. Both those things seem somewhat undesirable.

virtuald commented 2 years ago

https://github.com/robotpy/robotpy-installer/blob/344c87b5e9590ea5d3a2633a7ae66ca984ae5424/robotpy_installer/robotfinder.py#L26

That will stop waiting once the answer is found?

peter9477 commented 2 years ago

Oh, sorry, correct. I misread it as though it were an "or" condition.