Forceu / partkeepr_docker

Docker / Podman image for PartKeepr
GNU General Public License v3.0
8 stars 0 forks source link

PHP times out, making setup unusable on slower devices #1

Closed toblie closed 3 years ago

toblie commented 4 years ago

Hi, badly I am not able to setup the server. While the the step 'warming up the cache' it always throws an error and I am not able to finish the setup. Error message: Screenshot_20201125-131520_Chrome

Its running on pine64 using Portainer. Maybe anyone can help?

Thx

Forceu commented 4 years ago

Thanks, it seems that PHP times out. I changed the maximum execution time in 1d22aa36b2c60f6bbf274d441836089869166972, the new image is up now. Let me know in case it is not working for you!

toblie commented 4 years ago

the new image is up now.

Thanks for your fast reply! So if I use the image f0rc3/partkeepr:arm64v8-latest from docker.io it should be already the newest? THX

Forceu commented 4 years ago

Yes, that should work :)

toblie commented 4 years ago

Badly again not working but with other error:

Bildschirmfoto 2020-11-25 um 16 59 45 Bildschirmfoto 2020-11-25 um 16 56 50 Bildschirmfoto 2020-11-25 um 16 58 35

I would paste the whole error, but the error windows prevents to select and copy the text... Any further idea?

THX

Forceu commented 4 years ago

Okay that is interesting... can you please go execute

docker exec -i partkeepr-web chmod 777 -R /app/app/cache/

and let me know if that is working for you

toblie commented 4 years ago

No, the same error after chmod.

Forceu commented 4 years ago

Did that happen during or after the setup?

toblie commented 4 years ago

on the same step with warming the cache.

Forceu commented 4 years ago

Hm weird. Can you please try with the image f0rc3/partkeepr:multiarch-latest if the same problem happens there as well?

toblie commented 4 years ago

It seems this image is not available: Failure No such image: f0rc3/partkeepr:multiarch-latest ... ok now its pulled, don't know where was the issue here. Just testing and then come back.

toblie commented 4 years ago

Well... same error with this image. Before I set a memory limit to 1GB and CPU usage to 1 for this container. Now I set both to unlimited, but same this way... Not sure if it has anything todo with this even its only a warning? All other steps are green.

Bildschirmfoto 2020-11-25 um 18 43 38

Maybe there is any log which can help you?

Forceu commented 4 years ago

I just saw your issue https://github.com/partkeepr/PartKeepr/issues/1160

I think it might be related to this image, not Partkeepr. Did you import any data? If not, please try the following:

docker run -p 127.0.0.1:7156:80 --name partkeepr-web-test -d f0rc3/partkeepr:multiarch-latest

Then open localhost:7156 (different port) and try the setup again. To get the authkey, execute

docker exec -it partkeepr-web-test cat /app/app/authkey.php

This does not mount any volumes, which I assume is the issue here...

Also I tried reproducing the issue on a VM running docker instead of podman, unfortunately I cannot reproduce the problem :/

toblie commented 4 years ago

Sorry I thougt maybe the issue is on partkeepr not your image. Its still not working, but now it shows only invalid server response on the same step without any details:

Bildschirmfoto 2020-11-26 um 13 23 45

I tried it twice... with same result.

Forceu commented 3 years ago

I rewrote the Dockerfile to be now based on nginx, can you please try again with f0rc3/partkeepr:multiarch-latest?

toblie commented 3 years ago

Hi, thx for rewrite. I already checked it, but now with nginx it still hangs on the same step. But this time it shows an error 504:

Bildschirmfoto 2020-12-02 um 07 50 05

I tried it just simple like your last request, without volumes.

Forceu commented 3 years ago

Thanks, we're getting there! Apparently the server needed too much time, therefore a timeout was raised (and that was the reason why I was not able to reproduce the problem). I pushed an updated image, let me know if it is working now!

toblie commented 3 years ago

Hi, this image won't run. It stops some seconds after start. The log show this error: standard_init_linux.go:211: exec user process caused "exec format error"

Forceu commented 3 years ago

Apparently the automatic docker builder was misconfigured, the image should (finally) work now.

toblie commented 3 years ago

Same error 504 again...

Forceu commented 3 years ago

Oh I missed one line in the nginx config. Now it should really work :D

toblie commented 3 years ago

badly not really :-(

Bildschirmfoto 2020-12-03 um 14 30 29
Forceu commented 3 years ago

Thanks, I was able to reproduce the problem with CPU throttling. I am still a bit confused however why this happens... Nginx, PHP and PHP-FPM are all set to run for 50 minutes max. This issue will need more investigating, unfortunately at the moment I am unable to find the issue...

toblie commented 3 years ago

Maybe its possible to disable the cache or at least warming the cache? Or maybe enable the PHP APCu cache module ? I am not sure its because on the device performance, because other php based images runs without any issue.

But anyway thanks for your time!

Forceu commented 3 years ago

I assume you are not running the container through a reverse proxy or any other proxy? If not, it might be related to https://github.com/partkeepr/PartKeepr/issues/811 You could also try to run php /app/app/console cache:warmup on the container, maybe that helps?

toblie commented 3 years ago

No there is no proxy in my setup... But after warming the cache from shell, I can run partkeepr :-) Is there any important step in setup which should be after warming up step which is missing now ?

Forceu commented 3 years ago

Great to hear! I am not 100% sure, but it should work now without any problems. I will close this issue, as I think it is rather related to Partkeepr itself and add instructions to the readme file.

toblie commented 3 years ago

Yes that's really curious, because using the console it needs less than 20s to finish the task.

Thanks for your help and great evening!

toblie commented 3 years ago

@Forceu Can you maybe help me one last time? Is it possible for you to add the installation of apcu extension and php config within your image? Maybe this is the best solution, because I found following in the partkeepr wiki:

In order to achieve best performance, you should ensure that:

- Ensure your max_execution_time is set to 120 seconds or higher, this is required for the setup.

- Opcache enabled

- PHP-APCu installed and enabled with both cache.dunglas and cache.doctrine

https://wiki.partkeepr.org/wiki/APC_Metadata_Caching

If you have some time, would be great if you can add an image for testing... THX