hello,
i use an reverse proxy for octoprint, in 1.3.9 no problem, but with 1.3.10RC i take an internal error
1 set up a reverse proxy (i use reverse proxy with synology server)
2 call octoprint via the outside of the network by calling the domain name configure in the reverse proxy
access octoprint
i get an error 500 :
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
yes
1.3.10rc2
OctoPi
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/views.py", line 404, in index
if plugin.will_handle_ui(request):
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/forcelogin/__init__.py", line 29, in will_handle_ui
result = passive_login()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/flask.py", line 531, in passive_login
additional_private=ipCheckTrusted)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/net.py", line 59, in is_lan_address
subnets.add(to_ipnetwork(v6))
File "/home/pi/oprint/local/lib/python2.7/site-packages/netaddr/ip/sets.py", line 293, in add
addr = IPNetwork(addr)
File "/home/pi/oprint/local/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 928, in __init__
implicit_prefix, flags)
File "/home/pi/oprint/local/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 823, in parse_ip_network
raise TypeError('unexpected type %s for addr arg' % type(addr))
TypeError: unexpected type <type 'NoneType'> for addr arg
Hi @devildant,
It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Read the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!).
If you did not intend to report a bug but wanted to request a feature or brain storm about some kind of development, please take special note of the title format to use as described in the Contribution Guidelines.
Please do not abuse the bug tracker as a support forum - that can be found at discourse.octoprint.org. Go there for any kind of issues with network connectivity, webcam functionality, printer detection or any other kind of such support requests or general questions.
Also make sure you are at the right place - this is the bug tracker of the official version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third party OctoPrint plugins or unofficial versions. Make sure too that you have read through the Frequently Asked Questions and searched the existing tickets for your problem - try multiple search terms please.
I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2018-11-30 12:10 UTC) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you!
Best regards,
~ Your friendly GitIssueBot
PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them.
i found that : https://github.com/drkjam/netaddr/issues/65
Can you please provide the full octoprint.log? So far you only posted snippets. Please do not edit it, just upload it in full.
yes of course, I just had to anonymize because my domain name was visible in the log.
octoprint.log
I understood how to solve the problem.
the simple addition of ipCheck: true in the config.yml file fixes the problem
Thanks. So this is a bit weird because the referenced line numbers in the stack trace don't match the source code in 1.3.10rc2.
I can see what might be happening here though and fix that.
Could you shoot me the output of python -c "import netifaces; print(repr([netifaces.ifaddresses(interface) for interface in netifaces.interfaces()]))" from the python environment OctoPrint is running in (so in your case probably rather ~/oprint/bin/python -c "import netifaces; print(repr([netifaces.ifaddresses(interface) for interface in netifaces.interfaces()]))")? If the returned info contains sensitive data, please shoot me a private mail at gina -at- octoprint.org with it instead of redacting it, the info might be crucial to understand why that error arose).
the simple addition of ipCheck: true in the config.yml file fixes the problem
With that you actually just disabled the ip check (it expects a dictionary here, not a single boolean, so you basically gave it invalid config data which it now ignores). You didn't fix the problem, you hid it, and hiding problems isn't the goal here ;)
mmm i reinstall octoprint with the 1.3.10RC2 with that :
~/oprint/bin/pip install https://github.com/foosel/OctoPrint/archive/1.3.10rc2.zip
i take same error with different stack :
2018-11-16 12:55:29,090 - octoprint - ERROR - Exception on /api/login [POST]
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/__init__.py", line 221, in login
additional_private=s().get(["server", "ipCheck", "trustedSubnets"]))
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/net.py", line 59, in is_lan_address
subnets.add(to_ipnetwork(v6))
File "/home/pi/oprint/local/lib/python2.7/site-packages/netaddr/ip/sets.py", line 293, in add
addr = IPNetwork(addr)
File "/home/pi/oprint/local/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 928, in __init__
implicit_prefix, flags)
File "/home/pi/oprint/local/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 823, in parse_ip_network
raise TypeError('unexpected type %s for addr arg' % type(addr))
TypeError: unexpected type <type 'NoneType'> for addr arg
the command : python -c "import netifaces; print(repr([netifaces.ifaddresses(interface) for interface in netifaces.interfaces()]))"
return an error :
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named netifaces
for the other command, i will send you the result to your email.
Weird, that's still a line number that doesn't make sense. The code at that location doesn't contain the cited command. Huh.
the command : python -c "import netifaces; print(repr([netifaces.ifaddresses(interface) for interface in netifaces.interfaces()]))"
return an error
Not surprising, you need to run it in OctoPrint's python environment - that's why I added the second one which takes care of this ;)
for the other command, i will send you the result to your email.
Thank you, got it. Weirdly though I cannot make that data cause an error. In any case, I've made the whole is_lan_address function way more resilient against any kind of errors that arise inside of it, so with rc3 that should no longer happen. Since you are so far the only person who can reliably reproduce this with their setup, once RC3 hits, please upgrade to it, remove your ipCheck adjustment from config.yaml again, restart and check whether it behaves. It should also show you a notification that you are connecting from an external address, if it doesn't there is probably an error logged in octoprint.log in which case please share that too.
Weird, that's still a line number that doesn't make sense. The code at that location doesn't contain the cited command. Huh.
the command : python -c "import netifaces; print(repr([netifaces.ifaddresses(interface) for interface in netifaces.interfaces()]))"
return an errorNot surprising, you need to run it in OctoPrint's python environment - that's why I added the second one which takes care of this ;)
for the other command, i will send you the result to your email.
Thank you, got it. Weirdly though I cannot make that data cause an error. In any case, I've made the whole
is_lan_addressfunction way more resilient against any kind of errors that arise inside of it, so with rc3 that should no longer happen. Since you are so far the only person who can reliably reproduce this with their setup, once RC3 hits, please upgrade to it, remove youripCheckadjustment fromconfig.yamlagain, restart and check whether it behaves. It _should_ also show you a notification that you are connecting from an external address, if it doesn't there is probably an error logged inoctoprint.login which case please share that too.
no problem, as soon as the RC3 will be available, I will test, and I will make a return on this post.
I encounter another problem with the return of the plugins. When I go through the reverse proxy, I have the call network, but at the level of the view, they does not updates, if RC3 I still have this problem, I will create another bug report
No, please create it now ;) If there's even the chance of an issue I need to look into that now, I'd rather not have to keep putting out RCs solved issue by solved issue, it's a tremendous amount of work each time, so the goal is to keep the number of RCs as low as possible and that means fixing ALL issues that are observed per RC if possible.
ha ok, I'm doing it right now :)
new issue create.
small precision for the current bug, I deleted cookies, I have no more error 500 but I can not pass the login page, the error cited above appears with each temptation to login with my login / password
@devildant I was just wondering, since you updated to staging/maintenance anyhow, could you check whether this issue is resolved for you?
@foosel oops, i forgot to test this case: p i do it right after my current print
@foosel , i removed ipCheck config, i get the staging/maintenance, and, i tried to login with my phone (3g), no error.
This seems good :)
thank you for your work
Perfect, marking this as solved then, will close it when RC3 is out.
@devildant what is the workaround for this issue to get it working on RC2?
Should I just add the ipCheck: true to the config?
Rather set server.ipCheck.enabled to false:
server:
ipCheck:
enabled: false
1.3.10rc3 was just released.