lloesche/valheim-server-docker

Wrong password

Closed this issue · 15 comments

No matter how simple or complex I set the password, when I connect, it always tells me wrong password. Is this a bug or did I overlook something?

Do you mean this: -e SERVER_PASS="123456789" or something else? Didn't you forget about quotes? Maybe some wrong symbol somewhere?

i tried with and without quotes. . . same outcome

I had almost the same problem. The problem was in a text copied from windows to linux terminal. For some reason there were symbols making part of startup script unreadable and therefore discarded by in my case podman. I used midnight commander and its mcedit utility to track that symbols. After deletion, everything worked like sharm. I don't know how do you start your container, but in my case everything is working correctly, so SERVER_PASS arguement is working correctly out-of-the-box.

im using portainer but i dont have issues running anything else. here is my stack config:

services:
  valheim:
    image: ghcr.io/lloesche/valheim-server
    hostname: VALHEIM_SERVER
    mac_address: 02:42:4B:95:96:1A
    networks:
      LAN:
        ipv4_address: 192.168.2.24
    cap_add:
      - sys_nice
    volumes:
      - /srv/dev-disk-by-uuid-7f3efac4-ff38-4ac5-aaf9-da7ad5a4728b/Config/valheim-server/config:/config
      - /srv/dev-disk-by-uuid-7f3efac4-ff38-4ac5-aaf9-da7ad5a4728b/Config/valheim-server/data:/opt/valheim
    ports:
      - "2456-2458:2456-2458/udp"
      - "9001:9001/tcp"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - SERVER_NAME=ServerName
      - WORLD_NAME=WorldName
      - SERVER_PASS="secret"
      - SERVER_PUBLIC=true
      - BACKUPS_MAX_AGE=30
      - BEPINEX=false
      - SERVER_ARGS="-crossplay"
      - SUPERVISOR_HTTP=true
       #Mods
       #VALHEIM_PLUS=true
       #DISCORD_WEBHOOK=https://discord.com/api/webhooks/...........
      - VALHEIM_LOG_FILTER_CONTAINS_Spawned=Got character ZDOID from
       #ON_VALHEIM_LOG_FILTER_CONTAINS_Spawned={ read l; l=${l:46}; l=${l// :*/}; msg="[$(date +'%b %d %T')] Player $l connected."; curl -sfSL -X POST -H "Content-Type: application/json" -d "{\"username\":\"Hugin\",\"content\":\"$msg\"}" "$DISCORD_WEBHOOK"; }
    restart: unless-stopped
    stop_grace_period: 2m
networks:
  LAN:
    external:
      name: LAN

Looks good, but are you sure "- WORLD_NAME=WorldName" is correct? You really have a file with your world in config/worlds_local with this name? I bet you don't! ls -la worlds_local, please.

ls -la outputted this:

total 3340
drwxr-xr-x  2 1000 1000   4096 Nov 18 09:34  .
drwxr-xr-x+ 5 1000 1000   4096 Nov 17 23:34  ..
-rw-r--r--  1 1000 1000     51 Nov 17 23:14  MostWanted_backup_auto-20241117231428.fwl
-rw-r--r--  1 1000 1000     53 Nov 17 23:48 '"MostWanted"_backup_auto-20241117234856.fwl'
-rw-r--r--  1 1000 1000 560083 Nov 18 08:00  MostWanted_backup_auto-20241118080032.db
-rw-r--r--  1 1000 1000     51 Nov 18 08:00  MostWanted_backup_auto-20241118080032.fwl
-rw-r--r--  1 1000 1000 845908 Nov 18 00:14 '"MostWanted".db'
-rw-r--r--  1 1000 1000 560083 Nov 18 09:34  MostWanted.db
-rw-r--r--  1 1000 1000 845908 Nov 18 00:08 '"MostWanted".db.old'
-rw-r--r--  1 1000 1000 560083 Nov 18 09:30  MostWanted.db.old
-rw-r--r--  1 1000 1000     53 Nov 18 00:14 '"MostWanted".fwl'
-rw-r--r--  1 1000 1000     51 Nov 18 09:34  MostWanted.fwl
-rw-r--r--  1 1000 1000     53 Nov 18 00:08 '"MostWanted".fwl.old'
-rw-r--r--  1 1000 1000     51 Nov 18 09:30  MostWanted.fwl.old

Ok, so I hope that "- WORLD_NAME=MostWanted" is in your startup script/yaml/etc. Are you using permittedlist.txt? Sadly I don't have enough knowledge in portainer, but file looks ok. There maybe some other reasons, why you can't connect. I use podman and usually use something like podman logs valheim-server | grep connect (or blacklist). Why not try portainer logs valheim?

container logs show the failed connection

Nov 18 10:11:06 supervisord: valheim-server 11/18/2024 10:11:06: Got connection SteamID 765***
Nov 18 10:11:06 supervisord: valheim-server 11/18/2024 10:11:06: Got handshake from client 765***
Nov 18 10:11:07 supervisord: valheim-server 11/18/2024 10:11:07: Placed locations in zone -4,-4  duration 12.047 ms
Nov 18 10:11:08 supervisord: valheim-server 11/18/2024 10:11:08: Placed locations in zone -3,-4  duration 0.164 ms
Nov 18 10:11:09 supervisord: valheim-server 11/18/2024 10:11:09: Placed locations in zone 3,-4  duration 21.025 ms
Nov 18 10:11:11 supervisord: valheim-server 11/18/2024 10:11:11: Placed locations in zone 2,-2  duration 24.324 ms
Nov 18 10:11:12 supervisord: valheim-server 11/18/2024 10:11:12: Placed locations in zone 4,-2  duration 0.24 ms
Nov 18 10:11:12 supervisord: valheim-server 11/18/2024 10:11:12: Network version check, their:32, mine:32
Nov 18 10:11:12 supervisord: valheim-server 11/18/2024 10:11:12: Peer 765*** has wrong password
Nov 18 10:11:12 supervisord: valheim-server 11/18/2024 10:11:12: RPC_Disconnect
Nov 18 10:11:12 supervisord: valheim-server 11/18/2024 10:11:12: Disposing socket
Nov 18 10:11:12 supervisord: valheim-server 11/18/2024 10:11:12: Closing socket 765***

OK, do you use permittedlist.txt? If not, check that it is empty, or lines commented.

no, contents of that file is:

cat permittedlist.txt
// List permitted players ID ONE per line

ok i just tried including the " when typing the password and it connected. . . for some reason it is including the quotes as part of the password.

I've checked my config, I don't have quotes, but I'm not sure this is the case. I'd check environment inside container. Like portainer exec -it valheim export. Sorry, don't have any other ideas.

Congrats!

thanks for your input. i believe using the quotes was the mistake i made.

now to break it again as i want bepinex. . . lol