Skip to content
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

Unable to join network queue "LAN" with address auto (Windows, SO_REUSEPORT error) #154

Open
Dom24123 opened this issue Nov 16, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Dom24123
Copy link

Continuous Print API Error 500 when clicking "start managing button" for continuous print plugin, G code file is added on the job queue.

This is not as expected, since the printer should start loading the job and print.

image

octoprint-systeminfo-20221116204757.zip

image

@Dom24123 Dom24123 added the bug Something isn't working label Nov 16, 2022
@smartin015
Copy link
Owner

Thanks for the sysinfo bundle - I just took a look at the logs and it appears to be an issue with port discovery:

Traceback (most recent call last):
  File "c:\octoprint\venv\lib\site-packages\octoprint\plugin\__init__.py", line 273, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\octoprint\util\__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "c:\octoprint\venv\lib\site-packages\continuousprint\__init__.py", line 64, in on_after_startup
    self._plugin.start()
  File "c:\octoprint\venv\lib\site-packages\continuousprint\plugin.py", line 82, in start
    self._init_queues()
  File "c:\octoprint\venv\lib\site-packages\continuousprint\plugin.py", line 289, in _init_queues
    lq.connect()
  File "c:\octoprint\venv\lib\site-packages\continuousprint\queues\lan.py", line 39, in connect
    self.lan.connect()
  File "c:\octoprint\venv\lib\site-packages\peerprint\lan_queue.py", line 158, in connect
    self.spin_async()
  File "c:\octoprint\venv\lib\site-packages\peerprint\discovery.py", line 63, in spin_async
    self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
AttributeError: module 'socket' has no attribute 'SO_REUSEPORT'

Apparently SO_REUSEPORT exists on Linux, but not on Windows - more detail here. As I mainly use Linux, I didn't notice this compatibility issue. I'll start on a fix, but it'll take a little bit to publish due to some other changes in the pipe.

In the meantime - if you can get to the Settings page, try going to Continuous Print > Queues and removing the entry marked LAN, then restarting OctoPrint. This should remove the initial connection logic and make it work locally for you at least.

@smartin015 smartin015 changed the title Continuous Print API Error 500 Error 500 on Windows (SO_REUSEPORT) Nov 17, 2022
@Dom24123
Copy link
Author

Dom24123 commented Nov 17, 2022 via email

@smartin015
Copy link
Owner

Glad to hear it's working for you!

Unfortunately I only have gcode scripts that users have contributed (beyond the ones for my own printer models). If you're comfortable trying to make your own, maybe start by modifying the "Sweep Gantry" script example. I'd appreciate your contribution for anything you find works well with a stock Ender 5 :)

@smartin015 smartin015 changed the title Error 500 on Windows (SO_REUSEPORT) Unable to join network queue "LAN" with address auto (Windows, SO_REUSEPORT error) Nov 27, 2022
@smartin015
Copy link
Owner

v2.3.0 will surface this error but make it so you can at least use the queue - I'm leaving the bug open until I fix the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants