Skip to content

Factorio docker container instance not gracefully shutting down when shutdown/reboot on host is executed #1354

@dreamdenizen

Description

@dreamdenizen

Operating System

Debian 12/13, Ubuntu 24.04.3

AMP Version and Build Date

2.6.2.6 - 20250804.1

AMP Release Stream

Mainline

I confirm that

  • I have searched for an existing bug report for this issue.
  • I am using the latest available version of AMP.
  • my operating system is up-to-date.

Intended Action

I am trying to shut down or reboot the host machine (Debian 12/13, Ubuntu 24.04) while a Factorio instance is running.

Expected Behaviour

When the host machine shuts down, I expect the Factorio game server instance to perform a graceful shutdown. This should save the current game state to the default.zip save file, preserving all player progress, exactly as it does when the "Stop Instance" button is used in the AMP web panel.

Actual Behaviour

When the host is shut down or rebooted (e.g., via sudo reboot), when the "Enable Auto Pause" setting in the Factorio module is disabled, the Factorio instance terminates abruptly instead of shutting down gracefully. This prevents the server from saving the latest game state. As a result, all progress made during that play session is lost, and the save file reverts to the state it was in at the last startup.

I have reviewed the instance logs from the time of the shutdown. There are no explicit error messages. The log simply stops, which makes me think the process was likely terminated uncleanly rather than being issued a graceful stop command.

Reproduction

  1. Start with a clean install of AMP on Debian 12/13 or Ubuntu 24.04.x using the standard installation script. Set it up in Docker mode.
  2. Create and start a new Factorio instance.
  3. Double-click the instance
  4. Navigate to Configuration > Factorio
  5. Set "Enable Auto Pause" to disabled.
  6. Set "Make Server Visible Publicly" to disabled
  7. Restart the instance for the setting to take effect.
  8. Connect to the game server from the Factorio client and play for a few minutes to create new progress (e.g., move your character, chop a tree).
  9. Disconnect from the game server, leaving the instance running in AMP.
  10. Connect to the host machine via SSH.
  11. Execute the command sudo reboot.
  12. After the host machine reboots, start the Factorio instance again.
  13. Connect to the game server from the Factorio client. You will find that all progress from the previous session has been lost, and the game starts from the beginning again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions