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

Cannot launch ValheimPlus on my Synology 1520+ using Docker #615

Closed
nkornaros opened this issue Apr 3, 2023 · 16 comments
Closed

Cannot launch ValheimPlus on my Synology 1520+ using Docker #615

nkornaros opened this issue Apr 3, 2023 · 16 comments

Comments

@nkornaros
Copy link

nkornaros commented Apr 3, 2023

Hi everyone,

Just tried to spin up my docker hosting my Valheim server and enabling the ValheimPlus mod (after having played already a bit the vanilla version).
Everything seems to go well: installing, getting the mod, the config files are created, but once it tries to start and load the different configuration, it fails repeateadly when launching the server with an epic segfault, it then retries a few times and ends up giving up.

2023-04-03T10:30:48.126163375Z,stdout,Apr  3 10:30:48 supervisord: valheim-server /usr/local/bin/valheim-server: line 123:   167 Segmentation fault      (core dumped) LD_PRELOAD=$SERVER_LD_PRELOAD "$valheim_server" -nographics -batchmode -name "$SERVER_NAME" -port "$SERVER_PORT" -world "$WORLD_NAME" -public "$SERVER_PUBLIC" "${password_args[@]}" $SERVER_ARGS > >(filter) 2>&1

2023-04-03T10:30:48.016978807Z,stdout,"Apr  3 10:30:48 supervisord: valheim-server #2  0x00000040580d65 in (wrapper managed-to-native) UnityEngine.Texture2D:GetPixelImpl_Injected (UnityEngine.Texture2D,int,int,int,UnityEngine.Color&)
"
2023-04-03T10:30:48.016917377Z,stdout,"Apr  3 10:30:48 supervisord: valheim-server #1  0x007f12a140b2c3 in Texture2D_CUSTOM_GetPixelImpl_Injected(ScriptingBackendNativeObjectPtrOpaque*, int, int, int, int, ColorRGBAf&)
"
2023-04-03T10:30:48.016869140Z,stdout,Apr  3 10:30:48 supervisord: valheim-server #0  0x007f12a0320140 in funlockfile

2023-04-03T10:30:48.016688461Z,stdout,Apr  3 10:30:48 supervisord: valheim-server Obtained 3 stack frames.

2023-04-03T10:30:48.007874669Z,stdout,Apr  3 10:30:48 supervisord: valheim-server Caught fatal signal - signo:11 code:1 errno:0 addr:0x3fb

2023-04-03T10:30:48.007724772Z,stdout,Apr  3 10:30:48 supervisord: valheim-server GetPixel called on an undefined mip (valid values are 0 - 6

2023-04-03T10:30:47.920064557Z,stdout,Apr  3 10:30:47 supervisord: valheim-server 04/03/2023 10:30:47: Builder started

You can see in the logs attached if you want more details, but on my side I am puzzled as to why it segfaults like this...

Valheim-Server.csv

@Marc--
Copy link

Marc-- commented Apr 3, 2023

Hi, same behavior for me.

It's working fine without "Plus", but keep restarting with env variable "VALHEIM_PLUS=true"

Apr 3 22:03:59 supervisord: valheim-server DEBUG - [414] - Waiting for server to listen on UDP query port 2457
2023-04-03 22:04:00,099 INFO reaped unknown pid 421 (exit status 0)
Apr 3 22:04:00 supervisord: valheim-server /usr/local/bin/valheim-server: line 123: 419 Segmentation fault (core dumped) LD_PRELOAD=$SERVER_LD_PRELOAD "$valheim_server" -nographics -batchmode -name "$SERVER_NAME" -port "$SERVER_PORT" -world "$WORLD_NAME" -public "$SERVER_PUBLIC" "${password_args[@]}" $SERVER_ARGS > >(filter) 2>&1
Apr 3 22:04:00 supervisord: valheim-server DEBUG - [414] - Valheim server with PID 419 stopped
Apr 3 22:04:00 supervisord: valheim-server INFO - Releasing PID file /var/run/valheim/valheim-server.pid
Apr 3 22:04:00 supervisord: valheim-server INFO - Shutdown complete
2023-04-03 22:04:01,102 INFO exited: valheim-server (exit status 0; not expected)
2023-04-03 22:04:05,111 INFO spawned: 'valheim-server' with pid 501
2023-04-03 22:04:05,112 INFO reaped unknown pid 495 (exit status 0)

@nmartin867
Copy link

nmartin867 commented Apr 4, 2023

@Marc-- @nkornaros The issue is actually with the latest Valheim+ release. issue #803

If you use the "community fix version" (as suggested in the linked issue) the server instance should start fine.

Use the VALHEIM_PLUS_REPO environment variable when starting your container to point to the community release of Valheim+.

$ docker run -d \
    --name valheim-server \
    --cap-add=sys_nice \
    --stop-timeout 120 \
    -p 2456-2457:2456-2457/udp \
    -v $HOME/valheim-server/config:/config \
    -v $HOME/valheim-server/data:/opt/valheim \
    -e SERVER_NAME="My Server" \
    -e WORLD_NAME="Neotopia" \
    -e SERVER_PASS="secret" \
    -e VALHEIM_PLUS=true \
    -e VALHEIM_PLUS_REPO="Grantapher/ValheimPlus" \
    ghcr.io/lloesche/valheim-server

Or just add VALHEIM_PLUS_REPO="Grantapher/ValheimPlus" in your valheim.env if you are using docker-compose.

@nkornaros
Copy link
Author

@nmartin867 I'll give it a try, I checked the other issues but did not do the match it to my issue thanks for the pointer and I'll keep you posted.

@Marc--
Copy link

Marc-- commented Apr 4, 2023

@nmartin867 Thank you, it's working great with the community release of Valheim+.

Great job with Valheim server, it makes me try Docker, and now i've a portainer install with 11 containers and i learn a lot !

@nmartin867
Copy link

@Marc-- Glad to hear it's working out.
I'm just a Valheim fan myself. Credit for this docker image goes to the repo's owner. ;)

