[Flask] Thanks Ford, AND my general question

flaskee flaskee at protonmail.com
Mon Mar 9 17:02:12 EDT 2020


This is a start Ford.

Thank you.
I will work on catching up.

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, March 9, 2020 2:57 PM, Ford <ford.anthonyj at gmail.com> wrote:

> Without code or logs, we can't do much. Many of us on here are using Flask for production code, so the problem likely lies with the implementation, not the framework.
>
> How is your apache configured? Are you letting mod_wsgi directly handle your application or are you proxying to something like uwsgi or gunicorn?
> What configs are you using for your Flask app?
>
> It could be anything from IO contention to runtime errors (zero division? parsing errors?) to mod_wsgi failing out due to configuration problems (too few threads to handle request load,
>
> If possible, try testing the application running under something like uwsgi directly. That will eliminate Apache from the problem. If it still throws 500's, then you know the problem is within the app and not coming from the Apache/app interface.
>
> If the issue stems from Apache, then it's likely a configuration issue. If you're using mod_wsgi, this page on debugging might help (https://modwsgi.readthedocs.io/en/develop/user-guides/debugging-techniques.html). Logs are essential to figuring out where the issue arises from.
>
> If the issue is isolated to your app, I suggest you start with enhancing your logging at every level. Add debug level logging on any code path along the problematic route (i.e. anything that touches the page or pages that are throwing the 500). If this app isn't public facing, try enabling the built-in debugger via the debug flag (https://flask.palletsprojects.com/en/1.1.x/quickstart/#debug-mode).
>
> Try to identify patterns of usage. It could be that your traffic load is too much for a particular view, especially if it's doing something heavy. Or perhaps you're being bitten by a noisy-neighbor problem if you're hosting multiple sites/applications on the same host. If a thread is being killed for using too much memory, you could be seeing a periodic crash/reboot throwing 500's.
>
> Hope this helps!
>
> Anthony Ford
>
> On Fri, Mar 6, 2020 at 2:47 PM flaskee via Flask <flask at python.org> wrote:
>
>> Thanks Ford
>> I certainly don't expect anyone to drop everything for a general question.
>>
>> I asked my question here about 2 months back, and I'm still stuck.
>>
>> (I have been all through the stackoverflows, Miguels' blog, books, etc.)
>>
>> Here it is again.
>> =================
>>
>> I have a full flask site running under the latest Apache.
>> Debian 10.3.
>> I'm using Python 3.5.
>>
>> The site goes down with 500 errors randomly.
>> I can not figure out why.
>> It will sometimes go down (AND COME BACK UP BY ITSELF!).
>> No intervention!
>>
>> Often though I have to reload the site to get it back.
>>
>> When it is "down" with the 500 error,
>> and you access the site,
>> it still loads the access.log with the files to be accessed.
>>
>> nmap -sP mysite.org reports the "Host is up"
>> when it is in it's 500 error state.
>>
>> It is odd.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> All of this makes it so I can not recommend a full flask site to customers.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I am seeing no errors in the server's logs, the site's error.log, or anywhere really.
>>
>> Other sites on the same apache server run without problem while the flask site is 500'd.
>>
>> I am stuck
>>
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20200309/5511ea71/attachment-0001.html>


More information about the Flask mailing list