nextcloud / logreader

📜 Log reader for Nextcloud
57 stars 27 forks source link

[Bug]: LogController fails to poll after some update #1330

Closed shaaati closed 2 months ago

shaaati commented 3 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

When browing the log via /admin/logging, log entries seem to load correctly. However, after a few seconds a popup message is shown stating "Neue Einträge konnten nicht abgerufen werden." (could not fetch new entries). The log file shows multiple messages that look like this:

{"reqId":"gcFB6Yzf34GnQbf03qYj","level":3,"time":"2024-05-22T23:57:10+02:00","remoteAddr":"REDACTED","user":"nc-admin","app":"index","method":"GET","url":"/apps/logreader/api/poll?lastReqId=MIrK0trXG79ncKvZuYKc","message":"OCA\\LogReader\\Controller\\LogController::poll(): Argument nextcloud/server#1 ($lastReqId) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file '/var/www/nextcloud/apps/logreader/lib/Controller/LogController.php' line 102","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0","version":"29.0.0.19","exception":{"Exception":"Exception","Message":"OCA\\LogReader\\Controller\\LogController::poll(): Argument nextcloud/server#1 ($lastReqId) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file '/var/www/nextcloud/apps/logreader/lib/Controller/LogController.php' line 102","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":170,"Previous":{"Exception":"TypeError","Message":"OCA\\LogReader\\Controller\\LogController::poll(): Argument nextcloud/server#1 ($lastReqId) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 232","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"poll","class":"OCA\\LogReader\\Controller\\LogController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/logreader/lib/Controller/LogController.php","Line":102},"message":"OCA\\LogReader\\Controller\\LogController::poll(): Argument nextcloud/server#1 ($lastReqId) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file '/var/www/nextcloud/apps/logreader/lib/Controller/LogController.php' line 102","exception":{},"CustomMessage":"OCA\\LogReader\\Controller\\LogController::poll(): Argument nextcloud/server#1 ($lastReqId) must be of type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file '/var/www/nextcloud/apps/logreader/lib/Controller/LogController.php' line 102"}}

These entries keep popping up as long as I keep the logging webview open.

By analyzing the log file with grep I found that the issue first started on 2023-08-28 (almost a year ago), when I conducted some major updates. Analyzing the "version" tag in the log entries, it seems that I upgraded from 25.0.2.3 to 27.0.2.1 on that day using multiple incremental steps).

They still appear today, after I upgraded to 29.0.4 (so it's not related to some old and unsupported version).

Steps to reproduce

  1. It likely shouldn't be the case on a correctly-working instance, but for me it is just "open /admin/logging" in any webbrowser.

Expected behavior

Load new log entries without any error.

Installation method

None

Nextcloud Server version

29

Operating system

None

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 28 to 29)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

I suppose this is irrelevant, but I can offer further info if requested.

List of activated Apps

I suppose this is irrelevant, but I can offer further info if requested.

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

See above

Additional info

No response

joshtrichards commented 3 months ago

This is likely a configuration problem. Probably related to opcache.save_comments or some other similar local adjustment you've made to your PHP configuration which isn't compatible with Nextcloud. I suggest reviewing the Admin Manual (e.g. https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#comments) and following up at the help forum for assistance - https://help.nextcloud.com

shaaati commented 3 months ago

I checked my php.ini and nginx.conf multiple times and couldn't find any obvious mistake, but as advised I opened a thread on help.nextcloud.com: https://help.nextcloud.com/t/logcontroller-fails-to-poll-after-some-update/200167

Will use the forum for further troubleshooting unless I find something that indicates an actual bug.

shaaati commented 2 months ago

Turns out I had a mistake in my nginx config (/index.php?request_uri instead of /index.php$request_uri).

Closing this as "not a bug, but a user error".