@nkornaros
Copy link
Author

nkornaros commented Apr 5, 2023

@nmartin867 and anyone who knows, despite using the env variables:

  • VALHEIM_PLUS=true
  • VALHEIM_PLUS_REPO="Grantapher/ValheimPlus"

I have the feeling it is not downloading it and using the previous downloaded version, do you know how to force it? Do I have to delete a part of the data folders? Or all of it? See attached logs and screenshot?

Sorry if the question is silly, but I do not want to mess up everything.

2023-04-05T11:21:30.260246436Z,stdout,Apr  5 11:21:30 supervisord: valheim-updater DEBUG - [45] - Writing file to start Valheim server
2023-04-05T11:21:30.259404736Z,stdout,Apr  5 11:21:30 supervisord: valheim-updater DEBUG - [123] - Local ValheimPlus archive is identical to remote archive and was successfully installed - no update required
2023-04-05T11:21:29.259380353Z,stdout,Apr  5 11:21:29 supervisord: valheim-updater DEBUG - [45] - ValheimPlus is enabled - running updater
2023-04-05T11:21:29.259006009Z,stdout,Apr  5 11:21:29 supervisord: valheim-updater INFO - Valheim Server is already the latest version

image

@nkornaros
Copy link
Author

nkornaros commented Apr 5, 2023

Actually, @nmartin867 , I used one env variable that enables the docker to re-download the V+ mod (DEBUG_REINSTALL_VALHEIM_PLUS=true) but actually, it seems it does not take the VALHEIM_PLUS_REPO in account as shown in the logs:

image

It seems to take the default repo and not the one specified in the Environment variables

@nmartin867
Copy link

nmartin867 commented Apr 5, 2023

@nkornaros it definitely will use the repo specified in VALHEIM_PLUS_REPO. This is happening here. You are storing your env vars in valheim.env and referencing this in your docker-compose.yaml?

The bash script does, however, check to see if a newer version is available. I'd have to revisit the source code to see if that's the issue. I would suggest creating a fresh image. If you already have worlds you don't want to loose you can copy them into config/worlds_local.

If you are still having an issue let me know. I can post a docker-compose.yaml and valheim.env that should work.

@nkornaros
Copy link
Author

@nmartin867 I did a few more tests on my side and even put a dumb value in the VALHEIM_PLUS_REPO environment variable but it is clearly ignored when launching the container (see below).

Wondering if it's something with Syno or something else, I am really stuck here. What I can imagine is forking the project and testing by putting the value hardcoded, but this is super ugly... Any suggestion?

image
image

@Marc--
Copy link

Marc-- commented Apr 12, 2023

@nkornaros how do you use environment variables with Syno? Is it with an ".env" file?
Are the other variables working? WORLD_NAME or SERVER_NAME are easy to check.

I ask because on my setup (Openmediavault/Portainer) I was bothered with the .env file.

Edit: "A picture paints a thousand words"

2023-04-12 12_36_42-Portainer _ local

@nkornaros
Copy link
Author

@nmartin867 On Syno it is also via a web UI see below as you said an image is better than words:
image

I have indeed tested multiple variables, the world name, the password, the switch for the V+ mod, and the release to use and they work fine, only the repo seems to be ignored.

I need to test one a two other things, but honestly I am not getting why there is such issue...

@nkornaros
Copy link
Author

@nmartin867 tried a few more things, and was able to confirm that the environment variable is properly passed to the container by logging using a terminal and executing the command normally done by the script:
curl -sfSL "https://api.github.com/repos/$VALHEIM_PLUS_REPO/releases/$VALHEIM_PLUS_RELEASE"
and getting the correct value:
https://api.github.com/repos/Grantapher/ValheimPlus/releases/latest
as per the environment variables request it.
I checked also individually the variables by doing an echo $VALHEIM_PLUS_REPO and it gave the correct output.

I am even more lost now... I do not get why when launching the container the script does not take the correct value...

@Nirinjan
Copy link

@nkornaros I was running into the same issue as you, the variable looked to be working but it was being ignored. I was able to fix this by deleting the "ghcr.io/lloesche/valheim-server" image from my repo and redownloading it. For whatever reason mine was still from 6 months ago. Now it's from 4 weeks ago and the VALHEIM_PLUS_RELEASE var is working. Hope this helps you.

@nkornaros
Copy link
Author

@Nirinjan how can I check the date of image, normally, I already tried to force the download of the newest version of the image, but it's worth a try

@Nirinjan
Copy link

Nirinjan commented May 1, 2023

@Nirinjan how can I check the date of image, normally, I already tried to force the download of the newest version of the image, but it's worth a try

I'm not using a Synology so don't know if there are any differences but here's what I did:

 docker image ls

give me the list of images

REPOSITORY                        TAG       IMAGE ID       CREATED         SIZE
ghcr.io/lloesche/valheim-server   latest    101e470a46b3   4 weeks ago     661MB

Then to delete the image, since my image ID is 101e470a46b3, I'd do:

docker image rm 101e

From there docker compose up and it redownloaded the image for me

@nkornaros
Copy link
Author

Ah! @Nirinjan it worked!
Thanks so much.
So the issue was basically that my image was not up to date and that in Syno to update it it's a bit tricky as you need to:

  1. Stop the container
  2. Redownload the image via the Registry page in Docker app
  3. Duplicate the settings of the original container
  4. Backup the port numbers
  5. Delete the old container
  6. Update the port numbers in the new container
  7. Run the new container with the new image

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

4 participants