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

Scheduled command failing when running with yacron #84

Open
FluffyDiscord opened this issue Mar 15, 2023 · 1 comment
Open

Scheduled command failing when running with yacron #84

FluffyDiscord opened this issue Mar 15, 2023 · 1 comment

Comments

@FluffyDiscord
Copy link

  • Yet Another Cron version: 0.19.0
  • Python version: none, using single binary yacron-0.19.0-x86_64-unknown-linux-gnu
  • Operating System: Docker - debian 11

Description & What I Did

I am trying to run PHP command (Symfony framework) via yacron every minute. For some reason, the command fails when it's run with yacron, but works just fine when running manually within the docker container. All the packages are present and work just fine, but once it's running with yacron, I get the following error

PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (/tmp/_MEI4v2QWZ/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16))) in Unknown on line 0

Is yacron loading system libraries/env in a different way or something like that?

Yacron is running as root just as the manual command is also ran as root user. There is no user mismatch. Yacron has execution permissions chmod +x yacron

@gjcarneiro
Copy link
Owner

I don't think yacron is doing anything special. Most likely some difference between environment variables. I suggest you create a cron job that runs the command env, which will print the environment variables. Then run the same env outside yacron. Sort both and diff them to try to find what is different, e.g.:

yacron cron job: env | sort > /tmp/env-yacron.txt
command outside: env | sort > /tmp/env-outside.txt && diff -u /tmp/env-outside.txt /tmp/env-yacron.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants