Cron.php does not run correctly

Hey there,

I face a problem with cron.php not running correctly after a certain time, where the only solution so far was a server restart.

I run my Nextcloud 11.0.3
on a Raspberry Pi 2
with up to date Raspbian Jessie
on Linux kernel 4.9.24-v7+,
Apache/2.4.25
mod_php 7.0.18-1.

Cronjobs are generally working and configured correctly. Cron service is running without error. Syslog shows cron.php run by www-data user every 15 minutes as expected and also manually running cron.php doesn’t show any error message. Also nextcloud and apache logs do not show any error.
On admin panel Cron is set to “Cron” (system service) but shows:

Last cron job execution: 7 hours ago. Something seems wrong.

Also the ownBackup app did not create any backup, which shows that indeed something went wrong.

It looks like the cron.php does run, but without any content. Is there some way to run cron.php somehow verbose to show what it actually does?
€: Switching to AJAX and reloading the page results in a message that the last cron job was executed seconds ago. But so far the backup by ownBackup is still not created. I just switched back to “Cron” to see if it works now, but I tried that already without success => no cron execution after 15 minutes.
€€: Check, 20 minutes after switching back to “Cron” no execution occurred…

I faced this already several times, now and then after some days, and as said, a server restart was the only solution I found so far.

Can someone help me figuring out the problem? At least a possibility to show what the execution of cron.php actually does would be helpful.

Best regards

Hum, I tried to restart apache, but it ended up with an error:

# service apache2 status
▒ apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
   Active: failed (Result: start-limit) since Wed 2017-05-03 21:46:33 CEST; 7s ago
  Process: 11775 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 11769 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 11774 (code=killed, signal=SEGV)
May 03 21:46:32 my.server.org systemd[1]: Unit apache2.service entered failed state.
May 03 21:46:33 my.server.org systemd[1]: apache2.service holdoff time over, scheduling restart.
May 03 21:46:33 my.server.org systemd[1]: Stopping The Apache HTTP Server...
May 03 21:46:33 my.server.org systemd[1]: Starting The Apache HTTP Server...
May 03 21:46:33 my.server.org systemd[1]: apache2.service start request repeated too quickly, refusing to start.
May 03 21:46:33 my.server.org systemd[1]: Failed to start The Apache HTTP Server.
May 03 21:46:33 my.server.org systemd[1]: Unit apache2.service entered failed state.

Syslog shows several start attempts before giving up:

May  3 21:46:31 <username> systemd[1]: Starting The Apache HTTP Server...
May  3 21:46:31 <username> systemd[1]: Started The Apache HTTP Server.
May  3 21:46:31 <username> systemd[1]: apache2.service: main process exited, code=killed, status=11/SEGV
May  3 21:46:31 <username> apachectl[11760]: httpd (no pid file) not running
May  3 21:46:31 <username> systemd[1]: Unit apache2.service entered failed state.
May  3 21:46:32 <username> systemd[1]: apache2.service holdoff time over, scheduling restart.
May  3 21:46:32 <username> systemd[1]: Stopping The Apache HTTP Server...
May  3 21:46:32 <username> systemd[1]: Starting The Apache HTTP Server...
May  3 21:46:32 <username> systemd[1]: Started The Apache HTTP Server.
May  3 21:46:32 <username> systemd[1]: apache2.service: main process exited, code=killed, status=11/SEGV
May  3 21:46:32 <username> apachectl[11775]: httpd (no pid file) not running
May  3 21:46:32 <username> systemd[1]: Unit apache2.service entered failed state.
May  3 21:46:33 <username> systemd[1]: apache2.service holdoff time over, scheduling restart.
May  3 21:46:33 <username> systemd[1]: Stopping The Apache HTTP Server...
May  3 21:46:33 <username> systemd[1]: Starting The Apache HTTP Server...
May  3 21:46:33 <username> systemd[1]: apache2.service start request repeated too quickly, refusing to start.
May  3 21:46:33 <username> systemd[1]: Failed to start The Apache HTTP Server.
May  3 21:46:33 <username> systemd[1]: Unit apache2.service entered failed state.

With this it looks more like an apache problem than one of nextcloud. Maybe something got stuck, but I have no idea where to start to find out what…

€: daemon.log shows this at first service restart attempt:

May  3 20:39:06 <username> systemd[1]: Starting Clean php session files...
May  3 20:39:06 <username> systemd[1]: Failed to reset devices.list on /system.slice: Invalid argument
May  3 20:39:08 <username> sessionclean[6759]: Segmentation fault

€€: apache error.log shows certain minutes after first restart attempt:

[Wed May 03 21:43:10.098716 2017] [core:notice] [pid 559] AH00052: child pid 3173 exit signal Segmentation fault (11)
[Wed May 03 21:43:10.099393 2017] [mpm_prefork:notice] [pid 559] AH00169: caught SIGTERM, shutting down

€€€: I will leaving it this state for now, maybe it helps to figuring out what is going wrong. Server restart would resolve everything. Needed to do a restart now, everything works as expected. Let’s see when the error reappears…