Forums

Webapp not responding until I reload after a day of inactivity

Hi Everyone,

I have a simple web app that becomes unresponsive to a curl POST after being dormant over night. If I use the RELOAD button the curl POST works again. I know there has been a previous post about this a couple of years back that said this should not be the case and no keep 'alive type' scripts or other work-arounds should be needed. However, I have tested extensively over a week now and it is definitely the case.

Please can anyone give any suggestions.

Thanks

Lew

Do you see any errors in the logs corresponding to that behavior?

Hi,

Thanks for the reply. No unfortunately there is nothing in the error log.

Any ideas?

Thanks.

Best

Lew

Is it completely empty? Sometimes it takes a while for the file to load

Hi,

The "error" log strangely only shows successful calls, nothing when it hangs. Here is the recent "error" log:

2024-06-06 07:12:56,654: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 07:12:56,674: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 07:58:07,572: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 07:58:07,604: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 08:25:39,548: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 08:25:39,580: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 08:25:41,926: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 08:25:41,974: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 08:26:06,745: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 08:26:06,776: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 08:32:18,757: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 08:32:18,790: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 08:58:10,495: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 08:58:10,518: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK" 2024-06-06 09:16:39,610: HTTP Request: POST https://lewperren-windsurf-search.hf.space/queue/join "HTTP/1.1 200 OK" 2024-06-06 09:16:39,633: HTTP Request: GET https://lewperren-windsurf-search.hf.space/queue/data?session_hash=56963cee-38ac-479e-b80a-e75f45811b5e "HTTP/1.1 200 OK"

Any ideas?

Thanks again,

Lew

That looks like some sort of logging that your app is printing. Have you tried making a simple GET to your web app just before hitting it with the POST after long inactivity?

Hi,

Thanks for responding, sending a GET first makes no difference. I also have 'stay alive' tasks that run every hour. The internal call to a script to keep hugging face alive is always successful, the external call to the web app starts to fail, can take a day, but once it starts to fail it does not correct. So the server is running fine, its just the web app. A manual reload is needed and then the web app works again. There is nothing in the error log. I will attach a sample from the web app access log below to show the responses, you will see starts with some example successful 200 responses, then becomes 499 and some 504 responses with long response-times. This definitely looks like it is something to do with the internal pythonanywhere.com setup regarding the web app rather than anything I have setup or scripted. Please can you help. I really like the pyhtonanywhere system, I have paid for premium and as I am now moving more into machine learning and python I am hoping to use your servers as my development and production platforms for clients, but I must resolve this issue first.

Thanks again,

Lew

