Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

problems running on azure; 15min startup for unlisted instance #26

Closed
Groostav opened this issue Feb 15, 2021 · 15 comments
Closed

problems running on azure; 15min startup for unlisted instance #26

Groostav opened this issue Feb 15, 2021 · 15 comments
Labels
question Further information is requested

Comments

@Groostav
Copy link

Thanks for the docker container here! I played a bunch on a friends hosted machine, he had to go but I wanted to keep playing, this got me thinking it would be nice to host our game on a dedicated machine.

So I'm trying to get it running in an azure container. My config:

name: valheim-group 
apiVersion: '2019-12-01'
properties: 
  osType: Linux
  restartPolicy: Never
  
  containers:
  - name: valheim
    properties: 
      image: lloesche/valheim-server
      ports: 
      - protocol: udp
        port: 2456
      - protocol: udp
        port: 2457
      - protocol: udp
        port: 2458
      - port: 27015 
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 8.0
      volumeMounts:
      - mountPath: /config
        name: valheim-volume
      environmentVariables:
      - name: SERVER_NAME
        value: grooserver
      - name: WORLD_NAME
        value: groorld
      - name: SERVER_PASS
        value: xxxxxxxx

  ipAddress:
    type: Public
    ports:
    - protocol: udp
      port: 2456
    - protocol: udp
      port: 2457
    - protocol: udp
      port: 2458
    - port: 27015 
    dnsNameLabel: groostav-valheim
  
  volumes:
  - name: valheim-volume
    azureFile:
      sharename: groostav-valheim-fs
      storageAccountName: empoweropsstorage
      storageAccountKey: l5xxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==

an azure container create with the above file yields some fairly promising output:

2021-02-15 07:30:04,517 INFO Set uid to user 0 succeeded
2021-02-15 07:30:04,525 INFO RPC interface 'supervisor' initialized
2021-02-15 07:30:04,525 INFO supervisord started with pid 1
2021-02-15 07:30:05,528 INFO spawned: 'valheim-updater' with pid 10
2021-02-15 07:30:05,530 INFO spawned: 'valheim-backup' with pid 11
Running Valheim Server updater as user root uid 0
Backing up Valheim server worlds to /config/backups/worlds-20210215-073005.zip
Updating/Validating Valheim Server
  adding: worlds/ (stored 0%)
  adding: worlds/groorld.db (deflated 51%)
  adding: worlds/groorld.fwl (deflated 5%)
Removing backups older than 3 days
Waiting 3600 seconds before next backup run
2021-02-15 07:30:06,852 INFO success: valheim-updater entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-02-15 07:30:06,852 INFO success: valheim-backup entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.
...
Success! App '896660' fully installed.
>f+++++++++ LinuxPlayer_s.debug
...
Valheim Server was updated - restarting
2021-02-15 07:31:39,588 INFO spawned: 'valheim-server' with pid 78
Running Valheim Server
Found path: /opt/valheim/valheim_server.x86_64
Mono path[0] = '/opt/valheim/valheim_server_Data/Managed'
Mono config path = '/opt/valheim/valheim_server_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Initialize engine version: 2019.4.16f1 (e05b6e02d63e)
[Subsystems] Discovering subsystems at path /opt/valheim/valheim_server_Data/UnitySubsystems
Forcing GfxDevice: Null
...
2021-02-15 07:31:41,070 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim-server: ERROR (not running)
valheim-server: started
02/15/2021 07:31:50: Initializing world generator seed: ( 0 )   menu:True  worldgen version:1
...
02/15/2021 07:31:52: Remaining mountains:68
...
02/15/2021 07:31:57: Removing 1225882809
02/15/2021 07:31:57: Removing 404029124
02/15/2021 07:31:57: Audioman already exist, destroying self
Unloading 490 unused Assets to reduce memory usage. Loaded Objects now: 86244.
Total: 69.662500 ms (FindLiveObjects: 4.257700 ms CreateObjectMapping: 3.285200 ms MarkObjects: 60.131100 ms  DeleteObjects: 1.984400 ms)
02/15/2021 07:32:01: Zonesystem Start 233
02/15/2021 07:32:01: DungeonDB Start 233
02/15/2021 07:42:02:  Connections 0 ZDOS:81  sent:0 recv:0
...

after which the updater and some steam related daemon continue to occasionally produce output.

But my server is never listed, nor is it anything other than "not responding" from the steam servers list


Some questions:

  1. what exactly appears in the server list? Your readme mentions that you should "filter", but should I simply filter by server name? is the SERVER_NAME environment parameter something that valheim uses in its filter?
  2. why did DungeonDB take 10 minutes to run? Is this normal? Is typical valheim startup time 10-15 minutes?
  3. are there any ports other than 2456-2348 that we need? You can see I opened 27015 when looking at some steam help pages, but that hasn't solved any problems. When I add a server on the steam server page, how does my steam client reach out to that server?

Any help is appreicated

@Groostav
Copy link
Author

