Error 500 after setting up background jobs

Nextcloud version 18.0.4
Operating system and version Ubuntu 18.04
Apache or nginx version Apache 2.4.29
PHP version 7.3

The issue you are facing:
I tried to set up background jobs with cron using official documentation and after that I have Error 500 without error logs. I tried to reinstall nextcloud but still have 500…

Is this the first time you’ve seen this error? Y

Steps to replicate it:

  1. Install latest nextcloud server
  2. Set up cron
  3. Restart apache

The output of your Nextcloud log in data/directory > nextcloud.log:

{"reqId":"XsjZMlfOJgFBpl4habRfzAAAAAM","level":3,"time":"2020-05-23T08:05:06+00:00","remoteAddr":"78.30.245.17","user":"--","app":"index","method":"GET","url":"/drive/","message":{"Exception":"Error","Message":"Call to undefined function OC\\App\\simplexml_load_file()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":511,"function":"parse","class":"OC\\App\\InfoParser","type":"->","args":["/var/www/nextcloud/apps/files/appinfo/info.xml"]},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":558,"function":"getAppInfo","class":"OC\\App\\AppManager","type":"->","args":["files",false,null]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":67,"function":"getAppInfo","class":"OC_App","type":"::","args":["files"]},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":241,"function":"buildAppNamespace","class":"OC\\AppFramework\\App","type":"::","args":["files"]},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":120,"function":"registerAutoloading","class":"OC_App","type":"::","args":["files","/var/www/nextcloud/apps/files"]},{"file":"/var/www/nextcloud/lib/base.php","line":645,"function":"loadApps","class":"OC_App","type":"::","args":[["session"]]},{"file":"/var/www/nextcloud/lib/base.php","line":1089,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/nextcloud/index.php","line":36,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/App/InfoParser.php","Line":65,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36","version":"18.0.4.2"}
{"reqId":"XsjZMlfOJgFBpl4habRfzAAAAAM","level":3,"time":"2020-05-23T08:05:06+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36","version":"18.0.4.2"}
{"reqId":"XsjZUB1drTVVqnRgdFBbXQAAAAE","level":3,"time":"2020-05-23T08:05:36+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjZcKNi2DVMzB@fw@C5KwAAAAU","level":3,"time":"2020-05-23T08:06:08+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjZkCdJrCynUcCzv8W-BQAAAAY","level":3,"time":"2020-05-23T08:06:40+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjZsFfOJgFBpl4habRfzQAAAAM","level":3,"time":"2020-05-23T08:07:12+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjZ0OOF21A8SQLLUKlN0wAAAAc","level":3,"time":"2020-05-23T08:07:44+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjZ8JCOqos07xcMFt73IAAAAAg","level":3,"time":"2020-05-23T08:08:16+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjaEEYUF8Vl8rKvh1eSFgAAAAA","level":3,"time":"2020-05-23T08:08:48+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjaMEhuf91wHjZlyElXVgAAAAI","level":3,"time":"2020-05-23T08:09:20+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}
{"reqId":"XsjaUHqLnqEctalaoqraTgAAAAQ","level":3,"time":"2020-05-23T08:09:52+00:00","remoteAddr":"78.30.245.17","user":"--","app":"PHP","method":"GET","url":"/drive/status.php","message":"Error: Call to undefined function OC\\App\\simplexml_load_file() at /var/www/nextcloud/lib/private/App/InfoParser.php#65","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.4git (Nextcloud)","version":"18.0.4.2"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    2 => '***',
  ),
  'datadirectory' => '/cloud/data',
  'dbtype' => 'sqlite3',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'installed' => true,
  'instanceid' => '***',
  'mail_from_address' => 'info',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '***',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',
  'mail_smtphost' => 'smtp.mail.ru',
  'mail_smtpport' => '465',
  'memcache.local' => '\OC\Memcache\APCu',
  'logfile' => '/var/www/nextcloud/nextcloud.log',                                                                                                                                              
  'debug' => 'true',
);

The output of your Apache/nginx/system log in /var/log/____:

[Sat May 23 06:25:03.077471 2020] [mpm_prefork:notice] [pid 5149] AH00163: Apache/2.4.29 (Ubuntu) SVN/1.9.7 OpenSSL/1.1.1g mod_wsgi/4.5.17 Python/3.6 configured -- resuming normal operations
[Sat May 23 06:25:03.077530 2020] [core:notice] [pid 5149] AH00094: Command line: '/usr/sbin/apache2'
Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=False debug=False>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/base_events.py", line 526, in __del__
NameError: name 'ResourceWarning' is not defined
[Sat May 23 08:05:00.483341 2020] [mpm_prefork:notice] [pid 5149] AH00169: caught SIGTERM, shutting down
[Sat May 23 08:05:00.675263 2020] [:notice] [pid 17864] ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/) configured.
[Sat May 23 08:05:00.675293 2020] [:notice] [pid 17864] ModSecurity: APR compiled version="1.6.2"; loaded version="1.6.3"
[Sat May 23 08:05:00.675300 2020] [:warn] [pid 17864] ModSecurity: Loaded APR do not match with compiled!
[Sat May 23 08:05:00.675307 2020] [:notice] [pid 17864] ModSecurity: PCRE compiled version="8.39 "; loaded version="8.43 2019-02-23"
[Sat May 23 08:05:00.675314 2020] [:warn] [pid 17864] ModSecurity: Loaded PCRE do not match with compiled!
[Sat May 23 08:05:00.675319 2020] [:notice] [pid 17864] ModSecurity: LUA compiled version="Lua 5.1"
[Sat May 23 08:05:00.675325 2020] [:notice] [pid 17864] ModSecurity: YAJL compiled version="2.1.0"
[Sat May 23 08:05:00.675331 2020] [:notice] [pid 17864] ModSecurity: LIBXML compiled version="2.9.4"
[Sat May 23 08:05:00.675336 2020] [:notice] [pid 17864] ModSecurity: Status engine is currently disabled, enable it by set SecStatusEngine to On.
[Sat May 23 08:05:00.682126 2020] [so:warn] [pid 17864] AH01574: module dav_module is already loaded, skipping
[Sat May 23 08:05:00.685897 2020] [so:warn] [pid 17864] AH01574: module php7_module is already loaded, skipping
[Sat May 23 08:05:00.835034 2020] [mpm_prefork:notice] [pid 17885] AH00163: Apache/2.4.29 (Ubuntu) SVN/1.9.7 OpenSSL/1.1.1g mod_wsgi/4.5.17 Python/3.6 configured -- resuming normal operations
[Sat May 23 08:05:00.835077 2020] [core:notice] [pid 17885] AH00094: Command line: '/usr/sbin/apache2'

Output of apache *.conf

Alias /drive "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>

Hello @RATStudio,

Please, can we get crontab -u www-data -l back ?
Thank you.

[snip] */5 * * * * php -f /var/www/nextcloud/cron.php

Problem was in apache2 mod php7.2
To resolve it:
a2dismod php7.2
It works if you use php version 7.3 to install and set up Nextcloud.
Hope it will help to someone :blush: