Closed vinithius2 closed 5 years ago
Hi vinithius2,
I looked into this not too long ago as it was preventing the dashboard from loading if there were no tasks in the database; however, now no graph should get generated for most common tasks on the dashboard, but the dashboard should still load.
Can you please clarify what the issue is that you are facing. Is the dashboard returning an error when loading?
WARNING:main:Successful login from marcos.
INFO:werkzeug:127.0.0.1 - - [17/Sep/2019 10:23:38] "POST /login HTTP/1.1" 302 -
ERROR:main:list index out of range
ERROR:main:Exception on /dashboard [GET]
Traceback (most recent call last):
File "/home/other/.virtualenvs/scrummage/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/home/other/.virtualenvs/scrummage/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
return self.finalize_request(rv)
File "/home/other/.virtualenvs/scrummage/lib/python3.6/site-packages/flask/app.py", line 1967, in finalize_request
response = self.make_response(rv)
File "/home/other/.virtualenvs/scrummage/lib/python3.6/site-packages/flask/app.py", line 2097, in make_response
"The view function did not return a valid response. The"
TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.
INFO:werkzeug:127.0.0.1 - - [17/Sep/2019 10:23:39] "GET /dashboard HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [17/Sep/2019 10:23:39] "GET /favicon.ico HTTP/1.1" 404 -
This is the feedback from my terminal.
Thanks for that, despite what I said earlier the changes i made weren't in the main.py file and they must have been missed. If you could try updating your /lib/main.py and /lib/templates/dashboard.html files and try again.
It's work! Very nice, one more question, i had install more two package with pip install, psycopg2 and defectdojo_api, i believe updating the file "python_requirements.txt" solve this problem, no more, thank you.
Thank you for that. I've added defectdojo_api to the requirements, again thought that was in there already. Will do another end-to-end test soon and just check everything is working as it should. As for psycopg2, python recommends installing it as a binary and not a library. (apt install python3-psycopg2) which can be seen on line 11 of installation/dependencies.sh, and that's why it's excluded from requirements.txt. I know this is supported on Ubuntu, Debian, and SUSE distributions. Which distribution did you set it up on?
My distribution is Ubuntu, i used pip install psycopg2 this project. I Have other projetc with:
psycopg2-binary==version psycopg2==version
Maybe it works
Okay no worries, if others experience a similar issue I will consider adding it to the requirements file.
Hello!
I found index error in dashboard view, normally when my database is new and without record.
most_common_tasks_values [0] get like empty list ...