I also cant ping the resulting instance, does azure forward ICMP packets to the machine? what modifications do I need to make to your dockerfile to get the instance to respond to a ping request?

@InB4DevOps
Copy link
Collaborator

InB4DevOps commented Feb 15, 2021

Which port did you use when adding the server IP to Steam's favourites?
The reason you can not find it in steams server list is somehow related to your geo location.
Since the server browser can only show ~5000 servers it only gives the 5000 nearest servers or those with the lowest latency. (at least that's my understanding)

A friend of mine has a server hosted @nitrado in Germany and I could only find it in Steam when using a swiss VPN although I'm from Germany. Maybe try a VPN nearer to your Azure data center? (at least for finding it via Steam, connecting via IP:port should be possible without VPN)

@Groostav
Copy link
Author

I tried adding groostav-valheim.westus.azurecontainer.io:2456 which steam converted to 23.101.203.144:2456, which is the correct IP of the container, but it simply states "server not responding".

What kind of test can I do to make sure that I'm not getting blocked by some firewall?

@InB4DevOps
Copy link
Collaborator

You need to add it with port 2457 but I just tried and I can not find a game on that host either.
Since Steam can not find a game on that port there must be a firewall blocking incoming connections.

@Groostav
Copy link
Author

@InB4DevOps I actually literally just now rebooted it, but that ties into my other question:

  • does it normally take 10+ minutes at the DungeonDB start section?
  • should i be concerned with the lines
    valheim-server: ERROR (not running)
    valheim-server: started
    
    in the logs?

@InB4DevOps
Copy link
Collaborator

InB4DevOps commented Feb 15, 2021

  • does it normally take 10+ minutes at the DungeonDB start section?

Usually I can connect to the server as soon as I see that DungeonDB start log message.

  • should i be concerned with the lines
    valheim-server: ERROR (not running)
    valheim-server: started
    

I also have those lines in my log so I wouldn't be concerned.

@InB4DevOps
Copy link
Collaborator

I just checked: I have that message "Connections 0 ZDOS:xxxxxx sent:0 recv:0" every 10 minutes so that does not seem to be related to the server start but it's rather a periodic log message.

@Groostav
Copy link
Author

Groostav commented Feb 15, 2021

I also just put a little nginx app up on port 80, and its visible without any issues. It does bother me that these containers dont respond to ICMP packets but then i dont understand how dockers "EXPOSE" is supposed to work with icmp.

anyways, I dont think its a firewall issue, I think that the machine is exposed on port 2456.

@InB4DevOps
Copy link
Collaborator

I have the same port setup as you and when I add my server on port 2456 then Steam won't find a game. It does work on 2457.
You have to use port +1 to make it work (don't ask me why).

@InB4DevOps
Copy link
Collaborator

InB4DevOps commented Feb 15, 2021

BTW: your config - is that a docker compose file?
I'm not too sure (cause I don't use docker compose), but don't you need to have an internal port (the server's port inside the container) as well as an external port? Otherwise I think docker will randomly / automagically select external ports.

Look at https://docs.docker.com/engine/reference/commandline/port/ and make sure that docker uses the ports you are expecting it to use :)

@InB4DevOps
Copy link
Collaborator

InB4DevOps commented Feb 15, 2021

Valheim-Server-1402 is the name of my Valheim container.

root@superserver:/$ docker port Valheim-Server-1402
2456/udp -> 0.0.0.0:2456
2457/udp -> 0.0.0.0:2457
2458/udp -> 0.0.0.0:2458

@lloesche lloesche added the question Further information is requested label Feb 15, 2021
@lloesche
Copy link
Owner

lloesche commented Feb 15, 2021

  • should i be concerned with the lines

    valheim-server: ERROR (not running)
    valheim-server: started
    

    in the logs?

No, it just means that the server wasn't running and now it is. Whenever you first start the container this is expected.
The reason is that the valheim-updater script just calls supervisorctl restart valheim-server whenever the files are being updated from Steam. It doesn't know whether the files were updated because it is the first time the container is run or if they got updated because of a new Valheim release.

The reason why we always use restart is because people might want to enforce an update check on a running container by calling docker exec ... supervisorctl restart valheim-updater.

@Groostav
Copy link
Author

Groostav commented Feb 15, 2021

thanks @InB4DevOps, @lloesche , it was running this whole time on 2457.

Before I call this issue closed, i just created a steam dedicated server token here: https://steamcommunity.com/dev/managegameservers, but im not familiar with steamcmd, any idea how I can use that token with your image? I presume I want to append something like STEAMCMD_ARGS to +login authToken=ABCD1234, but I cant seem to find the syntax.

@InB4DevOps
Copy link
Collaborator

So, umm, can you connect now? :)

@lloesche
Copy link
Owner

STEAMCMD_ARGS are only used in the updater. Does Valheim even have GSLT support? Very few games do. Mostly Source Engine based ones and Tower Unite comes to mind. In either case Valheim would have its own +sv_setsteamaccount equivalent CLI option which I don't think it does currently.

Repository owner locked and limited conversation to collaborators Feb 16, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants