I have been running Snipe-it app (a Laravel based asset management software) on my Docker environment since a year ago, now I want to migrate it to K8s with its existing data, to move the data of the DB and Snipe app, I have created two persistent volumes in the K8s cluster which is backed by NFS share. I have copied the data from /var/lib/docker/volumes/snipe-vol/_data and /var/lib/docker/volumes/db-vol/_data to nfs-server:/nfs-share/persistent-volumes/snipe-vol/ and nfs-server:/nfs-share/persistent-volumes/db-vol/, the snipe-vol is mounted to /var/lib/snipeit/ directory inside the app container, the DB is running smoothly but when I run the Snipe app deployment, the pod crashes with below errors:
I had previously faced same issue with my Wordpress migration to K8s , I was getting same permission error with DB data, and I resolved it by changing ownership of the migrated data to NFS server to UID 999 and passed runAsUser: 999 security context to DB yaml file, so I have tried to change the permission of the Snipe app data on NFS server share recursively to www-data, docker, UID 1000, and root but none worked.
below is the logs of the Snipe pod on K8s.
I would be grateful if anyone can help.
chown: changing ownership of '/var/lib/snipeit/dumps': Operation not permitted
chown: changing ownership of '/var/lib/snipeit/keys/oauth-private.key': Operation not permitted
chown: changing ownership of '/var/lib/snipeit/keys/oauth-public.key': Operation not permitted
chown: changing ownership of '/var/lib/snipeit/keys': Operation not permitted
Changing upload limit to 100
Nothing to migrate.
Configuration cache cleared!
Configuration cache cleared!
Configuration cached successfully!
2023-06-26 11:08:57,877 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2023-06-26 11:08:57,878 INFO supervisord started with pid 1
2023-06-26 11:08:58,882 INFO spawned: 'exit_on_any_fatal' with pid 38
2023-06-26 11:08:58,884 INFO spawned: 'apache' with pid 39
2023-06-26 11:08:58,886 INFO spawned: 'run_schedule' with pid 40
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.171.77. Set the 'ServerName' directive globally to suppress this message
Action '-DFOREGROUND' failed.
The Apache error log may have more information.
2023-06-26 11:08:58,930 INFO exited: apache (exit status 1; not expected)
No scheduled commands are ready to run.
2023-06-26 11:09:00,140 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-06-26 11:09:00,143 INFO spawned: 'apache' with pid 51
2023-06-26 11:09:00,144 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.171.77. Set the 'ServerName' directive globally to suppress this message
Action '-DFOREGROUND' failed.
The Apache error log may have more information.
2023-06-26 11:09:00,184 INFO exited: apache (exit status 1; not expected)
2023-06-26 11:09:02,188 INFO spawned: 'apache' with pid 54
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.171.77. Set the 'ServerName' directive globally to suppress this message
Action '-DFOREGROUND' failed.
The Apache error log may have more information.
2023-06-26 11:09:02,246 INFO exited: apache (exit status 1; not expected)
2023-06-26 11:09:05,252 INFO spawned: 'apache' with pid 57
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.171.77. Set the 'ServerName' directive globally to suppress this message
Action '-DFOREGROUND' failed.
The Apache error log may have more information.
2023-06-26 11:09:05,296 INFO exited: apache (exit status 1; not expected)
2023-06-26 11:09:05,297 INFO gave up: apache entered FATAL state, too many start retries too quickly
2023-06-26 11:09:06,298 WARN received SIGTERM indicating exit request
2023-06-26 11:09:06,298 INFO waiting for exit_on_any_fatal, run_schedule to die
2023-06-26 11:09:07,300 INFO stopped: run_schedule (terminated by SIGTERM)
2023-06-26 11:09:07,303 INFO stopped: exit_on_any_fatal (terminated by SIGTERM)
noor@master:~/snipe$