No logging in Nexcloud

On my Nextcloud 24 without Docker on Ubuntu 22.04, no entries are written to the Linux logs. The Nextcloud doesn’t start after the update to 22.04 and I can’t see where the problem is now. Nothing is written from the Nexcloud in the Appache logs, in the Nextcloudlog, in the systemd log and in the syslog. In /var/www/nextcloud/config/config.php I tried the different log options as described here:
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html
It would be great if someone can help me to enable logging for the Nexcloud.

Nextcloud always “doesn’t start”. If you access the webserver e.g. Apache2 then e.g. PHP from Nextcloud is executed.

Can you post screenshots form acessing the Nextcloud url? Is Apache2 up and running?
Also use browser developer tools (Firefox F12) and there Network Analysis. Are there HTTP-requests?

Thanks for your answer.

Apache is Running

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I want to activate the Nextcloud loging that I can see where is the problem. Do you have a idea how I can activate the logging?

Sometimes you get infos on execute on the command line:
sudo -u www-data php /path/to/nextcloud/index.php

Normally logging is activated for apache2 logs and Nextcloud logs and could/should not disabled. You can increase the Nextcloud loglevel in config/config.php. But i think that does not help.

Please test if partitions are full. Sometimes this leads to funny side effects.
df -h
(you must not post the output)

The Loglevel is 0. There is plenty space on the disk. The apache logs does not show anything regarding my problem.
But good to know that looging could not set to disabled.

Perhaps I have expressed myself incorrectly. It is probably very unlikely that logging was automatically disabled.

Please use web developer tool (Firefox F12) and then network analysis, open the Nextcloud url and post the http-requests.

  1. Request URL:

https://10.0.16.197/

  1. Request Method:

GET

  1. Status Code:

500 Internal Server Error

  1. Remote Address:

10.0.16.197:443

  1. Referrer Policy:

strict-origin-when-cross-origin

  1. Response HeadersView source

  2. Connection:

close

  1. Content-Length:

289

  1. Content-Type:

text/plain; charset=utf-8

  1. Date:

Wed, 17 Aug 2022 11:00:02 GMT

  1. Referrer-Policy:

no-referrer

  1. Server:

Apache

  1. Strict-Transport-Security:

max-age=63072000; includeSubdomains;

  1. X-Content-Type-Options:

nosniff

  1. X-Frame-Options:

SAMEORIGIN

  1. X-Permitted-Cross-Domain-Policies:

none

  1. X-Robots-Tag:

none

  1. X-XSS-Protection:

1; mode=block

  1. Request HeadersView source

  2. Accept:

text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9

  1. Accept-Encoding:

gzip, deflate, br

  1. Accept-Language:

de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7

  1. Cache-Control:

max-age=0

  1. Connection:

keep-alive

  1. Host:

10.0.16.197

  1. sec-ch-ua:

“Chromium”;v=“104”, " Not A;Brand";v=“99”, “Google Chrome”;v=“104”

  1. sec-ch-ua-mobile:

?0

  1. sec-ch-ua-platform:

“Windows”

  1. Sec-Fetch-Dest:

document

  1. Sec-Fetch-Mode:

navigate

  1. Sec-Fetch-Site:

none

  1. Sec-Fetch-User:

?1

  1. Upgrade-Insecure-Requests:

1

  1. User-Agent:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Sorry no real idea. Sometime you get other errors on using php directly in the command line.

Please test:
sudo -u www-data php /var/www/nextcloud/index.php

sudo -u www-data php /var/www/nextcloud/index.php
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

The Nexclaud ran flawlessly with Ubuntu 20.04. After updating to 22.04 it stopped working. So far I have downgraded the PHP version to PHP 7.4.30. That didn’t help. Since then I’ve been trying in vain for the Nexcloud to write something in the log so that I can recognize the problem with the Nextcloud.

Maybe you need some packages. Read this.

I installed the packages but in doesn’t solve the logging problem and not the the Nextcloud starts.
One Package I couldn’t install:
E: Package ‘php-pdo’ has no installation candidate

Keine Ahnung wo die Meldung herkommt.

I think php-pdo is an error in the documentation. Test php8.1-common is installed:
dpkg -l |grep php8.1-common
Install it and the other PHP 8.1 software.

Ubuntu – File list of package php8.1-common/jammy/amd64

Above for PHP 8.1. Please try PHP 8.1 and do not use PHP 7.4.

php8.1-common is allready installed.
I tried with php 7.4 and 8.1.

I guess since i change to syslog (before I tried only with nexcloud log and journalctl log) I have entries in the syslog:

