factorio-server-charts icon indicating copy to clipboard operation
factorio-server-charts copied to clipboard

Permission Change Error while Using NFS as storage class

Open mmuenker opened this issue 10 months ago • 0 comments

Description

When deploying the Factorio Server using the Helm chart provided in this repository with NFS as the storage class, the chown command fails with a non-zero exit code during both the initialization and server startup scripts, preventing the server from starting.

Environment

Issue Details

The failure occurs when the scripts attempt to change ownership of directories to the factorio user and group. Since NFS typically restricts ownership changes, the chown command exits with an error, halting the initialization and server startup processes.

Workaround Implemented

As a temporary solution, I manually adjusted the deployment configuration by setting the PUID and PGID to align with the NFS-mounted volume’s permitted UID and GID. This workaround prevents the chown command from trying to change permissions, thus allowing the server startup process to proceed without encountering errors.

Suggested Changes

  1. Configurability of PUID and PGID: Integrate the ability to configure PUID and PGID through environment variables directly in the Helm chart. This addition would provide flexibility in handling permissions with NFS storage and could prevent similar issues for other users.

  2. Reevaluate Ownership Changes in Initialization Container: Consider removing the ownership change commands in the initialization container. The subsequent command in the script sets directory permissions to 777, which suggests that altering ownership might be unnecessary and could be safely omitted to streamline the deployment process.

Conclusion

I am not fully familiar with Kubernetes and may have misconfigured some aspects. Therefore, I am open to feedback on whether this issue stems from a misconfiguration on my part or if it is a broader problem that needs addressing. I am willing to contribute a pull request to implement the suggested changes once we have consensus on the appropriate solution.

This permissions issue might be a recurring scenario for users deploying with NFS, and making these environment variables configurable via the Helm chart could provide a robust solution.

Thank you for your attention to this matter.

mmuenker avatar Apr 28 '24 20:04 mmuenker