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

Env DOLI_CRON fail on first install #28

Open
marcooriani opened this issue Nov 12, 2024 · 2 comments
Open

Env DOLI_CRON fail on first install #28

marcooriani opened this issue Nov 12, 2024 · 2 comments

Comments

@marcooriani
Copy link

Hi,

I've spent some hours about fresh install of Dolibarr on Docker.
Nonthing works...
I've found a stupid undocumented problem.

dolibarr-docker
/docker-run.sh
Row 337.
${DOLI_CRON} -ne 1

As first install, i tinked "Yes, i want CRON".
But this stupid bash condition, make everything fail.

I've started from this compose:
dolibarr:
container_name: dolibarr
image: dolibarr/dolibarr:latest
restart: always
environment:
WWW_USER_ID: 82
WWW_GROUP_ID: 82
PHP_INI_DATE_TIMEZONE: Europe/Rome
PHP_INI_UPLOAD_MAX_FILESIZE: 50M
DOLI_DB_HOST: mysql
DOLI_DB_HOST_PORT: 3306
DOLI_DB_NAME: dolibarr
DOLI_DB_USER: dolibarr
DOLI_DB_PASSWORD: ${DOLIBARR_DB_PASSWORD}
DOLI_URL_ROOT: https://myorg.it
DOLI_ADMIN_LOGIN: dolibarr-admin
DOLI_ADMIN_PASSWORD: ${DOLIBARR_ADMIN_PASSWORD}
DOLI_CRON: 1
DOLI_COMPANY_NAME: "MY Org"
DOLI_COMPANY_COUNTRYCODE: "IT"
volumes:
- dolibarr_docs:/var/www/documents
- dolibarr_cust:/var/www/html/custom
networks:
- net

This service "dolibarr" has a NET network, where MySQL run as "mysql" container on default port.
UID/GID 82 is common number from PHP-FPM of Alpine, probably make no sense here.

After remove DOLI_CRON: 1 from compose, install process works correctly.

@f-hoedl
Copy link

f-hoedl commented Dec 13, 2024

similar issue, is cron meant to be run on separate service?
becuse apache not starting either

if [[ ${DOLI_CRON} -eq 1 ]]; then
    echo "PATH=\$PATH:/usr/local/bin" > /etc/cron.d/dolibarr
    echo "*/5 * * * * root /bin/su www-data -s /bin/sh -c '/var/www/scripts/cron/cron_run_jobs.php ${DOLI_CRON_KEY} ${DOLI_CRON_USER}' > /proc/1/fd/1 2> /proc/1/fd/2" >> /etc/cron.d/dolibarr
    
    # this line makes me curious
    cron -f
    exit 0
fi

if [ "${1#-}" != "$1" ]; then
  set -- apache2-foreground "$@"
fi

@marcooriani
Copy link
Author

@f-hoedl Exactly same problem here !!!

I've done some inspection about cron -f.
If you raise a shell inside dolibarr container w/o DOLI_CRON: 1 this happen:

  1. docker exec -it dolibarr sh
  2. cron -f
  3. No output of cron command, and process still seems do nonthing.

After i see THIS, I thought the same thing as you.

Maybe, CRON mode is only CLI ?
Or maybe cron -f should be cron -f & set -- apache2-foreground "$@" ???

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