0

Like 7 months ago I created a flask API that was being served with Apache, everything was working fine up until last week when it started to returning the following error: "data":[],"pagination":{"cursor":null},"raw":"{\"error\":\"access_denied\",\"hint\":\"Access token is invalid\",\"message\":\"The resource owner or authorization server denied the request.\"}","headers":{"date":"Mon, 12 Sep 2022 22:55:56 GMT","server":"Apache/2.4.43 () mod_wsgi/4.8.0 Python/3.7 OpenSSL/1.0.2k-fips","upgrade":"h2,h2c","connection":"Upgrade, close","content-length":"134","content-type":"application/json"}}

If I restart the Apache server with sudo httpd -k stop/start it begins to work again for a few hours before returning the same error, what could cause this issue? I have a very basic Apache configuration:

<VirtualHost *:1024>
     WSGIDaemonProcess flask_api python-path=/var/www/html/flask_api:/var/www/html/flask_api/flask_env/lib/python3.7/site-packages
     # Add machine's IP address (use ifconfig command)
     ServerName *******
     # DocumentRoot /home/ec2-user/flask_api/
     # Give an alias to to start your website url with
     WSGIScriptAlias /api /var/www/html/flask_api/api.wsgi
     <Directory /var/www/html/flask_api>
            WSGIProcessGroup flask_api
            WSGIApplicationGroup %{GLOBAL}
                # set permissions as per apache2.conf file
            Options +Indexes +FollowSymLinks
            AllowOverride All
            Require all granted
     </Directory>
     LogLevel warn
</VirtualHost>
Amon
  • 101
  • 4
  • 1
    apache doesn't generate json. and it doesn't look like apache is doing any authentication or authorization. what authorization is in flask? – toppk Sep 14 '22 at 01:51
  • Thanks for the reply, there's no authorization as far as I know. I made a simple flask project. Is there a specific file I can show you? – Amon Sep 14 '22 at 12:38
  • I would start with the http response with headers that `curl -v` would generate, and also the api.wsgi file. Since you believe this is apache related, then perhaps the apache configuration has some settings that leaked into your virtualhost, maybe look for any updated apache configuration snippets – toppk Sep 14 '22 at 14:55

0 Answers0