Aug 18 13:50:01 tempnxtcclon Nextcloud[2149]: {“reqId”:“R7FkFJVjtetzeV161rAD”,“level”:3,“time”:“2022-08-18T11:50:01+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“core”,“method”:“”,“url”:“–”,“message”:“{"Exception":"OC\\ServerNotAvailableException","Message":"Connection to LDAP server could not be established","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/user_ldap/lib/Access.php","line":191,"function":"getConnectionResource","class":"OCA\\User_LDAP\\Connection","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":323,"function":"readAttribute","class":"OCA\\User_LDAP\\Access","type":" → "},{"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_LDAP","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":113,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/apps/user_ldap/lib/Proxy.php","line":167,"function":"callOnLastSeenOn","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":211,"function":"handleRequest","class":"OCA\\User_LDAP\\Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":188,"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":177,"function":"userExists","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/activity/lib/MailQueueHandler.php","line":152,"function":"get","class":"OC\\User\\Manager","type":" → "},{"file":"/var/www/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php","line":61,"function":"sendEmails","class":"OCA\\Activity\\MailQueueHandler","type":" → "},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":54,"function":"run","class":"OCA\\Activity\\BackgroundJob\\EmailNotification","type":" → "},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":60,"function":"execute","class":"OC\\BackgroundJob\\Job","type":" → "},{"file":"/var/www/nextcloud/cron.php","line":151,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":" → "}],"File":"/var/www/nextcloud/apps/user_ldap/lib/Connection.php","Line":246,"message":"Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )","CustomMessage":"Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )"}”,“userAgent”:“–”,“version”:“24.0.4.1”}
Aug 18 13:50:05 tempnxtcclon Nextcloud[2149]: {“reqId”:“R7FkFJVjtetzeV161rAD”,“level”:3,“time”:“2022-08-18T11:50:05+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“user_ldap”,“method”:“”,“url”:“–”,“message”:“No LDAP Connection to server 10.0.16.55”,“userAgent”:“–”,“version”:“24.0.4.1”,“data”:{“app”:“user_ldap”}}
Aug 18 13:50:05 tempnxtcclon Nextcloud[2149]: {“reqId”:“R7FkFJVjtetzeV161rAD”,“level”:3,“time”:“2022-08-18T11:50:05+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“core”,“method”:“”,“url”:“–”,“message”:“{"Exception":"OC\\ServerNotAvailableException","Message":"Connection to LDAP server could not be established","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/user_ldap/lib/Access.php","line":191,"function":"getConnectionResource","class":"OCA\\User_LDAP\\Connection","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":323,"function":"readAttribute","class":"OCA\\User_LDAP\\Access","type":" → "},{"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_LDAP","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":113,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/apps/user_ldap/lib/Proxy.php","line":167,"function":"callOnLastSeenOn","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":211,"function":"handleRequest","class":"OCA\\User_LDAP\\Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":188,"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":177,"function":"userExists","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/MailNotifications.php","line":240,"function":"get","class":"OC\\User\\Manager","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/MailNotifications.php","line":211,"function":"prepareEmailMessage","class":"OCA\\Notifications\\MailNotifications","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/MailNotifications.php","line":166,"function":"sendEmailToUser","class":"OCA\\Notifications\\MailNotifications","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/BackgroundJob/SendNotificationMails.php","line":49,"function":"sendEmails","class":"OCA\\Notifications\\MailNotifications","type":" → "},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\Notifications\\BackgroundJob\\SendNotificationMails","type":" → "},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":95,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":" → "},{"file":"/var/www/nextcloud/cron.php","line":151,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":" → "}],"File":"/var/www/nextcloud/apps/user_ldap/lib/Connection.php","Line":246,"message":"Error while running background job (class: OCA\\Notifications\\BackgroundJob\\SendNotificationMails, arguments: )","CustomMessage":"Error while running background job (class: OCA\\Notifications\\BackgroundJob\\SendNotificationMails, arguments: )"}”,“userAgent”:“–”,“version”:“24.0.4.1”}
Aug 18 13:55:01 tempnxtcclon CRON[2156]: (www-data) CMD (php -f /var/www/nextcloud/cron.php --define apc.enable_cli=1)
Aug 18 13:55:01 tempnxtcclon CRON[2157]: (root) CMD (cd /usr/lib/nagios/plugins && git pull origin master > /dev/null 2>&1)
Aug 18 13:55:01 tempnxtcclon Nextcloud[2158]: {“reqId”:“QlTNNfEgxqFJQx17rfAD”,“level”:3,“time”:“2022-08-18T11:55:01+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“user_ldap”,“method”:“”,“url”:“–”,“message”:“function ldap_connect is not available. Make sure that the PHP ldap module is installed.”,“userAgent”:“–”,“version”:“24.0.4.1”,“data”:{“app”:“user_ldap”}}
Aug 18 13:55:01 tempnxtcclon Nextcloud[2158]: {“reqId”:“QlTNNfEgxqFJQx17rfAD”,“level”:3,“time”:“2022-08-18T11:55:01+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“user_ldap”,“method”:“”,“url”:“–”,“message”:“No LDAP Connection to server 10.0.16.55”,“userAgent”:“–”,“version”:“24.0.4.1”,“data”:{“app”:“user_ldap”}}
Aug 18 13:55:01 tempnxtcclon Nextcloud[2158]: {“reqId”:“QlTNNfEgxqFJQx17rfAD”,“level”:3,“time”:“2022-08-18T11:55:01+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“core”,“method”:“”,“url”:“–”,“message”:“{"Exception":"OC\\ServerNotAvailableException","Message":"Connection to LDAP server could not be established","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/user_ldap/lib/Access.php","line":191,"function":"getConnectionResource","class":"OCA\\User_LDAP\\Connection","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":323,"function":"readAttribute","class":"OCA\\User_LDAP\\Access","type":" → "},{"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_LDAP","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":113,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/apps/user_ldap/lib/Proxy.php","line":167,"function":"callOnLastSeenOn","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":211,"function":"handleRequest","class":"OCA\\User_LDAP\\Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":188,"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":177,"function":"userExists","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/activity/lib/MailQueueHandler.php","line":152,"function":"get","class":"OC\\User\\Manager","type":" → "},{"file":"/var/www/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php","line":61,"function":"sendEmails","class":"OCA\\Activity\\MailQueueHandler","type":" → "},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":54,"function":"run","class":"OCA\\Activity\\BackgroundJob\\EmailNotification","type":" → "},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":60,"function":"execute","class":"OC\\BackgroundJob\\Job","type":" → "},{"file":"/var/www/nextcloud/cron.php","line":151,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":" → "}],"File":"/var/www/nextcloud/apps/user_ldap/lib/Connection.php","Line":246,"message":"Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )","CustomMessage":"Error while running background job (class: OCA\\Activity\\BackgroundJob\\EmailNotification, arguments: )"}”,“userAgent”:“–”,“version”:“24.0.4.1”}
Aug 18 13:55:05 tempnxtcclon Nextcloud[2158]: {“reqId”:“QlTNNfEgxqFJQx17rfAD”,“level”:3,“time”:“2022-08-18T11:55:05+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“user_ldap”,“method”:“”,“url”:“–”,“message”:“No LDAP Connection to server 10.0.16.55”,“userAgent”:“–”,“version”:“24.0.4.1”,“data”:{“app”:“user_ldap”}}
Aug 18 13:55:05 tempnxtcclon Nextcloud[2158]: {“reqId”:“QlTNNfEgxqFJQx17rfAD”,“level”:3,“time”:“2022-08-18T11:55:05+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“core”,“method”:“”,“url”:“–”,“message”:“{"Exception":"OC\\ServerNotAvailableException","Message":"Connection to LDAP server could not be established","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/user_ldap/lib/Access.php","line":191,"function":"getConnectionResource","class":"OCA\\User_LDAP\\Connection","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":323,"function":"readAttribute","class":"OCA\\User_LDAP\\Access","type":" → "},{"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_LDAP","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":113,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/apps/user_ldap/lib/Proxy.php","line":167,"function":"callOnLastSeenOn","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":211,"function":"handleRequest","class":"OCA\\User_LDAP\\Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":188,"function":"userExistsOnLDAP","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":177,"function":"userExists","class":"OCA\\User_LDAP\\User_Proxy","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/MailNotifications.php","line":240,"function":"get","class":"OC\\User\\Manager","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/MailNotifications.php","line":211,"function":"prepareEmailMessage","class":"OCA\\Notifications\\MailNotifications","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/MailNotifications.php","line":166,"function":"sendEmailToUser","class":"OCA\\Notifications\\MailNotifications","type":" → "},{"file":"/var/www/nextcloud/apps/notifications/lib/BackgroundJob/SendNotificationMails.php","line":49,"function":"sendEmails","class":"OCA\\Notifications\\MailNotifications","type":" → "},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\Notifications\\BackgroundJob\\SendNotificationMails","type":" → "},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":95,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":" → "},{"file":"/var/www/nextcloud/cron.php","line":151,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":" → "}],"File":"/var/www/nextcloud/apps/user_ldap/lib/Connection.php","Line":246,"message":"Error while running background job (class: OCA\\Notifications\\BackgroundJob\\SendNotificationMails, arguments: )","CustomMessage":"Error while running background job (class: OCA\\Notifications\\BackgroundJob\\SendNotificationMails, arguments: )"}”,“userAgent”:“–”,“version”:“24.0.4.1”}

But I can’t see here why the Nextcloud doesn’t start at all and nothing is written in the log when I call up the website in the browser.

Thank you for your help.

I will now continue to run the Nextcloud on 20.04. Maybe it will be better to update to 22.04 in the future or the Nexcloud will then be reinstalled.