Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup fails with setuptools error #447

Closed
crsmithdev opened this issue Feb 15, 2022 · 21 comments
Closed

Startup fails with setuptools error #447

crsmithdev opened this issue Feb 15, 2022 · 21 comments

Comments

@crsmithdev
Copy link

crsmithdev commented Feb 15, 2022

Just started happening this morning. From the supervisor logs:

Starting Valheim Server [test]...
Error response from daemon: No such container: valheim-test
Error: No such container: 5.4.0-88-genericalheim-test
Started Valheim Server [test].
latest: Pulling from lloesche/valheim-server
Digest: sha256:7e8f73d1c4c1d828822cc287126a976f6cac4bf2df088720f58884cce1a42ece
Status: Image is up to date for ghcr.io/lloesche/valheim-server:latest
INFO - Setting uid:gid of valheim to 1000:1000
INFO - Setting timezone Etc/UTC
INFO - Setting up syslogd - logging to stdout
Traceback (most recent call last):
  File "/usr/local/bin/supervisord", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by supervisor
valheim@test.service: Main process exited, code=exited, status=1/FAILURE
valheim@test.service: Failed with result 'exit-code'.
valheim@test.service: Scheduled restart job, restart counter is at 18.
Stopped Valheim Server [test].

Related to 4318021 and #445?

@crsmithdev
Copy link
Author

Working around currently by pulling the previous image by digest ID: ghcr.io/lloesche/valheim-server@sha256:e3fb5d2812841123f4e3185a64a1055261e23655632413a49fdf2486475fb9f7

Snippet from unit file:

ExecStart=/usr/bin/docker run \
    --name valheim-%i \
    --publish 2456-2457:2456-2457/udp \
    --volume /opt/valheim/servers/%i/config:/config:Z \
    --volume /opt/valheim/servers/%i/data:/opt/valheim \
    --env-file /opt/valheim/servers/%i/env \
    --cap-add=sys_nice \
    --stop-timeout 120 \
    --pull=always \
    --rm \
    ghcr.io/lloesche/valheim-server@sha256:e3fb5d2812841123f4e3185a64a1055261e23655632413a49fdf2486475fb9f7

@MartenBE
Copy link

I have the same problem with the latest update:

$ sudo docker-compose up
Starting valheim_valheim_1 ... done
Attaching to valheim_valheim_1
valheim_1  | INFO - Setting uid:gid of valheim to 0:0
valheim_1  | INFO - Setting timezone Europe/Brussels
valheim_1  | INFO - Setting up syslogd - logging to stdout
valheim_1  | Traceback (most recent call last):
valheim_1  |   File "/usr/local/bin/supervisord", line 6, in <module>
valheim_1  |     from pkg_resources import load_entry_point
valheim_1  |   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
valheim_1  |     @_call_aside
valheim_1  |   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
valheim_1  |     f(*args, **kwargs)
valheim_1  |   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
valheim_1  |     working_set = WorkingSet._build_master()
valheim_1  |   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
valheim_1  |     ws.require(__requires__)
valheim_1  |   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
valheim_1  |     needed = self.resolve(parse_requirements(requirements))
valheim_1  |   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
valheim_1  |     raise DistributionNotFound(req, requirers)
valheim_1  | pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by supervisor
valheim_valheim_1 exited with code 1

ericljiang added a commit to ericljiang/valheim-server-cdk-app that referenced this issue Feb 16, 2022
@dahlo
Copy link
Contributor

dahlo commented Feb 16, 2022

Server starts without problems after installing python3-setuptools in the Dockerfile. PR created, #448.

@arn132
Copy link

arn132 commented Feb 16, 2022

Server starts without problems after installing python3-setuptools in the Dockerfile. PR created, #448.

Will this fix be included in the next image release?
Thanks

@schloram
Copy link

Since two hours I'm trying to figure out what I was doing wrong until I found this issue :D 🤦

