Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | dcaro | T335980 Python buildpacks show a permission error when starting up | |||
Resolved | dcaro | T335865 PHP and Scala Heroku upstream buildpacks crash if ran with the Toolforge tool uid (instead of uid=1000) |
Event Timeline
There's some details on how to configure php from heroku, have not read it yet, pasting for future reference: https://devcenter.heroku.com/articles/custom-php-settings
Does not work either:
/workspace/vendor/bin/heroku-php-nginx: line 33: /workspace/vendor/heroku/heroku-buildpack-php/conf/nginx/default_include.conf: Permission denied /workspace/vendor/bin/heroku-php-nginx: line 33: /workspace/vendor/heroku/heroku-buildpack-php/conf/nginx/heroku.conf: Permission denied Assuming 512MB of RAM PHP memory_limit is 128M Bytes Starting php-fpm with 4 workers... Starting nginx... nginx: [alert] could not open error log file: open() "/app/.heroku/php/var/log/nginx/error.log" failed (13: Permission denied) 2023/05/11 15:11:52 [emerg] 167#0: open() "/workspace/vendor/heroku/heroku-buildpack-php/conf/nginx/heroku.conf" failed (2: No such file or directory) in command line Process exited unexpectedly: nginx, shutting down... Stopping php-fpm gracefully... Shutdown complete.
Unfortunately it doesn't seem to include anything about the error logs (which are the main issue here apparently).
This is a workaround (not very nice) on how to change the log path:
12:28 AM <toolforge-cli-python3> ~/Work/wikimedia/heroku_tests/php-getting-started (main|✚ 1…1) dcaro@vulcanus$ cat Procfile web: heroku-php-apache2 -C httpd.inc.conf web/ 12:28 AM <toolforge-cli-python3> ~/Work/wikimedia/heroku_tests/php-getting-started (main|✚ 1…1) dcaro@vulcanus$ cat httpd.inc.conf DirectoryIndex index.php index.html index.htm ErrorLog /data/project/test/heroku.apache2_error.${PORT}.log CustomLog /data/project/test/heroku.apache2_access.${PORT}.log heroku
If we set an env var with TOOL_DATA_DIR, we can then avoid harcodding the path and use something like:
12:28 AM <toolforge-cli-python3> ~/Work/wikimedia/heroku_tests/php-getting-started (main|✚ 1…1) dcaro@vulcanus$ cat httpd.inc.conf DirectoryIndex index.php index.html index.htm ErrorLog ${TOOL_DATA_DIR}/heroku.apache2_error.${PORT}.log CustomLog ${TOOL_DATA_DIR}/heroku.apache2_access.${PORT}.log heroku
That would be a bit better.
The scala one seems more tricky, the problem is that the entrypoint binary is not executable except by the user:
12:35 AM <toolforge-cli-python3> ~/Work/wikimedia/heroku_tests/scala-getting-started (main|✔) dcaro@vulcanus$ docker run --rm --entrypoint bash -ti test heroku@845cfa035800:/workspace$ ls -la target/universal/stage/bin/scala-getting-started -rwxr--r-- 1 heroku heroku 13426 Jan 1 1980 target/universal/stage/bin/scala-getting-started
I can't seem to get this to work:
taavi@runko:~/src/db-names main(+1/-1)* $ cat Procfile web: heroku-php-apache2 -C httpd.inc.conf . taavi@runko:~/src/db-names main(+1/-1)* $ cat httpd.inc.conf CustomLog /dev/stdout heroku ErrorLog /dev/stdout taavi@runko:~/src/db-names main(+1/-1)* $ docker run --user 51000:51000 -p 8000:8000 --rm --entrypoint web db-names DOCUMENT_ROOT changed to './' Using Apache2 VirtualHost-level configuration include 'httpd.inc.conf' Assuming 512MB of RAM PHP memory_limit is 128M Bytes Starting php-fpm with 4 workers... Starting httpd... (13)Permission denied: AH00091: httpd: could not open error log file /app/.heroku/php/var/apache2/log/error_log. AH00015: Unable to open logs Process exited unexpectedly: httpd, shutting down... Stopping php-fpm gracefully... Shutdown complete.
Despite changing ErrorLog to use a custom log file it also tries to open the non-custom log file.
Sent https://github.com/toolforge/buildservice/pull/22, that should workaround the issue (I hope it's not a permanent fix, but unblock us for now).
Can you try it out? (you'll need to setup buildservice locally though, and build there as it has a "custom" build step that pack does not know about)
Mentioned in SAL (#wikimedia-cloud) [2023-05-24T12:26:17Z] <dcaro> deploy latest buildservice (T335865)
Mentioned in SAL (#wikimedia-cloud) [2023-05-24T12:28:45Z] <dcaro> deploy latest buildservice (T335865)