Cron not working

Hi,
we migrated to passbolt:3.1.0-ce and mail stop working. We can trigger the mail sending by use the cron job part manually.

strace on cron pid say:
“[pid 1325] execve(”/bin/sh", ["/bin/sh", “-c”, “root exec /bin/bash -c “. /etc/e”…], 0x557c22acc470 /* 5 vars */) = 0”

This crash with the following message:
“[pid 1325] exit_group(127) = ?
[pid 1325] +++ exited with 127 +++
[pid 1324] <… wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 127}], 0, NULL) = 1325
[pid 1324] — SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1325, si_uid=0, si_status=127, si_utime=0, si_stime=0} —”

Our workaround: Remove ‘root exec’ from cronjob, after this it works.

We start the container with docker-compose.

Checklist
[x] I provide relevant information about my server (component names and versions, etc.)
[x] I provide a copy of my logs and healthcheck
[ ] I describe the steps I have taken to trouble shoot the problem
[ ] I describe the steps on how to reproduce the issue

We remove ‘www-data exec’ from cronjob-command. We’ve tested with root as cronuser, same result.

Which method did you use to install passbolt? Where is the ‘root exec’ statement, can you point to the files on the repositories?

We use the docker-container with custom options and a persistent data mount.

passbolt:
hostname: passbolt-service
image: xxx:port/passbolt:3.1.0-ce
depends_on:
- passbolt-mysql
restart: always
environment:
- APP_FULL_BASE_URL=xxx
- DATASOURCES_DEFAULT_HOST=passbolt-mysql
- DATASOURCES_DEFAULT_PORT=3306
- DATASOURCES_DEFAULT_USERNAME=xxx
- DATASOURCES_DEFAULT_PASSWORD=xxx
- DATASOURCES_DEFAULT_DATABASE=xxx
- EMAIL_TRANSPORT_DEFAULT_CLASS_NAME=Smtp
- EMAIL_DEFAULT_FROM=xx@yy
- EMAIL_TRANSPORT_DEFAULT_HOST=xx
- EMAIL_TRANSPORT_DEFAULT_PORT=25
- EMAIL_TRANSPORT_DEFAULT_TIMEOUT=120
- GNUPGHOME=xxx
- PASSBOLT_REGISTRATION_PUBLIC=false
- PASSBOLT_SSL_FORCE=true
- PASSBOLT_SECURITY_SET_HEADERS=true
- SECURITY_SALT=xxx
ports:
- “444:443”
volumes:
- /xxx:/home/www-data/.gnupg
- /xxx/serverkey:/etc/passbolt/gpg
networks:
- net

The cron is also defined here: /etc/cron.d/passbolt-ce-server

Our workaround:

root@passbolt-service:/usr/share/php/passbolt# crontab -l

PATH=/bin:/usr/local/bin:/usr/bin
PASSBOLT_BASE_DIR=/usr/share/php/passbolt

          • /bin/bash -c “. /etc/environment && $PASSBOLT_BASE_DIR/bin/cron”

It’s strange because to my knowledge the cronjob is now set by the debian package and looks like:


PATH=/bin:/usr/local/bin:/usr/bin
PASSBOLT_BASE_DIR=/usr/share/php/passbolt

* * * * * www-data $PASSBOLT_BASE_DIR/bin/cron

Ok, i think this is the difference between standalone vs. container image.

Will check with the team what’s the deal on Docker image.

1 Like

In the Docker image for 3.1 it is as follow:

➜  passbolt-pro-api git:(master) docker pull passbolt/passbolt:3.1.0-ce
3.1.0-ce: Pulling from passbolt/passbolt
Digest: sha256:9b3b30a493b5066379dff8f18b777c5520a65303b9020eac035d048d3f45a588
Status: Image is up to date for passbolt/passbolt:3.1.0-ce
docker.io/passbolt/passbolt:3.1.0-ce
➜  passbolt-pro-api git:(master) docker run --rm -it --entrypoint bash passbolt/passbolt:3.1.0-ce
root@4b07bc65155f:/usr/share/php/passbolt# cat /etc/cron
cron.d/       cron.daily/   cron.hourly/  cron.monthly/ cron.weekly/  crontab
root@4b07bc65155f:/usr/share/php/passbolt# cat /etc/cron.d/
.placeholder        passbolt-ce-server  php
root@4b07bc65155f:/usr/share/php/passbolt# cat /etc/cron.d/passbolt-ce-server
#
#
#  Cronjob to process emails for the Passbolt Web Service every minute.
#
#  This crontab script is part of the Passbolt Debian package,
#  see dh_installcron debhelper program for more details.
#PATH=/bin:/usr/local/bin:/usr/bin
PASSBOLT_BASE_DIR=/usr/share/php/passbolt
* * * * * www-data exec /bin/bash -c ". /etc/environment && $PASSBOLT_BASE_DIR/bin/cron"