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

World save is not triggered on container stop #732

Closed
guyspr opened this issue Sep 23, 2023 · 10 comments · Fixed by #735
Closed

World save is not triggered on container stop #732

guyspr opened this issue Sep 23, 2023 · 10 comments · Fixed by #735
Assignees
Labels
good first issue Good for newcomers odin Tag if theres an issue with odin

Comments

@guyspr
Copy link

guyspr commented Sep 23, 2023

I've noticed that, when restarting/stopping the server running this docker container. Then the world is not saved, and any built object will disappear since last save (which can be 30 minutes ago). It seems like the shutdown process does not force a world save which can cause data-loss.

@mbround18
Copy link
Owner

@guyspr this has been resolved before, please add this to your docker compose for the service

stop_grace_period: 2m

if it still occurs consider expanding the stop_grace_period. Larger worlds will take longer to save.

@guyspr
Copy link
Author

guyspr commented Sep 25, 2023

@guyspr this has been resolved before, please add this to your docker compose for the service

stop_grace_period: 2m

if it still occurs consider expanding the stop_grace_period. Larger worlds will take longer to save.

Thanks for your reply, I will be testing if this resolved the issue for me :)

@mbround18
Copy link
Owner

any updates @guyspr ?

@guyspr
Copy link
Author

guyspr commented Sep 27, 2023

@mbround18 It still doesn't seem to trigger the save on shutdown with the added setting. I test it by building something new in the world, then stopping and starting the container. The placed item will disappear. I do make sure to do a manual save now (using the console) before shutting down.

@mbround18
Copy link
Owner

Can you drop your docker-compose? Omitting any passwords ofc

@guyspr
Copy link
Author

guyspr commented Sep 27, 2023

Here's the compose file I'm using:

version: "3"
services:
  valheim:
    image: mbround18/valheim:latest
    stop_signal: SIGINT
    stop_grace_period: 2m
    ports:
      - "2456:2456/udp"
      - "2457:2457/udp"
      - "2458:2458/udp"
    environment:
      PORT: 2456
      NAME: "*****"
      WORLD: "*****"
      PASSWORD: "****"
      TZ: "Europe/Amsterdam"
      PUID: 1000
      GUID: 1000
      PUBLIC: 0
      AUTO_UPDATE: 0
      AUTO_UPDATE_SCHEDULE: "0 1 * * *"
      AUTO_BACKUP: 1
      AUTO_BACKUP_SCHEDULE: "*/15 * * * *"
      AUTO_BACKUP_REMOVE_OLD: 1
      AUTO_BACKUP_DAYS_TO_LIVE: 7
      AUTO_BACKUP_ON_UPDATE: 1
      AUTO_BACKUP_ON_SHUTDOWN: 1
#      TYPE: Vanilla
      TYPE: BepInEx
    volumes:
      - ./saves:/home/steam/.config/unity3d/IronGate/Valheim
      - ./server:/home/steam/valheim
      - ./backups:/home/steam/backups

@mbround18
Copy link
Owner

mbround18 commented Sep 28, 2023

Initial Thoughts

Maybe its the stop_signal: SIGINT ? ill give it a test.

With stop_signal: SIGINT

Found a house

image

Demolished it and added signature
image

Without stop_signal: SIGINT

Found house still standing after restart

image

Now i close with my new "Work"

image

Post shutdown, the work sign wasn't there. I noticed an error in the log it wasnt finding the executable to shut it down,

Root Cause Analysis

  • I found the provider of the system module changed their API again...

Fix

Ill do some code changes after work to make it a little bit more clear in the shutdown and add more logs.

@mbround18
Copy link
Owner

mbround18 commented Sep 28, 2023

Fix Available in #735

Pre-restart

i created a sign

image

Post-restart

sign still present :) not a single piece missing

image

@mbround18 mbround18 added good first issue Good for newcomers odin Tag if theres an issue with odin labels Sep 28, 2023
@mbround18 mbround18 self-assigned this Sep 28, 2023
@kodiakhq kodiakhq bot closed this as completed in #735 Sep 28, 2023
@mbround18
Copy link
Owner

@guyspr
Copy link
Author

guyspr commented Sep 29, 2023

I just tested it on my server and it has indeed been resolved. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers odin Tag if theres an issue with odin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants