After upgrade to Nextcloud 14.0.1, cron job still running PHP 5.6

My (subscription) Neth 7.5 box notified me of a number of available updates this morning, including Nextcloud 14.0.1. With a little bit of hesitation (given a few topics showing problems with Nextcloud after updating), I took a snapshot of my VPS, then installed them. Rebooted (since a new kernel was installed), and everything looked good. Nextcloud clients were connecting, web GUI worked, etc. Great.

After a while, I checked my email, and admin has a bunch of messages from Cron Daemon with a subject of “Cron apache@neth /opt/rh/rh-php56/root/usr/bin/php -f /usr/share/nextcloud/cron.php”, with the following body text:

Installed RPMs are nextcloud-14.0.1-1 and nethserver-nextcloud-1.2.6-1. Rather than having the cronjob in /etc/cron.d, as I’d have expected (because you then have a file that can be associated with a particular version of a particular RPM), it’s directly in apache’s crontab (crontab -u apache -l shows it), and yes, it’s calling php 5.6.

I can fix it easily enough by running crontab -u apache -e and editing the command line to call PHP 7.1 instead of 5.6, but this sounds like something the RPM should have taken care of.

1 Like

I’m not sure the cron job comes from a package. Could it be a custom config? I have the same but with php71 but IIRC I put it there.

I don’t have any memory of manually configuring it, and I’d think the nethserver-nextcloud RPM should set up the cron job. If it isn’t done here, how else?

lets ask @alep , he shall know better.

Yes, hopefully so. I’ve been browsing the nethserver-nextcloud repo, and now I’m a little confused, as I don’t see where the cron job is configured at all. It’s generated somewhere (isn’t it?), but no luck finding it.

The cron job is part of upstream nextcloud package:

rpm -qf /usr/share/nextcloud/cron.php

Nextcloud can use different cron job configuration:
The default one works out of the box.

As alternative, you can try to setup the systemd procedure described in the above doc.

Edit: this is not related to Nextcloud 14.0.1, the same behavior is present since oldest releases.

That’s the file called by the cron job, which of course is part of Nextcloud. The job itself is part of the apache user’s crontab, and it’s that job that determines which version of PHP will be used. What isn’t clear is how it got there, though evidence is mounting that I did it myself at some point in the past, and have since forgotten about it–I logged into another Neth instance of mine with Nextcloud, and it’s set to the AJAX method.

Seems the system should be using the cron method–perhaps a PR is in order. Edit: created.

1 Like

I think the cron job in /etc/cron.d/nextcloud is missing the (apache) user field.

1 Like

Thanks, fixed.

1 Like

I just did the review, but I would like the opinion of @Stll0 and @davidep on this, since they have far more experience on PHP than me.

Excellent work @danb35!

The new release 14.0.2 includes the cron configuration, and it’s ready for testing!

1 Like

Ehi, 14.0.3 is already out from upstream!

And we are ready for testing it!
Please try it and report :wink:

1 Like

I’ve tested the update with local LDAP and the clean installation with LDAP and AD and they work correctly.

1 Like

That’s an amazing news. We’re always on top of that