Cannot connect with local name, only with IP address after 1.5.0 update

What is the problem?
Just updated to 1.5.0 a freshly 1.4 install on RPI3.
Cannot access through octopi.local anymore, more precisely it works just after boot but disappear after some time.
As a result, must use IP address to access.

What did you already try to solve it?
Look at logs, nothing tells me avahi daemon is faulty nor misconfigured.

Logs (syslog, dmesg, ... no logs, no support)

result of $tail -n 10 .octoprint/logs/octoprint.log

seems there is a problem with zeroconf

2020-12-01 13:35:34,553 - octoprint.server.util.sockjs - INFO - User jean logged in on the socket from client ::ffff:192.168.2.42
2020-12-01 13:44:28,476 - octoprint.vendor.zeroconf - WARNING - Exception occurred:
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/zeroconf.py", line 2237, in send
    bytes_sent = s.sendto(packet, 0, (addr, port))
error: [Errno 101] Network is unreachable
2020-12-01 13:46:00,663 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-12-01 13:46:07,061 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from online to offline
2020-12-01 13:46:07,062 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 8.8.8.8:53 is not working
2020-12-01 13:46:07,063 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is not working

Additional information about your network (Hardware you are trying to connect to, hardware you are trying to connect from, router, access point, used operating systems, ...)
DIET 3D connected to RPI3 WIDI connection.

Please upload the full log. 10 lines is not really enough. You can download it from the logging panel. OctoPrint 1.5.0 does not mess with hostnames, that is outside of it's control. It seems you might have network issues, from that other part of the log too.

2 Likes

Where is the DHCP server located?
What is your local domain name?

Try just "octopi" instead of "octopi.local".

2 Likes

Hi

Thanks for the answer, uploaded the full log.

I changed nothing to the network, Octopi behavior changed immediately after the update to 1.5.0.

I can still use it through its ip, but then I have to monitor it through another window to avoid changing setup.

I have another printer with Octoprint 1.4.2 which works fine with its local name, this let me think the upgrade was the cause of the problem.

octoprint.log (522.7 KB)

Hi,

I have the same problem since updating one Octopi instance. Old one is woking with the domain name the other not. I found out that pinging the 1.5.0 instance resolves into 127.0.0.1 which is wrong. I'm running macOS Big Sur. I cleaned the DNS cache, restarted the machine, but nothing help so far.

@audryhome does your Octopi instance also resolve to 127.0.0.1?

Yes exactly the same!

So there was a change to the zeroconf discovery in 1.5.0. HOWEVER, that only affects how OctoPrint announces itself for its own service identifier octoprint._tcp.local, and I don't see how that could influence the OS level avahi hostname announcement done on OctoPi (this octopi.local stuff is not a feature of OctoPrint but rather the OctoPi image).

I just tested it by letting my two update test Pis ping each other via their .local names. octopia running OctoPrint 1.5.0, OctoPi 0.17.0. octopib running OctoPrint 1.5.0, OctoPi 0.18.0rc1.

pi@octopiA:~ $ ping octopib.local
PING octopib.local (192.168.1.153) 56(84) bytes of data.
64 bytes from octopib.lan (192.168.1.153): icmp_seq=1 ttl=64 time=38.8 ms
64 bytes from octopib.lan (192.168.1.153): icmp_seq=2 ttl=64 time=23.8 ms
64 bytes from octopib.lan (192.168.1.153): icmp_seq=3 ttl=64 time=10.6 ms
64 bytes from octopib.lan (192.168.1.153): icmp_seq=4 ttl=64 time=74.7 ms
^C
--- octopib.local ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 9ms
rtt min/avg/max/mdev = 10.551/36.948/74.683/23.961 ms
pi@octopiB:~ $ ping octopia.local
PING octopia.local (192.168.1.184) 56(84) bytes of data.
64 bytes from octopia.lan (192.168.1.184): icmp_seq=1 ttl=64 time=21.1 ms
64 bytes from octopia.lan (192.168.1.184): icmp_seq=2 ttl=64 time=18.0 ms
^C
--- octopia.local ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 18.002/19.569/21.136/1.567 ms

An additional check against the published services (not hostname but actually the things that OctoPrint itself controls and configured responses for) also shows nothing that hints at loopback addresses being reported by 1.5.0:

$ python tools/zeroconf_browser.py --fetch
Press enter to exit...

ADDED: OctoPrint instance "Ender 3 Pro"._octoprint._tcp.local.
        SRV: ender3pro.local.:80
        TXT: b'\x06path=/\rversion=1.5.0\x07api=0.1)uuid=ffa23bac-ec2a-4fb9-8242-20d6c92d1a7a'
        Info:
                Address: 192.168.1.57:80
                ServiceInfo(type='_octoprint._tcp.local.', name='OctoPrint instance "Ender 3 Pro"._octoprint._tcp.local.', addresses=[b'\xc0\xa8\x019'], port=80, weight=0, priority=0, server='ender3pro.local.', properties={b'path': b'/', b'version': b'1.5.0', b'api': b'0.1', b'uuid': b'ffa23bac-ec2a-4fb9-8242-20d6c92d1a7a'})

