Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading to v0.4.8. not able to start container #236

Open
cyclo-x opened this issue Feb 3, 2025 · 10 comments
Open

After upgrading to v0.4.8. not able to start container #236

cyclo-x opened this issue Feb 3, 2025 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@cyclo-x
Copy link

cyclo-x commented Feb 3, 2025

Since upgrading to V0.4.8 getting error:

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID: 65534
User GID: 100
───────────────────────────────────────
[custom-init] No custom files found, skipping...
crond[152]: crond (busybox 1.37.0) started, log level 5
crond[152]: user:root entry:*/15 * * * * run-parts /etc/periodic/15min
crond[152]: user:root entry:0 * * * * run-parts /etc/periodic/hourly
crond[152]: user:root entry:0 2 * * * run-parts /etc/periodic/daily
crond[152]: user:root entry:0 3 * * 6 run-parts /etc/periodic/weekly
crond[152]: user:root entry:0 5 1 * * run-parts /etc/periodic/monthly
[03-Feb-2025 18:27:00] NOTICE: fpm is running, pid 148
[03-Feb-2025 18:27:00] NOTICE: ready to handle connections
Auto Cron: Checking...
Auto Cron: Already disabled, nothing to do
[ls.io-init] done.
/run/s6/basedir/scripts/rc.init: line 76: /usr/bin/supervisord: not found
[03-Feb-2025 18:27:00] NOTICE: Terminating ...
[03-Feb-2025 18:27:00] NOTICE: exiting, bye-bye!
/package/admin/s6-overlay/libexec/preinit: info: /run belongs to uid 65534 instead of 0 - fixing it
[migrations] started
[migrations] no migrations found
usermod: no changes

@robiningelbrecht
Copy link
Owner

robiningelbrecht commented Feb 3, 2025

@FoxxMD Am I correct to state that there's a permission issue?

/package/admin/s6-overlay/libexec/preinit: info: /run belongs to uid 65534 instead of 0 - fixing it

@cyclo-x what do you see if you try to load the web app?

@robiningelbrecht robiningelbrecht self-assigned this Feb 3, 2025
@robiningelbrecht robiningelbrecht added the bug Something isn't working label Feb 3, 2025
@FoxxMD
Copy link
Contributor

FoxxMD commented Feb 3, 2025

Yeah its possible that's the issue but I'm not entirely sure.

I think that specific problem could be fixed by using a tcp socket like 127.0.0.1:9000 instead of unix socket for fpm (and here in nginx), that way /run can be entirely removed from having permissions changed on startup.

@robiningelbrecht
Copy link
Owner

@FoxxMD I'm going to be honest, not sure what this means 😇.
Does this mean I need to update the docker image to use a tcp socket?

@FoxxMD
Copy link
Contributor

FoxxMD commented Feb 3, 2025

Nevermind, instead you should just move the socket file to a different directory. I think chowning /run is not great since s6 runs from there.

  • Rename /run/php-fpm.sock to /tmp/php-fpm.sock everywhere it is used
  • Remove /run from lsiown command, and then touch + lsiown /tmp/php-fpm.sock instead

Can save the following as sock.patch and then run

git apply sock.patch

from the project root directory to apply the changes without commiting

diff --git a/docker/app/config/conf.d/default.conf b/docker/app/config/conf.d/default.conf
index 729e8d4..ad29b84 100644
--- a/docker/app/config/conf.d/default.conf
+++ b/docker/app/config/conf.d/default.conf
@@ -46,7 +46,7 @@ server {
     location ~ \.php$ {
         try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
-        fastcgi_pass unix:/run/php-fpm.sock;
+        fastcgi_pass unix:/tmp/php-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_index index.php;
         include fastcgi_params;
@@ -65,6 +65,6 @@ server {
         deny all;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
-        fastcgi_pass unix:/run/php-fpm.sock;
+        fastcgi_pass unix:/tmp/php-fpm.sock;
     }
 }
\ No newline at end of file
diff --git a/docker/app/config/fpm-pool.conf b/docker/app/config/fpm-pool.conf
index 6bad860..4b2d790 100644
--- a/docker/app/config/fpm-pool.conf
+++ b/docker/app/config/fpm-pool.conf
@@ -13,7 +13,7 @@ error_log = /dev/stderr
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
-listen = /run/php-fpm.sock
+listen = /tmp/php-fpm.sock
 
 ; Enable status page
 pm.status_path = /fpm-status
diff --git a/docker/root/etc/s6-overlay/s6-rc.d/init-stravastat-config/run b/docker/root/etc/s6-overlay/s6-rc.d/init-stravastat-config/run
index 1ee8ad4..961b1b5 100755
--- a/docker/root/etc/s6-overlay/s6-rc.d/init-stravastat-config/run
+++ b/docker/root/etc/s6-overlay/s6-rc.d/init-stravastat-config/run
@@ -1,14 +1,14 @@
 #!/usr/bin/with-contenv bash
 # shellcheck shell=bash
 
+touch /tmp/php-fpm.sock
+
 if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
     lsiown -R abc:abc \
         /config \
         /var/www \
-        /run \
         /var/lib/nginx \
         /var/log/nginx
 
-    touch /run/php-fpm.sock
-    lsiown abc:abc /run/php-fpm.sock
+    lsiown abc:abc /tmp/php-fpm.sock
 fi
\ No newline at end of file

EDIT: I'm still not sure this is the reason why @cyclo-x is having an issue but its worth addressing this first to see if it is. I'd suggest manually pushing a docker build with a temp tag so they can try it out.

@robiningelbrecht
Copy link
Owner

robiningelbrecht commented Feb 3, 2025

@FoxxMD Maybe it's worth trying to setup the image from a clean install to check if the same problem occurs? If not, @cyclo-x just needs to copy over the volumes and be done with it

@robiningelbrecht robiningelbrecht changed the title After upgrading to V0.4.8. not able to start container After upgrading to v0.4.8. not able to start container Feb 4, 2025
@robiningelbrecht
Copy link
Owner

@cyclo-x Could you try installing the app in a new container and check if you have the same problem?
No need to import activities, just navigate to localhost:PORT and check if the app loads

@cyclo-x
Copy link
Author

cyclo-x commented Feb 4, 2025

@robiningelbrecht @FoxxMD, Deleted the container, deleted the image. Same problem occurs.

@cyclo-x
Copy link
Author

cyclo-x commented Feb 4, 2025

Right after starting the container it is ending again. So cannot start web-interface

@FoxxMD
Copy link
Contributor

FoxxMD commented Feb 4, 2025

Can you post an example of the docker run or compose file you are using to run strava-statistics? How are you deploying it?

@cyclo-x
Copy link
Author

cyclo-x commented Feb 5, 2025

I am deploying it via Synology NAS ContainerManager.
Did try some other tags. v0.4.7 has the same problem. v0.4.6 is working. Hope this will help to find the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants