Forums

My app just stoped working (3 months did not expire)

Hello!

I use pythonanywhere to host my Telegram bot. I interact with the bot once in a while and it just worked, but now it doesn't after no modification from my side. I tried to reload it, even to disable and reenable it, but it didn't help. I see on Forums that such a problem could be caused by the problem with pythonanywhere servers. Is it the case now? Thanks in advance for your help. Below is a latest server log:

2021-12-25 17:26:11 VACUUM: unix socket /var/sockets/vladriabets.pythonanywhere.com/socket removed.
2021-12-25 17:32:57 *** Starting uWSGI 2.0.17.1 (64bit) on [Sat Dec 25 17:26:17 2021] ***
2021-12-25 17:32:57 compiled with version: 5.4.0 20160609 on 07 May 2020 19:40:56
2021-12-25 17:32:59 os: Linux-5.8.0-1041-aws #43~20.04.1 SMP Wed Aug 4 15:15:42 UTC 2021
2021-12-25 17:32:59 nodename: green-liveweb13
2021-12-25 17:32:59 machine: x86_64
2021-12-25 17:32:59 clock source: unix
2021-12-25 17:32:59 pcre jit disabled
2021-12-25 17:32:59 detected number of CPU cores: 4
2021-12-25 17:32:59 current working directory: /home/vladriabets
2021-12-25 17:32:59 detected binary path: /usr/local/bin/uwsgi
2021-12-25 17:32:59 *** dumping internal routing table ***
2021-12-25 17:32:59 [rule: 0] subject: path_info regexp: \.svgz$ action: addheader:Content-Encoding:gzip
2021-12-25 17:32:59 *** end of the internal routing table ***
2021-12-25 17:32:59 chdir() to /home/vladriabets/
2021-12-25 17:32:59 your processes number limit is 128
2021-12-25 17:32:59 your memory page size is 4096 bytes
2021-12-25 17:32:59 detected max file descriptor number: 123456
2021-12-25 17:32:59 building mime-types dictionary from file /etc/mime.types...
2021-12-25 17:32:59 552 entry found
2021-12-25 17:32:59 lock engine: pthread robust mutexes
2021-12-25 17:32:59 thunder lock: disabled (you can enable it with --thunder-lock)
2021-12-25 17:32:59 uwsgi socket 0 bound to UNIX address /var/sockets/vladriabets.pythonanywhere.com/socket fd 3
2021-12-25 17:32:59 Python version: 3.8.0 (default, Nov 14 2019, 22:29:45)  [GCC 5.4.0 20160609]
2021-12-25 17:32:59 Set PythonHome to /home/vladriabets/venv
2021-12-25 17:32:59 *** Python threads support is disabled. You can enable it with --enable-threads ***
2021-12-25 17:32:59 Python main interpreter initialized at 0x1acde30
2021-12-25 17:32:59 your server socket listen backlog is limited to 100 connections
2021-12-25 17:32:59 your mercy for graceful operations on workers is 60 seconds
2021-12-25 17:32:59 setting request body buffering size to 65536 bytes
2021-12-25 17:32:59 mapped 334256 bytes (326 KB) for 1 cores
2021-12-25 17:32:59 *** Operational MODE: single process ***
2021-12-25 17:32:59 initialized 38 metrics
2021-12-25 17:32:59 WSGI app 0 (mountpoint='') ready in 400 seconds on interpreter 0x1acde30 pid: 1 (default app)
2021-12-25 17:32:59 *** uWSGI is running in multiple interpreter mode ***
2021-12-25 17:32:59 gracefully (RE)spawned uWSGI master process (pid: 1)
2021-12-25 17:32:59 spawned uWSGI worker 1 (pid: 7, cores: 1)
2021-12-25 17:32:59 metrics collector thread started
2021-12-25 17:32:59 spawned 2 offload threads for uWSGI worker 1
2021-12-25 17:32:59 Sat Dec 25 17:32:57 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) !!!
2021-12-25 17:32:59 emperor-i-am-ready-to-accept/write(): Broken pipe [core/uwsgi.c line 3579]
2021-12-25 17:32:59 Sat Dec 25 17:32:57 2021 - lost communication with the Emperor, goodbye...
2021-12-25 17:32:59 Sat Dec 25 17:32:57 2021 - graceful shutdown triggered...
2021-12-25 17:32:59 Gracefully killing worker 1 (pid: 7)...
2021-12-25 17:32:59 unable to stat() /etc/uwsgi/vladriabets.pythonanywhere.com.ini, events will be triggered as soon as the file is created
2021-12-25 17:32:59 Sat Dec 25 17:32:57 2021 - received message 0 from emperor
2021-12-25 17:32:59 SIGINT/SIGQUIT received...killing workers...
2021-12-25 17:32:59 uwsgi_master_manage_emperor()/read(): Bad file descriptor [core/emperor.c line 2431]
2021-12-25 17:32:59 lost connection with my emperor !!!
2021-12-25 17:32:59 VACUUM: unix socket /var/sockets/vladriabets.pythonanywhere.com/socket removed.

[edit by admin: formatting]

What is your code doing? Do you try to use threading? That would not work in web apps on PythonAnywhere.

It requests an external API using async functions, processes a data and sends a response via chat bot using Telegram API. I do not use threading directly, however, I'm not sure if asyncio does. Anyway - it did work for a long time and now it doesn't.

Yes, asyncio is likely to be using threads in the background, and that's not something we support. Try changing it to use non-async code -- that will work reliably.