Last cron job execution... Something seems wrong

Nextcloud version: 11.0.2 (stable)
Operating system and version: Ubuntu 16.10
Apache or nginx version: Apache 2.4.18
PHP version: PHP 7.0.15-0ubuntu0.16.10.2 (cli) ( NTS )
Is this the first time you’ve seen this error?: No

Can you reliably replicate it? (If so, please outline steps): Yes

The issue you are facing: I setup cron jobs according to the Cron section under the documention here.

However, I get the error below. I can run it manually, but it’s not showing that it’s running as expected.

Looking at the cron status in my OS, I get the following. I’m still learning Linux, but it looks to be successful.

Cron.php tells me the following:

{"data":{"message":"Backgroundjobs are using system cron!"},"status":"error"}

Also, my logs are filled with the error below that shows up a few times a second… So there’s a ton of these in there.

Error	PHP	preg_match(): Unknown modifier '/' at /var/www/html/drive/lib/private/AppFramework/Http/Request.php#622

What’s causing the issues?


You can also start the cronjob manually from command line:
sudo -u www-data php -f /var/www/nextcloud/cron.php

Perhaps it shows more errors. The current error can be reported directly to the bugtracker at

1 Like

I tried running it manually… I got the following error:

xxxxxxx@7xDRIVE:~$ sudo -u www-data php -f /var/www/drive/cron.php
Could not open input file: /var/www/drive/cron.php

Could it be because my nextcloud installation is installed in the “drive” folder and not “nextcloud”?

The folder name should not be a problem, my nextcloud i.e. runs in /var/www/owncloud because of former owncloud installation.

Did you run the folder permissions script from admin manual to ensure correct permissions for all folders and files?

I went ahead and ran the below commands, but the issue persists.

sudo chown -R www-data:www-data /var/www/html/drive

sudo -u www-data chown -R www-data:www-data /var/www/html/drive

sudo -u www-data chmod -R 0750 /var/www/html/drive

I also noticed now that I ran these commands that when I try to cd to /var/www/html/drive, I get a Permission Denied error, even from my SU account. I think I just broke something.

I reran the manual execution of the cron job, and that didn’t result in an error this time (because I forgot to add the html directory in the path). However, cron.php still says:

{"data":{"message":"Backgroundjobs are using system cron!"},"status":"error"}

Can you see the files and folders as the www-data user?
sudo -u www-data ls -lisa /var/www/html/drive

Do you mount another hard disk at this location? If it is a NTFS partition you have to set the permissions in the mount options (/etc/fstab file.)

I did sudo su and was able to access the drive folder.

