CentOS8 python3 500 Error

apache2.4 django-3.0 centos8

hello.
A web site that had been running for about half a year went crazy on one day.

my django application(ssl) is strange…

This is the application structure. there is 4 apps.

mysite
 |-app1
 |-app2
 |-app3
 |-app4

main app is app1. now, there is response follows.

mysite
 |-app1 ...500 server error
 |-app2 ...200 ok
 |-app3 ...200 ok
 |-app4 ...200 ok

Below is the actual url
app1: https://www.henojiya.net/vietnam_research/
app2: https://www.henojiya.net/gmarker/
app3: https://www.henojiya.net/shopping/
app4: https://www.henojiya.net/kanban/

mmm…

# tail -f /var/log/httpd/error_log

openssl??

[Tue Aug 25 22:28:49.164124 2020] [suexec:notice] [pid 8122:tid 140202116692224] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Aug 25 22:28:49.183968 2020] [lbmethod_heartbeat:notice] [pid 8122:tid 140202116692224] AH02282: No slotmem from mod_heartmonitor
[Tue Aug 25 22:28:49.186372 2020] [mpm_event:notice] [pid 8122:tid 140202116692224] AH00489: Apache/2.4.37 (centos) OpenSSL/1.1.1c mod_wsgi/4.7.1 Python/3.6 configured -- resuming normal operations
[Tue Aug 25 22:28:49.186393 2020] [core:notice] [pid 8122:tid 140202116692224] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
# tail -f ssl_error_log

server certificate does NOT include an ID which matches the server name ??

[wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392]   File "/var/www/html/venv/lib/python3.6/site-packages/pandas/__init__.py", line 17, in <module>
[Tue Aug 25 18:28:39.109567 2020] [wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392]     "Unable to import required dependencies:\\n" + "\\n".join(missing_dependencies)
[Tue Aug 25 18:28:39.109575 2020] [wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392] ImportError: Unable to import required dependencies:
[Tue Aug 25 18:28:39.109578 2020] [wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392] numpy: Interpreter change detected - this module can only be loaded into one interpreter per process.
[Tue Aug 25 21:03:53.627872 2020] [ssl:warn] [pid 7430:tid 139632467552512] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 21:03:53.645213 2020] [ssl:warn] [pid 7430:tid 139632467552512] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 21:33:53.554592 2020] [ssl:warn] [pid 7769:tid 140223441197312] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 21:33:53.571588 2020] [ssl:warn] [pid 7769:tid 140223441197312] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 22:28:49.166069 2020] [ssl:warn] [pid 8122:tid 140202116692224] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 22:28:49.183859 2020] [ssl:warn] [pid 8122:tid 140202116692224] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name

apache setting…

# cd /etc/httpd/conf
# ls
  httpd-le-ssl.conf
  httpd.conf
  magic
(httpd.conf)
<VirtualHost *:80>
  ServerName www.henojiya.net
  DocumentRoot "/var/www/html"
(httpd-le-ssl.conf)
<VirtualHost *:443>
  ServerName www.henojiya.net
  DocumentRoot "/var/www/html"

I hitted the wall… help me! thanks

My domain is: https://www.henojiya.net/vietnam_research/

I can login to a root shell on my machine (yes or no, or I don’t know): Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): certbot 1.7.0

1 Like

Do you have some kind of ProxyPass configuration in your virtual hosts?

Could you share that part of your config?

1 Like

what is ‘ProxyPass’.
I never use ‘ProxyPass’ yet.
If you can see it by typing some command, please tell me the command.

# vi httpd-le-ssl.conf ?

thanks.

1 Like

OK. Let’s try a different approach.

Can you try setting DEBUG to true, as documented here: https://docs.djangoproject.com/en/3.1/ref/views/#the-500-server-error-view

I believe the error page is being generated by Django, not by Apache. Doing the above should reveal more information about what’s going wrong.

3 Likes

aaaaa!
Really! I should have been in debug mode!
I figured it was a MySQL issue. Thank you. I will investigate.

ProgrammingError at /vietnam_research/
(MySQLdb._exceptions.ProgrammingError) not enough arguments for format string
[SQL: 
        SELECT
              pub_date
            , industry1
            , truncate(trade_price_of_a_day / 1000000, 2) trade_price_of_a_day
2 Likes

Thank you very much.
I haven’t been in debug mode for more than half a year, so I thought it was a problem with CentOS.

The problem was resolved immediately.

VNMビューア - Google Chrome 2020-09-05 11.05.56

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.