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>