Closed ericfischerbav closed 3 years ago
Did you try to use the image from dockerhub, https://hub.docker.com/r/espocrm/espocrm?
Does not work, either. I made some more tests with this setup:
When running php -f cron.php
in docker exec -it webapps_crm_1 /bin/bash
, the cron job does it's job as expected. When running it in docker exec -it webapps_crm-cron_1 /bin/bash
, The job does nothing. So there is something missing in the connection of both containers.
However, there's a strange phenomena... I'm sending test mails to verify the functionality. Parallel to checking if Espo is fetching mails, I checked, how the inbox in my webmail behaves. Sometimes, a fresh mail which I didn't open in webmail has been marked as read. So maybe the cron job itself is working, but it does not store the mail.
Are mails stored in the filesystem (volume)? Then I may have some acces rights problems.
How could I verify that the cron job is working? cat /dev/stdout
does not finish.
Just tested with the following docker-compose.yml
:
version: '3'
services:
# CRM
crm-db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- ./data/crm/db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: example
crm:
image: espocrm/espocrm
restart: always
volumes:
- ./data/crm/system:/var/www/html
depends_on:
- crm-db
ports:
- 8080:80
crm-cron:
image: espocrm/espocrm
restart: always
volumes:
- ./data/crm/system:/var/www/html
depends_on:
- crm
entrypoint: docker-cron.sh
EspoCRM and cron are working fine. Could you check your EspoCRM logs, ./data/crm/system/data/logs
.
Emails are not stored in the filesystem (volume), only attachments. To verify cron job, you can go to Administrator panel > Scheduled Jobs and select some Job (e.g, Send Email Notifications), and check execution log.
Thanks a lot for your help! Don't know what went wrong, now I see logs from the cron job. Maybe that just a problem with the Email tool... I don't think anymore this is Docker related.
Just to clarify: I finally can see logs like:
[2021-03-24 16:27:01] ERROR: CronManager: Failed job running, job [605b67a0a234ada42]. Error Details: Job CheckInboundEmails 6059c0ea57e8220a7: [0] cannot read - connection closed? at /var/www/html/application/Espo/Modules/Crm/Jobs/CheckInboundEmails.php:74 [] []
So I assume this problem is more connection related than cron.
I've set up Espo pretty almost exactly like you in your example docker-compose. Unfortunatly, I can't get the cronjob to work. Here's the part of my docker compose
I'm using the Dockerfile and docker-entrypoint.sh, docker-cron.sh from the apache folder. As there are different settings for the local and production environment, there are more configs publishing the port or hiding behind a reverse proxy.
I'm trying to fetch mails. When I run
docker exec -it webapps_crm_1 /bin/bash
and thenphp cron.php
in the/var/www/html
directory, emails are fetched as it should. However, the cron service doesn't do this job.Is there anything I'm missing?