ThisIsQasim / WebGPIO

A simple web UI for controlling the GPIO pins on a Raspberry Pi
GNU General Public License v3.0
72 stars 30 forks source link

500 internal error #19

Closed alexungur013 closed 3 years ago

alexungur013 commented 4 years ago

Hello, First of all, thanks for code it help me a lot.

But i have some issues. After i used setPassword.py and i set a password when i complte the space from login with the correct password i receive error( 500 internal error message)

I suppose is something wrong with authentication because if i entry a wrong password the web don't get an error just i cant login

I need to make some more settings, change some lines code to work with authentication? thanks a lot

ThisIsQasim commented 4 years ago

Hi, Sorry for the delay. Can you run with debug: True in config.yml and report the stacktrace?

sgallardo1 commented 3 years ago

sorry to bother. Programming is not my strength. Why can't i login? What is the default password? I run the setPassword.py and then the backend.py. I get nothing

ThisIsQasim commented 3 years ago

You have to setup a password using the python3 setPassword.py command

sgallardo1 commented 3 years ago

i did that and entered one.

ThisIsQasim commented 3 years ago

Do you have logs? Did the set password commamd run successfully?

sgallardo1 commented 3 years ago

I don't have any logs. Yes the command ran successfully. I check the passwordhash file and the hash is correct.

ThisIsQasim commented 3 years ago

The code is breaking somewhere when authenticating. Can you run with debug: True in config.yml and report the output of backend.py? Also details about your environment would be helpful.

sgallardo1 commented 3 years ago

changed

debug: True

to debug: True

Config file not found or invalid. Please provide a valid config.yml file. See exampleconfig.yml for reference

sgallardo1 commented 3 years ago

File "/usr/lib/python3/dist-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3/dist-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "/home/WebGPIO/backend.py", line 63, in login return render_template('login.html') File "/usr/lib/python3/dist-packages/flask/templating.py", line 135, in render_template context, ctx.app) File "/usr/lib/python3/dist-packages/flask/templating.py", line 117, in _render rv = template.render(context) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/home/WebGPIO/templates/login.html", line 1, in top-level template code {% extends "layout.html" %} File "/home/WebGPIO/templates/layout.html", line 16, in top-level template code {% block body %}{% endblock %} File "/home/WebGPIO/templates/login.html", line 3, in block "body"

Password:
File "/usr/lib/python3/dist-packages/flask/helpers.py", line 356, in url_for return appctx.app.handle_url_build_error(error, endpoint, values) File "/usr/lib/python3/dist-packages/flask/app.py", line 2061, in handle_url_build_error reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/lib/python3/dist-packages/flask/helpers.py", line 345, in url_for force_external=external) File "/usr/lib/python3/dist-packages/werkzeug/routing.py", line 1776, in build raise BuildError(endpoint, values, method, self) werkzeug.routing.BuildError: Could not build url for endpoint 'auth'. Did you mean 'logout' instead? 192.168.86.120 - - [11/Aug/2020 22:48:34] "GET /login/ HTTP/1.1" 500 -
sgallardo1 commented 3 years ago

Traceback (most recent call last): File "/home/WebGPIO/setPassword.py", line 3, in authentication.generatePasswordHashFile() File "/home/WebGPIO/lib/authentication.py", line 38, in generatePasswordHashFile with open(passwordHashFilePath, 'w+') as passwordHashFile: PermissionError: [Errno 13] Permission denied: '/home/WebGPIO/passwordhash'

ThisIsQasim commented 3 years ago

I had merged a broken PR without testing. Reverted it so authentication should be working again. Please checkout the latest code and make sure file permissions are correct.