AMP Does Not Shutdown The Valheim Server Properly

  • Last Post 2 weeks ago
pdxampuser posted this 3 weeks ago

Os Version: Windows 10 PRO (build 19041.746)

Cube Coders Product: Amp

Module Used: Generic Module (Valheim)

Issue: After restarting the the Valheim server via AMP's "Status" page, game items stored on the server are missing.

Steps to Reproduce:
1. Start the Valheim server via AMP
2. Log your character into the server
3. Transfer an item from your character's inventory to a storage chest
4. Restart the server via AMP (either with "restart" or "stop" and "start" from AMP's "Status" page)
5. Log your character back into the server
6. Expected: The item you transferred from your character is still in the chest
7. Actual: The item you transferred from your character is missing from the chest

It suspect that AMP does not stop or restart the server properly. I have tried the steps to repro using the official way to run a dedicated server and shut down from Iron Gate Studios and I do not get this behavior (see below). I know this is not an official module yet, so I think we can expect some bugs and missing features. I just thought I would bring this to your attention in case you didn't know this was happening.

From Iron Gate's Velheim Dedicated Server Manual:
Stopping the Dedicated Server:
1. When you wish to stop running the server, it is important that you close it by pressing CTRL+C in the Command-window. If you close it by clicking the X in the window frame the Server may keep running in the background, we don’t really know!

Steps Tried to Resolve: None at this time

Order By: Standard | Newest | Votes
Cap980 posted this 3 weeks ago

Yeah my users noticed this first restart as well after I moved our world over to AMP. For now I just use a webhook to post to a channel in my discord letting them know the reboot is 30 minutes out. They just log off for that period and wait for the reboot since the save interval is 30 minutes.

Hopefully Iron Gate will allow editing of the save interval at some point. 30 minutes is quite a long time. If it were a 5 minute loss of progress it wouldn't be that big of a deal, to us at least.

Mike posted this 3 weeks ago

2108 has a tweak for this. But it only applies to newly created Valheim instances.

FantomByte posted this 3 weeks ago

I'm on 2108 and can confirm with a new Valheim instance I'm still getting errors when stopping or restarting the server. after the error it just gives me the Kill option which doesn't allow the game to save.

Cap980 posted this 3 weeks ago

I can confirm the behavior FantomByte described as well. I upgraded and created a fresh instance and both scheduled restarts thus far have hung and I had to kill them and manually restart the server.

Cap980 posted this 3 weeks ago

Just wanted to update to provide more info on the issue. It seems that the server isn't actually hanging on shutdown, its just the status page that is showing it as shutting down. I checked the console while it was appearing to be "locked up" and the server was still running per the console. So it is just not starting the shutdown process from what I can tell.

Mike posted this 3 weeks ago

Just took a check at this - it was a windows specific issue that meant AMP wasn't invoking taskkill properly (to request a safe shutdown) and it timed out after 30 seconds so it killed it. Next update will have a fix for this.

pdxampuser posted this 2 weeks ago

Hey Mike,

Again, thanks for the quick replies and development as usual!

However, even after installing a fresh Valheim instance using the new release, I still see the server is not shutting down properly and my steps to reproduce in my original post still fail. I still lose items on the server if you immediately shut down.

Anyone else seeing this still, or is it just me? ;-)


FantomByte posted this 2 weeks ago

I finally got around to updating to and it appears to be working. It's able to stop and restart without issues. I'll test out later today if it's saving the game when it stops.