Cron job running for non existent instance

[details=“Support intro”]

Nextcloud version (eg, 20.0.5): Nextcloud 22.2.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu LTS server 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 7.4

The issue you are facing:

I’ve intially set up a nextcloud instance with a root of nextcloud3.
After about a year I wanted to try something out and created a new instance (mycloudpics) by copying the nextcloud3 instance and renaming the relevant bits in the new instance.
I ran the two instances until I was happy that the new instance worked and then disabled (Apached) the nextcloud3 instance. I also renamed the nextcloud3 instance and changed the owner to root.

I’m getting the following error and cannot figure out why a cron job is being stared for the non-existent instance (nextcloud3)

Nov 11 07:49:04 mail1 systemd[1]: Started Nextcloud cron.php job.
Nov 11 07:49:04 mail1 systemd[1]: Started Nextcloud cron.php job.
Nov 11 07:49:04 mail1 php[304740]: Could not open input file: /var/www/nextcloud3/cron.php
Nov 11 07:49:04 mail1 systemd[1]: nextcloud3cron.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 07:49:04 mail1 systemd[1]: nextcloud3cron.service: Failed with result 'exit-code'.
Nov 11 07:49:05 mail1 systemd[1]: nextcloud2cron.service: Succeeded.
Nov 11 07:50:01 mail1 CRON[304829]: (www-data) CMD (php -f /var/www/nextcloud2/cron.php)
Nov 11 07:54:15 mail1 systemd[1]: Started Nextcloud cron.php job.
Nov 11 07:54:15 mail1 systemd[1]: Started Nextcloud cron.php job.
Nov 11 07:54:15 mail1 php[304995]: Could not open input file: /var/www/nextcloud3/cron.php
Nov 11 07:54:15 mail1 systemd[1]: nextcloud3cron.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 07:54:15 mail1 systemd[1]: nextcloud3cron.service: Failed with result 'exit-code'.
Nov 11 07:54:16 mail1 systemd[1]: nextcloud2cron.service: Succeeded.

Hi.
I was missing one part from the things you did:
Did you check the Crontab for entries relating to the old instance?

Regards,
Martin

yep, checked www-data crontab

*/7  *  *  *  * php -f /var/www/cloudPics/cron.php
*/5  *  *  *  * php -f /var/www/nextcloud2/cron.php

Maybe the cronjob is in the crontab of the root user? Or maybe you created a systemd timer to execute the cron.php? I mean the error has to to come from somwhere… :wink:

Checked crontab for all users on the server; no mention of nextcloud3.

Somehing starts this, but can’t find what

systemctl status nextcloud3cron
● nextcloud3cron.service - Nextcloud cron.php job
     Loaded: loaded (/etc/systemd/system/nextcloud3cron.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2021-11-13 03:07:13 CET; 29s ago
TriggeredBy: ● nextcloud3cron.timer
    Process: 1404 ExecStart=/usr/bin/php -f /var/www/nextcloud3/cron.php (code=exited, status=1/FAILURE)
   Main PID: 1404 (code=exited, status=1/FAILURE)

Nov 13 03:07:13 mail1 systemd[1]: Started Nextcloud cron.php job.
Nov 13 03:07:13 mail1 php[1404]: Could not open input file: /var/www/nextcloud3/cron.php
Nov 13 03:07:13 mail1 systemd[1]: nextcloud3cron.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 03:07:13 mail1 systemd[1]: nextcloud3cron.service: Failed with result 'exit-code'.

In which case you created a Systemd service file somewhere under /etc/systemd or wherever your distro stores them.
systemctl disable nextcloud3cron

systemsctl disable for both nextcloud3cron and nextcloud3cron.timer worked over a reboot.
I deleted nextcloud3cron.service and nextcloud3cron.timer from /etc/systemd/system/, rebooted and now the service is gone.
Thanks for your help

1 Like