question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Internal Service Error on Ubuntu and RPi3

See original GitHub issue

Describe The Problem Cannot login to dashboards on either a Ubuntu or a RPi install. Ubuntu install was installed with fresh WireGuard install, RPi install had an already configured WireGuard setup.

Attempting to login with the dashboard with the default username admin and password admin results in an internal server error:

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.

Expected Error / Traceback For Ubuntu:

[2022-01-24 11:47:39,116] ERROR in app: Exception on /auth [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "dashboard.py", line 704, in auth
    password = hashlib.sha256(data['password'].encode())
TypeError: 'NoneType' object is not subscriptable'

For RPi:

[2022-01-24 11:41:35,080] ERROR in app: Exception on /auth [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "dashboard.py", line 704, in auth
    password = hashlib.sha256(data['password'].encode())
TypeError: 'NoneType' object is not subscriptable

Sidenote: Are my user permissions bad? I see the traceroute says fail on /auth is that for my authentication or is that on wg-dashboard? This error is the same across two distros so it must be something consistent with either wg-dashboard or my network.

To Reproduce I did a fresh install of both wg-dashboard and wireguard into their default directories running them with ./wgd.sh start. I then tried to access them via the ip and port with default credentials. Upon entering credentials I am greeted with an internal server error.

OS Information:

  • OS: Ubuntu 20…04.1

  • Python Version: 3.8.10

  • OS: Linux 5.10.63-v7+

  • Python Version: 3.7.3

Sample of your .conf file Ubuntu:

[Interface]
Address = 10.0.0.1/24
SaveConfig = true
ListenPort = 51820
PrivateKey = ABCD
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o wlp0s20f3 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o wlp0s20f3 -j MASQUERADE

RPi:

[Interface]
Address = 10.100.0.1/32
ListenPort = 47111
PrivateKey = ABCD
DNS = 192.168.50.25

PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE


[Peer]
#x360
PublicKey = ABCD
PresharedKey = ABCD
AllowedIPs = 10.100.0.2/32, fd08:4711::2/128, 192.168.0.0/24

If any more information is required please let me know! I know I’m prone to making simple errors sometimes lol

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
donaldzoucommented, Jan 25, 2022

Ahah nice!! I would consider to move all dependencies to local. But the reason is flask running on HTTP 1.1, and it need to wait for resources 1 by 1, so would cause longer loading time. By using CDN can have faster loading speed on scripts and CSS libraries. I will close this issue now, if you have any more questions please let me know!!

1reaction
Gyrohammercommented, Jan 25, 2022

GOT IT

Holy moly this one is extremely unique to me. I recently set up some blocklists on my Pi-Hole and one of them was blocking

code.jquery.com
(blocked cds.s5x3j6q5.hwcdn.net)

After adding that to the whitelist the login works perfectly.

Thanks so much for your help @donaldzou! Sorry this took so long and ended up being such a niche use-case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Raspberry Pi 3 Ubuntu 16.04 Server upgrade error
I have a PI3 here with ubuntu-16.04-preinstalled-server-armhf+raspi3.img installed. Right after doing the update and upgrade procedure (not dist ...
Read more >
Periodic crash with Ubuntu Server 20.04 on Raspberry Pi 3 B+
When the crash happens, the Pi is unreachable from the network, but continues to run: on-screen console is still visible, Dockers still run...
Read more >
Ubuntu server 20.04.2 LTS boot problem - Raspberry Pi Forums
I am having problem with booting my raspberry pi 4 with Ubuntu server 20.04.2 LTS. 1. I have updataded firmware on pi so...
Read more >
[RPi3/Ubuntu Server 21.10] Fails to start Web Kiosk example
I've followed the steps described here to set up a raspberry pi with Ubuntu Server 21.10 to show a web page with no...
Read more >
How to install Ubuntu Server on your Raspberry Pi
In this tutorial, we walk you through the process of installing Ubuntu Server on a Raspberry Pi, connecting it to the internet and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found