stevearc / pypicloud-docker

Docker image for pypicloud
MIT License
86 stars 34 forks source link

ImportError: No module named 'encodings' #24

Closed kallqvist closed 5 years ago

kallqvist commented 5 years ago

A python import error have started to appear on every boot of containers from this image. AFAIK nothing in my environment have changed (except probably the version of this image).

I was foolishly running this from the latest-tag and not upgrading for a long while until a couple of weeks ago so I don't really know what version I've been successfully running before...

I've tried a couple of older versions of docker image but with the same result for all of them. Any ideas?

Thanks!

1/4/2019 4:48:22 PM*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
1/4/2019 4:48:22 PM*** Running /etc/my_init.d/10_syslog-ng.init...
1/4/2019 4:48:22 PMJan  4 15:48:22 9ea417f9e7e6 syslog-ng[13]: syslog-ng starting up; version='3.5.6'
1/4/2019 4:48:22 PMJan  4 15:48:22 9ea417f9e7e6 syslog-ng[13]: WARNING: you are using the pipe driver, underlying file is not a FIFO, it should be used by file(); filename='/dev/stdout'
1/4/2019 4:48:23 PMJan  4 15:48:23 9ea417f9e7e6 syslog-ng[13]: EOF on control channel, closing connection;
1/4/2019 4:48:23 PM*** Running /etc/my_init.d/pypicloud-uwsgi.sh...
1/4/2019 4:48:23 PM[uWSGI] getting INI configuration from /etc/pypicloud/config.ini
1/4/2019 4:48:24 PM*** Starting uWSGI 2.0.17.1 (64bit) on [Fri Jan  4 15:48:23 2019] ***
1/4/2019 4:48:24 PMcompiled with version: 5.4.0 20160609 on 26 November 2018 17:58:35
1/4/2019 4:48:24 PMos: Linux-4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018
1/4/2019 4:48:24 PMnodename: 9ea417f9e7e6
1/4/2019 4:48:24 PMmachine: x86_64
1/4/2019 4:48:24 PMclock source: unix
1/4/2019 4:48:24 PMdetected number of CPU cores: 2
1/4/2019 4:48:24 PMcurrent working directory: /
1/4/2019 4:48:24 PMdetected binary path: /usr/local/bin/uwsgi
1/4/2019 4:48:24 PM!!! no internal routing support, rebuild with pcre support !!!
1/4/2019 4:48:24 PMyour memory page size is 4096 bytes
1/4/2019 4:48:24 PMdetected max file descriptor number: 1048576
1/4/2019 4:48:24 PMlock engine: pthread robust mutexes
1/4/2019 4:48:24 PMthunder lock: disabled (you can enable it with --thunder-lock)
1/4/2019 4:48:24 PMuWSGI http bound on 0.0.0.0:8080 fd 6
1/4/2019 4:48:24 PMuwsgi socket 0 bound to TCP address 127.0.0.1:45349 (port auto-assigned) fd 5
1/4/2019 4:48:24 PMPython version: 3.5.2 (default, Nov 12 2018, 13:43:14)  [GCC 5.4.0 20160609]
1/4/2019 4:48:24 PM!!! Python Home is not a directory: /env !!!
1/4/2019 4:48:24 PMSet PythonHome to /env
1/4/2019 4:48:24 PMFatal Python error: Py_Initialize: Unable to get the locale encoding
1/4/2019 4:48:24 PMImportError: No module named 'encodings'
1/4/2019 4:48:24 PM
1/4/2019 4:48:24 PMCurrent thread 0x00007fc343e30700 (most recent call first):
1/4/2019 4:48:24 PMAborted (core dumped)
1/4/2019 4:48:24 PM*** /etc/my_init.d/pypicloud-uwsgi.sh failed with status 134
1/4/2019 4:48:24 PM
1/4/2019 4:48:24 PM*** Killing all processes...
1/4/2019 4:48:24 PMJan  4 15:48:24 9ea417f9e7e6 syslog-ng[13]: syslog-ng shutting down; version='3.5.6'
kallqvist commented 5 years ago

Just an update here: Today I randomly downgraded to stevearc/pypicloud:1.0.2 and it works just like before.

Not sure if that is the newest released version I would be able to run but somewhere between that label in docker hub and "latest" something did break

stevearc commented 5 years ago

Ah, I see what's going on

https://github.com/stevearc/pypicloud-docker/commit/78898ecb85ace31b75e09391db4f5f25f623188e and https://github.com/stevearc/pypicloud/commit/fec2d1c3f779f375a1b2fed14d5bef2d45984eb0#diff-85e379d391894a5ea8fe9c70abdfb933 changed the configuration so that the virtualenv at /env no longer exists. If you remove the virtualenv line from your config file it will likely work. It may be best to regenerate the config file from the tool and re-apply your changes on top, just to be sure.

Sorry about the trouble!

kallqvist commented 5 years ago

Ah, yes it worked! No worries and thanks for a great release btw! Best "it just works"-solution for self-hosted pypi I've seen. :)