Pergunta

I'm building a database (Postgresql) driven site using Flask on Webfaction and I'm getting some strange 404 errors. Here's what happens: after clicking through 4-5 pages on the site, there is usually a 404 error. Reloading the page (either Ctrl-R, selecting the URL and pressing Enter or clicking the refresh icon) makes the error go away and the page displays correctly. After visiting another 4-5 pages, the same problem occurs. Suprisingly enough, it is not always the same pages giving the 404.

I'd like to have people's opinions on what could be causing these intermittent errors...
Caching?
Unhandled database connection errors?
Other types of unhandled exceptions?


Background info (feel free to ask for more):

Flask on Python 2.7
Flask-Bootstrap
Hosted on Webfaction

Here are the headers from a successful request (after reloadign after getting a 404):

Response headers 
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 26 Jan 2014 11:46:49 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Content-Encoding: gzip


Request Headers
GET /product/333947 HTTP/1.1
Host: [mysubdomain].webfactional.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Foi útil?

Solução

It turns out it was because of server overloading due to another user on the shared server, so nothing to do with my code or configuration. Thanks for the help anyway!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top