Forums

Error after changing system image

I've got your e-mail notice about system image. So I followed your instruction, changed system image from "fishchips" to "haggis". https://help.pythonanywhere.com/pages/ChangingSystemImage   https://help.pythonanywhere.com/pages/RebuildingVirtualenvs I rebuilt my virtualenvs and reinstalled libraries after changing system image and reload. I got error below now. Please help me pythonanywhere team!

2023-12-30 06:01:53 *** Starting uWSGI 2.0.20 (64bit) on [Sat Dec 30 06:01:53 2023] *** 2023-12-30 06:01:53 compiled with version: 9.4.0 on 22 July 2022 18:35:26 2023-12-30 06:01:53 os: Linux-5.15.0-1044-aws #49~20.04.1-Ubuntu SMP Mon Aug 21 17:09:32 UTC 2023 2023-12-30 06:01:53 nodename: blue-liveweb15 2023-12-30 06:01:53 machine: x86_64 2023-12-30 06:01:53 clock source: unix 2023-12-30 06:01:53 pcre jit disabled 2023-12-30 06:01:53 detected number of CPU cores: 4 2023-12-30 06:01:53 current working directory: /home/kocool 2023-12-30 06:01:53 detected binary path: /usr/local/bin/uwsgi 2023-12-30 06:01:53 *** dumping internal routing table *** 2023-12-30 06:01:53 [rule: 0] subject: path_info regexp: .svgz$ action: addheader:Content-Encoding:gzip 2023-12-30 06:01:53 *** end of the internal routing table *** 2023-12-30 06:01:53 chdir() to /home/kocool/kocool 2023-12-30 06:01:53 your processes number limit is 256 2023-12-30 06:01:53 your memory page size is 4096 bytes 2023-12-30 06:01:53 detected max file descriptor number: 123456 2023-12-30 06:01:53 building mime-types dictionary from file /etc/mime.types... 2023-12-30 06:01:53 567 entry found 2023-12-30 06:01:53 lock engine: pthread robust mutexes 2023-12-30 06:01:53 thunder lock: disabled (you can enable it with --thunder-lock) 2023-12-30 06:01:53 uwsgi socket 0 bound to UNIX address /var/sockets/kocool.pythonanywhere.com/socket fd 3 2023-12-30 06:01:53 Python version: 3.7.13 (default, Jul 22 2022, 17:01:12) [GCC 9.4.0] 2023-12-30 06:01:53 Set PythonHome to /home/kocool/.virtualenvs/myenv3 2023-12-30 06:01:53 Fatal Python error: 2023-12-30 06:01:53 initfsencoding 2023-12-30 06:01:53 : 2023-12-30 06:01:53 Unable to get the locale encoding 2023-12-30 06:01:53 2023-12-30 06:01:53 ModuleNotFoundError 2023-12-30 06:01:53 : 2023-12-30 06:01:53 No module named 'encodings' 2023-12-30 06:01:53 2023-12-30 06:01:53 2023-12-30 06:01:53 Current thread 0x 2023-12-30 06:01:53 00007fe5a8ac9780 2023-12-30 06:01:53 (most recent call first): 2023-12-30 06:01:53 !!! uWSGI process 1 got Segmentation Fault !!! 2023-12-30 06:01:53 *** backtrace of 1 #012/usr/local/bin/uwsgi(uwsgi_backtrace+0x2e) [0x559cf4ac69be]#012/usr/local/bin/uwsgi(uwsgi_segfault+0x27) [0x559cf4ac6da7]#012/lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7fe5aa9e0090]#012/lib/x86_64-linux-gnu/libc.so.6(abort+0x213) [0x7fe5aa9bf941]#012/usr/local/lib/libpython3.7m.so.1.0(+0x6d80b) [0x7fe5a875a80b]#012/usr/local/lib/libpython3.7m.so.1.0(+0x196f53) [0x7fe5a8883f53]#012/usr/local/lib/libpython3.7m.so.1.0(Py_InitializeEx+0xd0) [0x7fe5a8884c90]#012/usr/lib/uwsgi/python37_plugin.so(uwsgi_python_init+0x144) [0x7fe5a8a4c0c4]#012/usr/local/bin/uwsgi(uwsgi_start+0x5af) [0x559cf4ac801f]#012/usr/local/bin/uwsgi(uwsgi_setup+0x127c) [0x559cf4aca2cc]#012/usr/local/bin/uwsgi(main+0xf) [0x559cf4a75b3f]#012/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fe5aa9c1083]#012/usr/local/bin/uwsgi(_start+0x2e) [0x559cf4a75b7e]#012 end of backtrace *** 2023-12-30 06:01:53 VACUUM: unix socket /var/sockets/kocool.pythonanywhere.com/socket removed.

Double-check that all dependencies are installed correctly in the new virtual env. It seems like encodings module isn't present. It's also advised to clear the ~/.cache folder.

Thank you for your advise, nkahr. Creating new venv after deleting .cache folder and .virtualenvs/myenv folder did not work for me. But creating new venv after deleting .cache folder and .virtualenvs folder worked! Now my app is back!!

Excellent, glad we could help!