Error while trying to access to nengo_gui remotely


#1

I’m trying to access to the nengo_gui from a remote computer, but each time I try to do that it throws me the following error

WARNING:nengo_gui.server:Error response (403): Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 278, in upgrade_to_ws
    assert origin.netloc.lower() in valid_srv_addrs
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 233, in do_GET
    self.handle_upgrade()
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 260, in handle_upgrade
    self.upgrade_to_ws()
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 282, in upgrade_to_ws
    raise Forbidden()
nengo_gui.server.Forbidden: Forbidden
WARNING:nengo_gui.server:Error response (403): Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 278, in upgrade_to_ws
    assert origin.netloc.lower() in valid_srv_addrs
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 233, in do_GET
    self.handle_upgrade()
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 260, in handle_upgrade
    self.upgrade_to_ws()
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 282, in upgrade_to_ws
    raise Forbidden()
nengo_gui.server.Forbidden: Forbidden
WARNING:nengo_gui.server:Error response (403): Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 278, in upgrade_to_ws
    assert origin.netloc.lower() in valid_srv_addrs
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 233, in do_GET
    self.handle_upgrade()
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 260, in handle_upgrade
    self.upgrade_to_ws()
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/server.py", line 282, in upgrade_to_ws
    raise Forbidden()
nengo_gui.server.Forbidden: Forbidden

Does anyone know how to solve this? Also how can I add a password to the nengo_gui? For example, each time y run the following command:

nengo --password mypassword

It throws me the following error:

Traceback (most recent call last):
  File "/usr/local/bin/nengo", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/main.py", line 64, in main
    password = hashpw(args.password, gensalt())
  File "/usr/local/lib/python3.6/site-packages/nengo_gui/password.py", line 16, in hashpw
    h.update(password)
TypeError: Unicode-objects must be encoded before hashing

#2

This is a bug in the current release of Nengo GUI and has been fixed in the development version. You can install the development version from the GitHub repository or wait until @tcstewar or @tbekolay do another release.

Apart from that problem, you will need an SSL certificate for external connections. You can use the instructions in the Jupyter documentation to generate such a certificate. The generated files are passed to Nengo GUI with the --cert and --key arguments.


#3

Another workaround that does not require upgrading Nengo GUI is to run in with Python 2.7.