root@7xDRIVE:~# sudo -u www-data ls -lisa /var/www/html/drive
total 168
5644380  4 drwxr-x--- 15 www-data www-data  4096 Feb 27 17:11 .
5637589  4 drwxr-xr-x  3 root     root      4096 Feb 12 20:13 ..
7474987  4 drwxr-x--- 29 www-data www-data  4096 Feb 27 17:11 3rdparty
5644425  4 drwxr-x--- 45 www-data www-data  4096 Feb 27 17:18 apps
6560028 12 -rwxr-x---  1 www-data www-data  8868 Feb 27 17:11 AUTHORS
5770934  4 drwxr-x---  2 www-data www-data  4096 Feb 27 17:16 config
6559933  4 -rwxr-x---  1 www-data www-data  3638 Feb 27 17:11 console.php
7344043  4 drwxr-x--- 16 www-data www-data  4096 Feb 27 17:11 core
6560056  8 -rwxr-x---  1 www-data www-data  5353 Feb 27 17:11 cron.php
5644586  4 drwxr-x---  7 www-data www-data  4096 Feb 27 18:13 data
6560055 40 -rwxr-x---  1 www-data www-data 40622 Feb 27 17:11 db_structure.xml
6560031  4 -rwxr-x---  1 www-data www-data  2781 Feb 27 17:11 .htaccess
6560057  4 -rwxr-x---  1 www-data www-data   179 Feb 27 17:11 index.html
6560029  4 -rwxr-x---  1 www-data www-data  2471 Feb 27 17:11 index.php
7603071  4 drwxr-x---  3 www-data www-data  4096 Feb 27 17:11 l10n
7344189  4 drwxr-x---  6 www-data www-data  4096 Feb 27 17:11 lib
6560033  4 -rwxr-x---  1 www-data www-data   283 Feb 27 17:11 occ
7344027  4 drwxr-x---  2 www-data www-data  4096 Feb 27 17:11 ocs
7344188  4 drwxr-x---  2 www-data www-data  4096 Feb 27 17:11 ocs-provider
6560058  4 -rwxr-x---  1 www-data www-data  3184 Feb 27 17:11 public.php
6560034  8 -rwxr-x---  1 www-data www-data  5431 Feb 27 17:11 remote.php
7603073  4 drwxr-x---  4 www-data www-data  4096 Feb 27 17:11 resources
6560032  4 -rwxr-x---  1 www-data www-data    26 Feb 27 17:11 robots.txt
7344028  4 drwxr-x--- 11 www-data www-data  4096 Feb 27 17:11 settings
6560030  4 -rwxr-x---  1 www-data www-data  2110 Feb 27 17:11 status.php
5770937  4 drwxr-x---  4 www-data www-data  4096 Feb 27 17:11 themes
5770931  4 drwxr-x---  2 www-data www-data  4096 Feb 27 17:11 updater
6560054  4 -rwxr-x---  1 www-data www-data   163 Feb 27 17:11 .user.ini
6559936  4 -rwxr-x---  1 www-data www-data   277 Feb 27 17:11 version.php

This is still a problem… However, I have a much larger problem at the moment that started today, out of the blue. I can browse files using the android app, but no files show up in the web gui. No files or folders display. I can’t review logs, as they don’t display. Passman won’t open. The header and sidebar show up fine, but nothing else does. I can go to the admin panel, but nothing really loads there either. When trying to log out, I get the following error: “Access forbidden CSRF check failed”. I was able to log out completely, but that doesn’t look good.

I tried rescanning all of my files, I did a chkdsk on the Hyper-V host that the Ubuntu server is running on, I restarted apache, the server itself, and I disabled most of the apps from the console. I still have the same issue.

Review the logs from ssh’ing into the server, It’s loaded with this garbage, and I don’t see much of anything else.

{"reqId":"LOzkfMamFjXFGs5QuLYk","remoteAddr":"","app":"PHP","message":"preg_match(): Unknown modifier '\/' at \/var\/www\/html\/drive\/lib\/private\/AppFramework\/Http\/Request.php#622","level":3,"time":"2017-03-28T23:54:33+00:00","method":"--","url":"--","user":"--","version":""}
{"reqId":"8rKmfhM7d36FAjjQZIXw","remoteAddr":"","app":"PHP","message":"preg_match(): Unknown modifier '\/' at \/var\/www\/html\/drive\/lib\/private\/AppFramework\/Http\/Request.php#622","level":3,"time":"2017-03-28T23:54:35+00:00","method":"GET","url":"\/drive\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","user":"eptesicus","version":""}
{"reqId":"jjLtN+iORGN\/DEsPmv2n","remoteAddr":"","app":"PHP","message":"preg_match(): Unknown modifier '\/' at \/var\/www\/html\/drive\/lib\/private\/AppFramework\/Http\/Request.php#622","level":3,"time":"2017-03-28T23:54:44+00:00","method":"GET","url":"\/drive\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","user":"eptesicus","version":""}

I’m stuck right now. I can’t get my passwords from Passman. Which, shame on me for trusting this to hold my passwords safely.

Your permissions seem a little off compared to the recommended settings. I would suggest running the script provided on this page and see if that makes a difference.

After trying that easy fix, maybe look at this for other possibilities:

I ran the script as per the link you provided. It looks like it ran successfully.

root@7xDRIVE:/home/eptesicus# ./
Creating possible missing Directories
chmod Files and Directories
chown Directories
chmod/chown .htaccess

I restarted apache, and the logs are still filling up with what I noted above.