I have the same problem after a container restart today:

Feb 16 21:35:31 valheim systemd[1]: Starting Valheim Server...
Feb 16 21:35:31 valheim docker[10534]: Error response from daemon: No such container: valheim.service
Feb 16 21:35:31 valheim docker[10548]: Error: No such container: valheim.service
Feb 16 21:35:31 valheim systemd[1]: Started Valheim Server.
Feb 16 21:35:31 valheim docker[10554]: latest: Pulling from lloesche/valheim-server
Feb 16 21:35:31 valheim docker[10554]: Digest: sha256:7e8f73d1c4c1d828822cc287126a976f6cac4bf2df088720f58884cce1a42ece
Feb 16 21:35:31 valheim docker[10554]: Status: Image is up to date for ghcr.io/lloesche/valheim-server:latest
Feb 16 21:35:32 valheim docker[10554]: INFO - Setting uid:gid of valheim to 0:0
Feb 16 21:35:33 valheim docker[10554]: INFO - Setting timezone Etc/UTC
Feb 16 21:35:33 valheim docker[10554]: INFO - Setting up syslogd - logging to stdout
Feb 16 21:35:33 valheim docker[10554]: INFO - Status http server activated
Feb 16 21:35:33 valheim docker[10554]: Traceback (most recent call last):
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/local/bin/supervisord", line 6, in <module>
Feb 16 21:35:33 valheim docker[10554]:     from pkg_resources import load_entry_point
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
Feb 16 21:35:33 valheim docker[10554]:     @_call_aside
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
Feb 16 21:35:33 valheim docker[10554]:     f(*args, **kwargs)
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
Feb 16 21:35:33 valheim docker[10554]:     working_set = WorkingSet._build_master()
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
Feb 16 21:35:33 valheim docker[10554]:     ws.require(__requires__)
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
Feb 16 21:35:33 valheim docker[10554]:     needed = self.resolve(parse_requirements(requirements))
Feb 16 21:35:33 valheim docker[10554]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
Feb 16 21:35:33 valheim docker[10554]:     raise DistributionNotFound(req, requirers)
Feb 16 21:35:33 valheim docker[10554]: pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by supervisor
Feb 16 21:35:33 valheim systemd[1]: valheim.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 21:35:33 valheim systemd[1]: valheim.service: Failed with result 'exit-code'.

@Mist-Hunter
Copy link

Mist-Hunter commented Feb 16, 2022

Same issue. Looking for a tag for the last release so I can get my server back up and running. Anyone see one? comment above.

