jeremylvln / Shulker

A Kubernetes operator for managing complex and dynamic Minecraft infrastructures, including game servers and proxies.
https://shulker.jeremylvln.fr/
GNU Affero General Public License v3.0
182 stars 14 forks source link

Redis server needs to have permission fixed #446

Closed stevefan1999-personal closed 6 months ago

stevefan1999-personal commented 7 months ago

What happened?

1:M 07 Mar 2024 16:20:46.078 * Background saving started by pid 60
60:C 07 Mar 2024 16:20:46.078 # Failed opening the temp RDB file temp-60.rdb (in server root dir /data) for saving: Permission denied
1:M 07 Mar 2024 16:20:46.178 # Background saving error
1:M 07 Mar 2024 16:20:52.000 * 100 changes in 300 seconds. Saving...
1:M 07 Mar 2024 16:20:52.001 * Background saving started by pid 62
62:C 07 Mar 2024 16:20:52.001 # Failed opening the temp RDB file temp-62.rdb (in server root dir /data) for saving: Permission denied
1:M 07 Mar 2024 16:20:52.101 # Background saving error

Upon inspection it is clear that the current container user does not have the permission to write:

/data $ ls -lah
total 24K
drwxr-xr-x    3 root     root        4.0K Mar  7 16:08 .
drwxr-xr-x    1 root     root        4.0K Mar  7 16:08 ..
drwx------    2 root     root       16.0K Mar  7 15:54 lost+found

Because it is also owned by root:

~ $ ls -lah /
total 68K
drwxr-xr-x    1 root     root        4.0K Mar  7 16:08 .
drwxr-xr-x    1 root     root        4.0K Mar  7 16:08 ..
drwxr-xr-x    1 root     root        4.0K Jan 27 00:55 bin
drwxr-xr-x    3 root     root        4.0K Mar  7 16:08 data

But I'm:

~ $ whoami
whoami: unknown uid 1000

What components are involved in your issue?

No response

Version

N/A

Kubernetes Version

N/A

Relevant log output

No response

Code of Conduct

jeremylvln commented 7 months ago

Hi @stevefan1999-personal!

Thanks for the bug report. I added a fsGroup field to the security context, which should resolve the issue. You can test the fix by using the next tag on the operator (after the deployment is finished). I will look into your second bug before creating a real release.

EDIT: I don't like GitHub closing the issues when a PR is merged so I re-opened it. I will let you test and confirm the issue is fixed and let you close the issue :)