mbround18 / valheim-docker

Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which is designed with resiliency in mind by providing automatic updates, world backup support, and a user friendly cli interface.
https://hub.docker.com/r/mbround18/valheim
BSD 3-Clause "New" or "Revised" License
767 stars 82 forks source link

cannot install bepinex using TYPE env variable #754

Closed alzedd closed 11 months ago

alzedd commented 11 months ago

I'm using dokku to build a container running my valheimserver, everything worked fine until I tried to install BepInEx using the TYPE env var.

I can assure both host and container can see the json info url:

curl "https://valheim.thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/"

and piping it to jq I got:

root@1627c4210e3f:~# curl "https://valheim.thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" | jq .latest.download_url
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1103  100  1103    0     0   5439      0 --:--:-- --:--:-- --:--:--  5460
"https://thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.2202/"

But, when I try to install it via dockerfile (env vars and dokku ps:restart valheimserver) the download fails.

LOGS

2023-11-08T17:00:18.907788338Z app[web.1]: [ODIN][INFO]  - Successfully written /home/steam/valheim/config.json
2023-11-08T17:00:18.909730078Z app[web.1]: [Valheim][steam]: Checking for TYPE flag
2023-11-08T17:00:18.909771029Z app[web.1]: [Valheim][steam]: Found Type BepInEx
2023-11-08T17:00:18.909775459Z app[web.1]: [Valheim][steam]: Running with BepInEx Valheim <3
2023-11-08T17:00:18.909779989Z app[web.1]: [Valheim][steam]: Installing BepInEx
2023-11-08T17:00:18.909783539Z app[web.1]: Calling: curl -L  | jq -r '.latest.download_url'
2023-11-08T17:00:18.996285597Z app[web.1]: curl: (3) URL using bad/illegal format or missing URL
2023-11-08T17:00:19.006986884Z app[web.1]: [Valheim][steam]: Pulling BepInEx from
2023-11-08T17:00:19.008910852Z app[web.1]: [ODIN][INFO]  - Installing
2023-11-08T17:00:19.015165284Z app[web.1]: [ODIN][ERROR] - Failed to download mod with invalid url:
2023-11-08T17:00:19.015214595Z app[web.1]: [Valheim][steam]: Starting server...
2023-11-08T17:00:19.015697841Z app[web.1]: [ODIN][INFO]  - Setting up start scripts...
2023-11-08T17:00:19.015909817Z app[web.1]: [ODIN][INFO]  - Looking for burial mounds...

EDIT

*currently using :latest image** but tried whit dokku git:from-image valheimserver mbround18/valheim:sha-a3726ac and dokku git:from-image valheimserver mbround18/valheim:v2.3.1 which all three points to the same image.

alzedd commented 11 months ago

Turns out that env.sh got populated with variables without the double quotes and since my world has a single quote in it, it breaks the env.sh and no other env var is available (see that log up there where there is no url in the curl ;) )

mbround18 commented 11 months ago

@alzedd your world name has singular quote in it? 0.o

alzedd commented 11 months ago

@mbround18 yup! it was named something like @alzedd's server

mbround18 commented 11 months ago

@mbround18 yup! it was named something like @alzedd's server

I should mention the world mention names and variables should be posix compliant. If you'd like to use single quotes in your strings you need to escape them with a back slash \ or alternatively not include them as it can cause issues with shell.

alzedd commented 11 months ago

yes, I figured that out. I just tested it locally with a single word world name and everything went fine. So I just renamed my world on my server and everything is working now.

sorry for spamming, the issue can be closed now :)