ADDED: OctoPrint instance "Prusa MK3"._octoprint._tcp.local.
        SRV: prusamk3.local.:80
        TXT: b'\x06path=/\x07api=0.1)uuid=bb16bdd7-7864-4d53-8a3f-61ccdcd9f9c7\rversion=1.5.0'
        Info:
                Address: 192.168.1.56:80
                ServiceInfo(type='_octoprint._tcp.local.', name='OctoPrint instance "Prusa MK3"._octoprint._tcp.local.', addresses=[b'\xc0\xa8\x018'], port=80, weight=0, priority=0, server='prusamk3.local.', properties={b'path': b'/', b'api': b'0.1', b'uuid': b'bb16bdd7-7864-4d53-8a3f-61ccdcd9f9c7', b'version': b'1.5.0'})

ADDED: OctoPrint instance on octopiA._octoprint._tcp.local.
        SRV: octopiA.local.:80
        TXT: b'\x06path=/\x07api=0.1)uuid=a697ab59-f163-4ba5-afe9-b1ce1f9bce6b\rversion=1.5.0'
        Info:
                Address: 192.168.1.184:80
                ServiceInfo(type='_octoprint._tcp.local.', name='OctoPrint instance on octopiA._octoprint._tcp.local.', addresses=[b'\xc0\xa8\x01\xb8'], port=80, weight=0, priority=0, server='octopiA.local.', properties={b'path': b'/', b'api': b'0.1', b'uuid': b'a697ab59-f163-4ba5-afe9-b1ce1f9bce6b', b'version': b'1.5.0'})

ADDED: OctoPrint instance on octopiB._octoprint._tcp.local.
        SRV: octopiB.local.:80
        TXT: b'\x06path=/\rversion=1.5.0\x07api=0.1)uuid=e55eb8e6-92b0-42f3-ae28-ad0f188aa509'
        Info:
                Address: 192.168.1.153:80
                ServiceInfo(type='_octoprint._tcp.local.', name='OctoPrint instance on octopiB._octoprint._tcp.local.', addresses=[b'\xc0\xa8\x01\x99'], port=80, weight=0, priority=0, server='octopiB.local.', properties={b'path': b'/', b'version': b'1.5.0', b'api': b'0.1', b'uuid': b'e55eb8e6-92b0-42f3-ae28-ad0f188aa509'})

Currently a bit at a loss of what is happening here for some of you.