Traceback (most recent call last):

  File "/usr/local/bin/supervisord", line 6, in <module>

    from pkg_resources import load_entry_point

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>

    @_call_aside

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside

    f(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set

    working_set = WorkingSet._build_master()

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master

    ws.require(__requires__)

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require

    needed = self.resolve(parse_requirements(requirements))

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve

    raise DistributionNotFound(req, requirers)

pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by supervisor

@jfklingler
Copy link

jfklingler commented Feb 17, 2022

I very much appreciate the time you take to maintain this image. For the folks who like to choose when to introduce upgrade instability (work/life balance, whatever reason) would consider making release tags when there are material changes so that otherwise innocuous changes (server reboots) or more complicated changes (k8s/docker upgrades) on your users' side don't end up with unexpected failures? Again, I have no room to really complain as a simple consumer of your work, I'm just asking that you consider whether adding tagged releases would fit into your workflow. Either way, I appreciate your efforts.

@xcjs
Copy link

xcjs commented Feb 17, 2022

Just confirming that I'm having the same issue - a new release would be welcome.

I'll use a Dockerfile to do the fix later if I need to.

@Sylvanas-1977
Copy link

Sylvanas-1977 commented Feb 17, 2022

Is there a way to fix this ? just discovered server is no longer running, not having much hope for quick fix

@canton7
Copy link

canton7 commented Feb 17, 2022

Working around currently by pulling the previous image by digest ID: ghcr.io/lloesche/valheim-server@sha256:e3fb5d2812841123f4e3185a64a1055261e23655632413a49fdf2486475fb9f7

Snippet from unit file:

ExecStart=/usr/bin/docker run \
    --name valheim-%i \
    --publish 2456-2457:2456-2457/udp \
    --volume /opt/valheim/servers/%i/config:/config:Z \
    --volume /opt/valheim/servers/%i/data:/opt/valheim \
    --env-file /opt/valheim/servers/%i/env \
    --cap-add=sys_nice \
    --stop-timeout 120 \
    --pull=always \
    --rm \
    ghcr.io/lloesche/valheim-server@sha256:e3fb5d2812841123f4e3185a64a1055261e23655632413a49fdf2486475fb9f7

☝️ That's your workaround. If you're using docker-compose, put @sha256:e3fb5d2812841123f4e3185a64a1055261e23655632413a49fdf2486475fb9f7 at the end of this line

@Sylvanas-1977
Copy link

Ah i thought i was having to enter shell inside docker container and add python or something.

@bvehse
Copy link

bvehse commented Feb 17, 2022

Experiencing this issue as well using https://github.com/Addyvan/valheim-k8s specifically. In this case the following Helm command solves the issue for the moment:

helm upgrade valheim-server valheim-k8s/valheim-k8s --namespace valheim --reuse-values --set image.repository=lloesche/valheim-server@sha256 --set image.tag=e3fb5d2812841123f4e3185a64a1055261e23655632413a49fdf2486475fb9f7

I assume changing image.repository and image.tag is needed due to the way the Helm chart uses the values in https://github.com/Addyvan/valheim-k8s/blob/main/chart/templates/deployment.yaml#L25.

@canton7
Copy link

canton7 commented Feb 17, 2022

Ah i thought i was having to enter shell inside docker container and add python or something.

Yeah, you can fix the current image, or just use the previous one. Unless you need something in the newer one, just using the previous one is easier.

@AdamLMark
Copy link
Contributor

AdamLMark commented Feb 18, 2022

Server starts without problems after installing python3-setuptools in the Dockerfile

How did you do this? Did you need to clone the project?

Thanks for your workaround, crsmithdev! I spent the past two evenings struggling with this.

@dahlo
Copy link
Contributor

dahlo commented Feb 18, 2022

Server starts without problems after installing python3-setuptools in the Dockerfile

How did you do this? Did you need to clone the project?

I would recommend downgrading as suggested by other comments as the best way to get your server up and running, but I'll also write what I did below in case anyone could find it useful.

The easiest way is to just edit the file named Dockerfile and add python3-setuptools to the list of packages installed by apt-get, as I have done here

After adding it to the Dockerfile you need to rebuild the image. You need to name (tag) the image you build to be able to tell whatever you are starting your docker container with (docker-compose in my case) to use the one you have built.

docker build -t yourname/valheim-server-docker .

The you edit your docker-compose.yaml file and change the image line and set it to yourname/valheim-server-docker so that it uses the one you just built.

Done, now you just run docker-compose up -d as usual. The downside of doing this is that you will probably get a merge conflict next time you try to pull the repo after lloesche has updated his file, and you will no longer be using the latest version of his container, so you won't get any future updates.

So downgrade for the time being, and wait for lloesche to implement the fix in his image.

@InB4DevOps
Copy link
Collaborator

Are you still seeing this problem now that #448 was merged?

@MartenBE
Copy link

The problem is solved!

@arn132
Copy link

arn132 commented Feb 18, 2022

Works fine now after installing the new update. Huge thx @lloesche

@Sylvanas-1977
Copy link

Can confirm works now

@InB4DevOps
Copy link
Collaborator

thx for the fix @dahlo

@crsmithdev
Copy link
Author

Confirmed working, thank you @dahlo @InB4DevOps !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests