500 Internal Server error after Ubuntu upgrade 21 to 22

253 views
Skip to first unread message

Paolo Togni

unread,
Mar 30, 2023, 11:36:16 AM3/30/23
to QATrack+
Hello,

after upgrading my server to ubuntu ver 22 from 21 I got 500 Internal Server error when  I try get in qatrack+.
Anybody can help?
Enclosed is the debug.log file

Ciao
Paolo

debug.log

Randle Taylor

unread,
Mar 30, 2023, 11:58:20 AM3/30/23
to Paolo Togni, QATrack+
HI Paolo,

Are you saying you can't log into QATrack+ at all?  Looking at that error log, I can only see errors from today related to the API.  From those errors it looks like some reference & tolerance information objects are missing.

You could fix this by activating your virtualenv and doing:

python manage.py shell_plus
>>> from qatrack.qa.models import UnitTestCollection
>>> for utc in UnitTestCollection.objects.all(): utc.save()
>>> exit

that will ensure all reference & tolerances records exist.

Randy

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/d05e6af7-1bf9-453f-825f-7e6e449f635bn%40googlegroups.com.

tbe...@gmail.com

unread,
Mar 31, 2023, 2:23:10 AM3/31/23
to QATrack+
Hi Paolo,

as far as I remember with ubuntu 22 you will run into python version trouble.

Randy gave some instructions for not using apache wsgi:

maybe that is also your problem

regards
Thomas

Randle Taylor

unread,
Mar 31, 2023, 10:25:34 AM3/31/23
to tbe...@gmail.com, QATrack+
Good catch Thomas.  I was assuming a QATrack+ problem, but you're probably right that it's a Python version issue (3.9 is max I've tested with QATrack+).

Is the virtualenv still running Python 3.9? Not sure how this works on Ubuntu 22.  If you do:
1) source ~/venvs/qatrack31/bin/activate
2) python -V
what does it print?
If it's still working and prints Python 3.9.X then you could likely do:
1) uninstall mod_wsgi (sudo apt remove libapache2-mod-wsgi-py3)
2) Install mod_wsgi using pip:  pip install mod_wsgi
3) restart Apache and cross your fingers.

If Python3.9 is no longer working then you'd need to install it, remove the existing mod_wsgi version and install the version for Python3.9 like this:
1) uninstall mod_wsgi (sudo apt remove libapache2-mod-wsgi-py3)
2) then install Python 3.9 (https://www.linuxcapable.com/how-to-install-python-3-9-on-ubuntu-22-04-lts/ including the "optional steps" to install dev and venv packages).
3) Create a new python3.9 venv:
    a) rm -rf ~/venvs/qatrack31
    b) python3.9 -m venv ~/venvs/qatrack31/
    c) source ~/venvs/qatrack31/bin/activate
    d) cd ~/web/qatrackplus
    e) pip install -r requirements/postgres.txt
4) Install mod_wsgi using pip:  pip install mod_wsgi
5) restart Apache and cross your fingers.

I will try to get an Ubuntu 22 server set up soon to see if I can reproduce and test.
Randy

Paolo Togni

unread,
Mar 31, 2023, 7:46:34 PM3/31/23
to tbe...@gmail.com, QATrack+
Thank you all for your suggestions. I will try next week.
BTW, is the latest version of qatrack+ (3.1.1.2) still not compatible with python 3.10?

Paolo

You received this message because you are subscribed to a topic in the Google Groups "QATrack+" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qatrack/bpBfur1EjGM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/9b139cf6-9aa6-4046-a8ee-2a9f5509ed60n%40googlegroups.com.

Randle Taylor

unread,
Mar 31, 2023, 8:36:55 PM3/31/23
to Paolo Togni, tbe...@gmail.com, QATrack+
I was able to get things working with Python3.10 after updating some dependencies.  If you want to try that out instead of (or before) uninstalling mod_wsgi you could try:

python3 -m venv ~/venvs/qatrackpy310
source ~/venvs/qatrackpy310/bin/activate
cd ~/web/qatrackplus
git fetch origin
git checkout python3.10
pip install -r requirements/postgres.txt

Then edit /etc/apache2/sites-enabled/qatrack.conf and change the "qatrack31" to "qatrackpy310" in the WSGIDaemon line:

    WSGIDaemonProcess qatrackplus python-home=/home/YOURUSERNAMEHERE/venvs/qatrackpy310 python-path=/home/YOURUSERNAMEHERE/web/qatrackplus

then restart Apache:

sudo service apache2 restart

You would also need to make the same sort of edit to /etc/supervisor/conf.d/django-q.conf

then restart Django Q:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl restart django-q

Warning again, that I haven't actually tested this!


Adnan Beganović

unread,
Jun 29, 2023, 5:24:41 PM6/29/23
to QATrack+
Hello everyone,

I wanted to provide an update on my progress with the QATrack installation. After encountering some challenges, I am happy to report that I have successfully installed it and resolved the issues. Here's what I did:

1. I followed the installation procedures using Python 3.10.6, and everything went smoothly until I reached the command "pip install -r requirements/mysql.txt."

2. At this point, I encountered some errors, but I was able to resolve them by executing the following commands:
   sudo apt-get install libjpeg-dev
   pip install --upgrade Pillow
   pip install pandas

   These steps helped me overcome the issues I was facing.

3. After resolving the errors, I ran the command "make test_simple," and the tests executed successfully. The results were as follows:
   ```
   Results (128.88s):
       1073 passed
          5 skipped
         32 deselected
   ```

4. During the installation process, I also noticed another aspect that might be worth mentioning. When creating the superuser using the command "python manage.py createsuperuser," I made sure to use a long and secure password. Previously, I had encountered permission-related problems, including a 500 error. In some of my previous installations, I had issues with running django-q, and the command "sudo supervisorctl status" displayed errors. These problems were ultimately resolved by addressing permissions. While I cannot say with certainty, it is possible that the use of a short and insecure password was the cause of those issues.

I am pleased to inform you that the server is now running properly, and I can access the admin page without any problems.

Thank you for your support and guidance throughout this process. If anyone has any further insights or suggestions, please feel free to share them.

Best regards,
Adnan

Randle Taylor

unread,
Jul 1, 2023, 2:12:14 PM7/1/23
to Adnan Beganović, QATrack+
Thank you for the update Adnan!  I'm glad you were able to get everything resolved.

Randy

Keith Schembri

unread,
May 17, 2024, 7:25:10 AMMay 17
to QATrack+
Hi all,

I have managed to install QATrack+ on Ubuntu 22.04 with Python 3.10.12 by combining both Randle's and Adnan's messages.

I first activated the python environment and installed the python libraries:


python3 -m venv ~/venvs/qatrackpy310
source ~/venvs/qatrackpy310/bin/activate
cd ~/web/qatrackplus
git fetch origin
git checkout python3.10
pip install -r requirements/postgres.txt

Following this I still had some errors with some libraries mostly Pillow and Mysqlclient which I resolved by the following commands:

sudo apt-get install libjpeg-dev
pip install --upgrade Pillow
pip install pandas
sudo apt-get install default-libmysqlclient-dev
pip3 install mysqlclient==2.0.3 

With this I was able to run make test_simple successfully.

I also changed the directory in the qatrack.conf and django-q.conf as Randle mentioned in a previous message.

Thank you all.

Regards,
Keith

Safir

unread,
May 21, 2024, 5:28:56 AMMay 21
to QATrack+
Thank you for this update, Keith!

This information is very useful as it allows us to use up-to-date Python scripts with the latest versions of Python.

Regards,
Safir
Reply all
Reply to author
Forward
0 new messages