It would be helpful to know though from which client operating system you are trying to resolve. Also, @Spybyte, please share your log as well. @audryhome your initial log excerpt actually does indicate there are some weird network issues (zeroconf tries to register the octoprint service, but can't reach the LAN at all), though I do not understand how that can be the case when connection via IP works just fine. Your second log does appear to be from another machine? At least I can't find the exception in that one. But your instance can't connect to the internet (though that should not interfere with name resolution, it could hint at network problems). Any infos you could give on your network setup?

Hey, here are my log files. I also will restart my Pi as soon as my print is finished.
logs.zip (22.5 KB)

I used my pi with 1.4 installed and pinged the machine with 1.5. It also resolves the new version with 127.0.0.1.

So i tested this behaviour with a Mac Client (Big Sur) and from a RaspberryPi.

Don't see anything hinting at network issues or similar in your log @Spybyte. So whatever it is we saw in the log from @audryhome, it's not necessarily related.

A reboot would indeed be a good idea, maybe something somewhere hiccuped.

Might also be interesting to see if rolling back to 1.4.2 fixes it again. I really don't know how the upgrade could even do this as - again - the hostname resolution part is OctoPi, not OctoPrint, on OS level and not something I could influence in any way. The only thing I control is the discovery plugin for the service discovery. What those of you affected by this on 1.5.0 could do however, just to rule this out, is disable the discovery plugin, see if that changes behaviour.

So, two things to try here:

  1. Disable the discovery plugin & restart OctoPrint. See if that changes things, report back on the outcome.
  2. Downgrade to 1.4.2. See if this changes things, report back on the outcome.

I cannot reproduce this, so I have to rely on people who can to collaborate in analysis.

I'm a developer myself. So I exactly understand that you need these information. I will do as you described. My print will take approx. 1h. After that I will do the first step and come back to you.

1 Like

Hi Gina,

I am connected through wifi, exactly like my other box, same configuration.
I am connected through a Windows 7 Pro PC running chrome.

The weird thing is: this works immediately after boot, able to connect to smallbox.local, then after some time, service is broken.

Looks like a timeout somewhere decided to shut down the service....

Will repeat your test locally and let you know.

Thanks

Jean

Hey Gina,

I did the following steps:

  1. ping -> 127.0.0.1
  2. shutdown pi
  3. ping -> cannot resolve mk3s.lokal: Unknown host
  4. start pi
  5. ping -> 127.0.0.1

Next step:

  1. disabled discovery plugin
  2. octoprint server didn't respond
  3. restarted pi
  4. ping -> 192.168.1.85

So for what ever reason disabling the discovery plugin "solved" this problem. Somehow it's related to it.

Should I still downgrade to 1.4.2?
What can I do to narrow this problem further?

Ok, a downgrade is not needed for further tests then, but just in case, here's the FAQ entry on that:

Also linked in every single release and release candidate announcement btw :wink:

So it IS the switch to python-zeroconf or something in the adaptation of the code of the Discovery plugin to it. Huh... That is going to be a tough nut to crack, I have absolutely no idea right now how to even approach this.

Hi again Gina,

When disabling the discovery plugin, the unit is completely unknown on the network, doesn't even respond as 127.0.0.1.

When reverting to 1.4.2, works like a charm....

So obviously something weird happens when updating.

If you look at my logs, the following sequence is related to zeroconf:

2020-12-01 13:44:28,476 - octoprint.vendor.zeroconf - WARNING - Exception occurred:
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/zeroconf.py", line 2237, in send
bytes_sent = s.sendto(packet, 0, (addr, port))
error: [Errno 101] Network is unreachable

This happens only in 1.5.0, my logfile is also referring to 1.4.2 that I upgraded yesterday....

Is it related?

Many thanks

Jean

I had the same problem. The I restarted my pi and it worked. Did you try to restart and ping it afterwards?

Yes, it works for some time, then fall back to 127.0.0.1.
I did what Gina suggested and it worked perfectly as before in 1.4.2.
This tells me something in 1.5.0 is breaking the stuff.... but what?

Look at my log as I suggested. I have an exception in zeroconf.py only in 1.5.0, not in 1.4.2.

Hope it helps

octoprint.log (522.7 KB)

It also doesn't seem to be related to the Python version:

Jean's version: Detected environment is Python 2.7.16 under Linux (linux2)
My version: Detected environment is Python 3.7.3 under Linux (linux)

Björn

That it not even resolves to anything anymore when you disable the plugin sounds very strange indeed, because as I said, name resolution isn't handled by that, only the service announcements. I'll see if I can reproduce this.

In the meantime, just to summarize what we so far know (even though right now I have no idea at all how to even begin to debug this):

  • The symptom is that the .local domain resolves to 127.0.0.1
  • It is related to something in 1.5.0 as the issue goes away when rolling back to 1.4.2.
  • For @Spybyte it can be fixed by disabling the discovery plugin (which was switched from pybonjour to python-zeroconf in 1.5.0 and takes care of service discovery (not hostname resolution)). For @audryhome, disabling said plugin however does not change behaviour
  • For @audryhome, there's also a network error during initialization of the discovery plugin and a negative connection check, hinting at some issue there
  • The issue is unrelated to Python 2 vs 3 (which is good to know because Python 2 uses a vendored version of python-zeroconf)
  • Both of you run OctoPi 0.17.0

So far I'm not yet seeing any real pattern here, apart from OctoPi 0.17.0, and I'd expect a lot more people to chime in here if that was a general issue with that and 1.5.0.

@audryhome What I'm seeing in your log is that the connectivity check also fails right after your exception, and then stays negative on the following startup:

020-12-01 13:44:28,476 - octoprint.vendor.zeroconf - WARNING - Exception occurred:
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/zeroconf.py", line 2237, in send
    bytes_sent = s.sendto(packet, 0, (addr, port))
error: [Errno 101] Network is unreachable
2020-12-01 13:46:00,663 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-12-01 13:46:07,061 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from online to offline
2020-12-01 13:46:07,062 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 8.8.8.8:53 is not working
2020-12-01 13:46:07,063 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is not working
2020-12-01 13:54:12,221 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.2.42
2020-12-01 13:34:09,097 - octoprint.startup - INFO - ******************************************************************************
2020-12-01 13:34:09,099 - octoprint.startup - INFO - Starting OctoPrint 1.5.0
2020-12-01 13:34:09,100 - octoprint.startup - INFO - ******************************************************************************
2020-12-01 13:34:15,914 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity state is currently: offline
2020-12-01 13:34:15,915 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 8.8.8.8:53 is not working
2020-12-01 13:34:15,918 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is not working

Can your OctoPrint instance reach the internet? Because it is telling me it can't. We should rule out that something funky is going on with your network connection here causing both the mdns name resolution and the connection issue - the loss of internet connectivity could indicate some routing problem.