Access Log. 3.80.113.192 - - [06/Jun/2024:11:58:13 +0000] "GET / HTTP/1.1" 200 8037 "-" "python-requests/2.28.1" "3.80.113.192" response-time=0.285 3.80.113.192 - - [06/Jun/2024:12:58:13 +0000] "GET / HTTP/1.1" 200 8037 "-" "python-requests/2.28.1" "3.80.113.192" response-time=0.238 3.80.113.192 - - [06/Jun/2024:13:58:14 +0000] "GET / HTTP/1.1" 200 8037 "-" "python-requests/2.28.1" "3.80.113.192" response-time=0.232 3.80.113.192 - - [06/Jun/2024:14:58:11 +0000] "GET / HTTP/1.1" 200 8037 "-" "python-requests/2.28.1" "3.80.113.192" response-time=0.302 82.17.36.248 - - [06/Jun/2024:15:20:46 +0000] "GET / HTTP/1.1" 200 8037 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.235 82.17.36.248 - - [06/Jun/2024:15:20:46 +0000] "GET /favicon.ico HTTP/1.1" 404 207 "https://lewp.pythonanywhere.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.004 82.17.36.248 - - [06/Jun/2024:15:20:48 +0000] "GET / HTTP/1.1" 200 8037 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.434 82.17.36.248 - - [06/Jun/2024:15:20:52 +0000] "GET / HTTP/1.1" 200 8037 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.275 3.80.113.192 - - [06/Jun/2024:15:58:13 +0000] "GET / HTTP/1.1" 200 8037 "-" "python-requests/2.28.1" "3.80.113.192" response-time=0.356 82.17.36.248 - - [06/Jun/2024:16:02:17 +0000] "GET / HTTP/1.1" 502 1661 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=10.914 82.17.36.248 - - [06/Jun/2024:16:02:17 +0000] "GET /favicon.ico HTTP/1.1" 502 1661 "https://lewp.pythonanywhere.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.000 82.17.36.248 - - [06/Jun/2024:16:02:42 +0000] "GET / HTTP/1.1" 200 8037 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.835 82.17.36.248 - - [06/Jun/2024:16:02:43 +0000] "GET /favicon.ico HTTP/1.1" 404 207 "https://lewp.pythonanywhere.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=0.005 82.17.36.248 - - [06/Jun/2024:16:02:58 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=12.855 82.17.36.248 - - [06/Jun/2024:16:03:12 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=11.161 82.17.36.248 - - [06/Jun/2024:16:03:28 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=15.589 82.17.36.248 - - [06/Jun/2024:16:03:44 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=6.498 82.17.36.248 - - [06/Jun/2024:16:04:42 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=51.992 82.17.36.248 - - [06/Jun/2024:16:05:33 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=41.267 82.17.36.248 - - [06/Jun/2024:16:05:52 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=13.229 82.17.36.248 - - [06/Jun/2024:16:08:59 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=144.905 82.17.36.248 - - [06/Jun/2024:16:11:53 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=16.383 82.17.36.248 - - [06/Jun/2024:16:17:29 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=17.377 82.17.36.248 - - [06/Jun/2024:16:17:38 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=8.861 82.17.36.248 - - [06/Jun/2024:16:18:11 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=6.092 82.17.36.248 - - [06/Jun/2024:16:18:20 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=9.243 82.17.36.248 - - [06/Jun/2024:16:18:45 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=24.850 82.17.36.248 - - [06/Jun/2024:16:18:48 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=2.587 82.17.36.248 - - [06/Jun/2024:16:20:34 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=71.108 82.17.36.248 - - [06/Jun/2024:16:22:30 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=116.251 82.17.36.248 - - [06/Jun/2024:16:26:14 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=1.311 82.17.36.248 - - [06/Jun/2024:16:26:34 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=19.415 82.17.36.248 - - [06/Jun/2024:16:26:47 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=12.609 82.17.36.248 - - [06/Jun/2024:16:27:10 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=22.830 82.17.36.248 - - [06/Jun/2024:16:28:05 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=47.759 82.17.36.248 - - [06/Jun/2024:16:48:34 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=16.095 82.17.36.248 - - [06/Jun/2024:16:48:56 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=19.667 82.17.36.248 - - [06/Jun/2024:16:59:00 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=122.551 3.80.113.192 - - [06/Jun/2024:17:03:11 +0000] "GET / HTTP/1.1" 499 0 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.998 82.17.36.248 - - [06/Jun/2024:17:05:20 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=5.475 82.17.36.248 - - [06/Jun/2024:17:06:17 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=23.098 82.17.36.248 - - [06/Jun/2024:17:06:17 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=56.753 82.17.36.248 - - [06/Jun/2024:17:06:37 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=12.531 82.17.36.248 - - [06/Jun/2024:17:23:24 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "82.17.36.248" response-time=3.960 82.17.36.248 - - [06/Jun/2024:17:25:12 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "82.17.36.248" response-time=108.557 82.17.36.248 - - [06/Jun/2024:17:25:30 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=300.001 82.17.36.248 - - [06/Jun/2024:17:28:07 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "82.17.36.248" response-time=174.649 82.17.36.248 - - [06/Jun/2024:17:28:40 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" "82.17.36.248" response-time=32.393 82.17.36.248 - - [06/Jun/2024:17:30:31 +0000] "GET /favicon.ico HTTP/1.1" 504 1663 "https://lewp.pythonanywhere.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=299.998 82.17.36.248 - - [06/Jun/2024:17:31:03 +0000] "GET / HTTP/1.1" 504 1663 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=300.001 82.17.36.248 - - [06/Jun/2024:17:32:59 +0000] "GET /favicon.ico HTTP/1.1" 499 0 "https://lewp.pythonanywhere.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=115.967 82.17.36.248 - - [06/Jun/2024:17:45:05 +0000] "GET / HTTP/1.1" 499 0 "-" "curl/8.4.0" "82.17.36.248" response-time=22.183 82.17.36.248 - - [06/Jun/2024:17:45:07 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.3 Safari/605.1.15" "82.17.36.248" response-time=44.076 3.80.113.192 - - [06/Jun/2024:18:03:12 +0000] "GET / HTTP/1.1" 499 0 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.999 82.17.36.248 - - [06/Jun/2024:18:05:45 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=35.030 82.17.36.248 - - [06/Jun/2024:18:05:45 +0000] "GET /favicon.ico HTTP/1.1" 499 0 "https://lewp.pythonanywhere.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=38.505 82.17.36.248 - - [06/Jun/2024:18:06:50 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=6.623 82.17.36.248 - - [06/Jun/2024:18:08:21 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=14.342 82.17.36.248 - - [06/Jun/2024:18:53:33 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=26.513 3.80.113.192 - - [06/Jun/2024:19:03:08 +0000] "GET / HTTP/1.1" 499 0 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.999 82.17.36.248 - - [06/Jun/2024:19:37:27 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=120.352 82.17.36.248 - - [06/Jun/2024:19:53:38 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=1.330 82.17.36.248 - - [06/Jun/2024:19:53:41 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=3.179 3.80.113.192 - - [06/Jun/2024:20:03:10 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.998 82.17.36.248 - - [06/Jun/2024:20:27:23 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=19.745 3.80.113.192 - - [06/Jun/2024:21:03:12 +0000] "GET / HTTP/1.1" 499 0 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.999 82.17.36.248 - - [06/Jun/2024:21:29:52 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=16.710 82.17.36.248 - - [06/Jun/2024:21:46:06 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=18.982 3.80.113.192 - - [06/Jun/2024:22:03:13 +0000] "GET / HTTP/1.1" 499 0 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.994 82.17.36.248 - - [06/Jun/2024:22:03:14 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=34.952 3.80.113.192 - - [06/Jun/2024:23:03:11 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=300.000 3.80.113.192 - - [07/Jun/2024:00:03:11 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=300.002 3.80.113.192 - - [07/Jun/2024:01:03:13 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.998 3.80.113.192 - - [07/Jun/2024:02:03:13 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.998 3.80.113.192 - - [07/Jun/2024:03:03:09 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.999 3.80.113.192 - - [07/Jun/2024:04:03:07 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.997 3.80.113.192 - - [07/Jun/2024:05:03:10 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=300.000 82.17.36.248 - - [07/Jun/2024:05:56:58 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=38.890 3.80.113.192 - - [07/Jun/2024:06:03:20 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.999 3.80.113.192 - - [07/Jun/2024:07:03:11 +0000] "GET / HTTP/1.1" 499 0 "-" "python-requests/2.28.1" "3.80.113.192" response-time=300.003 82.17.36.248 - - [07/Jun/2024:07:19:35 +0000] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36" "82.17.36.248" response-time=36.023 3.80.113.192 - - [07/Jun/2024:08:03:06 +0000] "GET / HTTP/1.1" 504 1663 "-" "python-requests/2.28.1" "3.80.113.192" response-time=299.998

