norimicry / stardew-multiplayer-docker

Run a Stardew Valley Multiplayer Server with docker-compose
78 stars 18 forks source link

[BUG]: #37

Closed Xardis closed 1 month ago

Xardis commented 1 month ago

Failure to answer these questions may result in your issue being dismissed as proper assistance may not be able to be provided.

Describe the bug Game fails to start when deployed on Unraid server - Ver 6.12.8.

To Reproduce Steps to reproduce the behavior:

  1. Run docker compose -f docker-compose-steam.yml on Unraid terminal
  2. Connect to container with VNC viewer/port
  3. Error message below is presented. Pressing any key results in permanent black screen
  4. See error

Expected behavior Expected to see game - received below error instead

Screenshots N/A

Logs SMAPI failed to initialize: System.TypeInitializationException: The type initializer for 'StardewModdingAPI.Constants' threw an exception. ---> System.TypeInitializationException: The type initializer for 'StardewValley.Game1' threw an exception. ---> System.IO.IOException: The file '/data/Stardew/game/StardewValley' already exists. at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at StardewValley.Program.GetAppDataFolder(String subfolder, Boolean createIfMissing) in D:\GitlabRunner\builds\Gq5qA5P4\1\ConcernedApe\stardewvalley\Farmer\Farmer\Program.cs:line 249 at StardewValley.Program.GetDebugLogPath() in D:\GitlabRunner\builds\Gq5qA5P4\1\ConcernedApe\stardewvalley\Farmer\Farmer\Program.cs:line 258 at StardewValley.Logging.DefaultLogger..ctor(Boolean shouldWriteToConsole, Boolean shouldWriteToLogFile) in D:\GitlabRunner\builds\Gq5qA5P4\1\ConcernedApe\stardewvalley\Farmer\Farmer\Logging\DefaultLogger.cs:line 14 at StardewValley.Game1..cctor() in D:\GitlabRunner\builds\Gq5qA5P4\1\ConcernedApe\stardewvalley\Farmer\Farmer\Game1.cs:line 1251 --- End of inner exception stack trace --- at StardewModdingAPI.Constants..cctor() in E:\source_Stardew\SMAPI\src\SMAPI\Constants.cs:line 154 --- End of inner exception stack trace --- at StardewModdingAPI.Program.AssertGameVersion() in E:\source_Stardew\SMAPI\src\SMAPI\Program.cs:line 130 at StardewModdingAPI.Program.Main(String[] args) in E:\source_Stardew\SMAPI\src\SMAPI\Program.cs:line 41 Game has ended. Press any key to exit.

Desktop (please complete the following information):

Additional context Installed using docker compose command on terminal, not the Unraid webUI.

Xardis commented 1 month ago

Not sure if it matters or not, but I did modify the volumes path to point to a specific folder on my host server and the folder where i downloaded the github repo too. The params are below with my edits in italics:

volumes:

Saves go here now

  - ./valley_saves:/_mnt/disk1/appdata/stardew-valley_/config/xdg/config/StardewValley/Saves
  # If you'd like to set an existing savegame before the first start otherwise this file will be edited when starting the first game
  - ./configs/autoload.json:_/mnt/disk1/appdata/stardew-valley/_data/Stardew/game/Mods/AutoLoadGame/config.json
Xardis commented 1 month ago

Changing the values of the volumes directories back to their defaults resolved the issue and now the container will run. However, how can I add an external volume so I can export the game save data automatically to prevent losing game saves during a redeploy/update?

norimicry commented 1 month ago

You had changed the wrong value in the volume mount. It would be <path on host>:/config/xdg/config/StardewValley/Saves. The first value is the location you want to mount on the host, second is the location of the mount within the container.

Xardis commented 1 month ago

OK, i see the valley_saves folder on my host, but I am not seeing any of the game saves within it. If I console into the container, I can browse to it, but an ls command isn't showing anything within it.

Basically, I downloaded the repo to a folder called "stardew-valley". Ran the docker compose on the steam yml file from this directory and a valley_saves directory was created. Do I need to put the full path to this folder in the volume path? stardew container stardew-empty-directory

norimicry commented 1 month ago

The valley_saves that is created is created by the ./valley_saves:/config/xdg/config/StardewValley/Saves argument. Have you started a new game since changing the volume to where you wanted it to be? I think you would want your volume argument to be /mnt/disk1/appdata/stardew-valley:/config/xdg/config/StardewValley/Saves (or whatever path to your Unraid directory) if you are trying to save the files to a specific directory within your Unraid server.

Xardis commented 1 month ago

I have not -- I wanted to try and copy the world save off before I recreated the container with the new value. Since I don't have anything mapped, not sure I'm going to be able to do it though.

norimicry commented 1 month ago

If you load the game and there is a save, but the save is not in .valley_saves/ with the original, incorrect mapping, I would assume the save is somewhere in the container. If the save is important, I'd poke around and try and find it. Redeploying the container with the new mapping in the compose file shouldn't destroy anything within the container, unless you docker destroy or explicitly delete the container. It should be in /config/xdg/config/StardewValley/Saves within the container. If you find it, you can set the mapping to that directory. Though stopping the container and bringing it back up with the docker compose up command shouldn't harm anything and simply update the mapping.