If you are running those "stay alive" calls in the web app, then that is probably the cause of the issue - there is no way to run something hourly inside a web app unless it is part of a request.

Hi,

Thanks for your response. The "stay alive" calls are not within the web-app, rather I am using the task system to call a separate function in a python file in my home directory (see function code below). Therefore, I do not think this is the issue. Indeed, the problem was occurring before and the script was a way to try a solve.

Please do you have any other ideas?

Thanks

Lew

Python function run by task scheduler cron job:

def keep_flask_app_alive():

url = "https://LewP.pythonanywhere.com/"

try:

    response = requests.get(url)

    print(f"Keep-alive response for Flask app: {response.status_code}")

    print(f"Response content: {response.text}")  # Print the response content

except Exception as e:

    print(f"Error during keep-alive request for Flask app: {e}")

We've been having problems with the storage server where your account's files are located. We have a partial mitigation in place, but there will still be times when your file access will be too slow. Would you like us to migrate your account to a different file server? There will be a short downtime involved. The process we have in place to do that works well, except that any forum posts you have made in the past will have a username like "deleted-user-1234" associated with them, and if you have a paid account, or have had one in the past, you would not be able to download your past invoices from the "Account" page (though we would be able to provide them on request).

Hi,

Thanks for the response. Yes, that would be great, please migrate my account to a different server.

Thanks again.

Lew

Could you contact us on support@pythonanywhere.com to arrange a time to do your migration?

Hi,

Thanks for your response. I have sent an email to support@pythonanywhere.com saying there is no need to delay and to do the migration as soon as you can.

Thanks again,

Lew

We will handle it there.

Hi,

Thanks for the migration, after a reload the web app is running again. Hopefully, this will sort my issue.

For others facing similar problems, I have also upgraded to the latest version of the Gradio Client (1.01 at time of writing), as they said the old version could cause intermittent response problems.

I will test over the next week and report back for future users. If all is well, then into production.

Thanks again all responding 'Python Anywhere' staff for your help.

Very best

Lew

I'm glad it's working now!