Closed dvino closed 2 years ago
Exactly same problem, upgrade NC to 19 and also PHP to 7.4.6
Same problem here
Same problem for me
An solution approach:
I copied a log line from my nextcloud.log file and made some tests in interactive PHP shell.
My decoded log line returned always NULL
and produced an JSON_ERROR_SYNTAX
message.
The reason are the double backslashes in some log entries.
dev@dev-tux:~$ php -a
Interactive mode enabled
php > $logLine='{"reqId":"PItQPEON8tyXiPLICJbQ","level":1,"time":"2020-08-27T07:14:12+00:00","remoteAddr":"10.0.2.15","user":"--","app":"updater","method":"GET","url":"/core/ajax/update.php?requesttoken=os7AxDkzf7DXkZFLXbECjrQ41qVzxzIbEVR3t3w5eBA%3D%3A8r24qml%2BVMe2qfAjb%2F1s%2Bptzn8ogq3doSGcN8hpQMFI%3D","message":"\\OC\\Repair::info: Repair info: No need to remove link shares.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0","version":"19.0.2.0"}';
php > $entry=json_decode($logLine,true);
php > if(json_last_error()){var_dump($entry);echo json_last_error_msg().' ('.json_last_error().')' ;}else{var_dump($entry);}
php shell code:1:
NULL
Syntax error (4)
I had to escape the double backslashes to get a valid decode-able JSON string.
php > $logLine='{"reqId":"PItQPEON8tyXiPLICJbQ","level":1,"time":"2020-08-27T07:14:12+00:00","remoteAddr":"10.0.2.15","user":"--","app":"updater","method":"GET","url":"/core/ajax/update.php?requesttoken=os7AxDkzf7DXkZFLXbECjrQ41qVzxzIbEVR3t3w5eBA%3D%3A8r24qml%2BVMe2qfAjb%2F1s%2Bptzn8ogq3doSGcN8hpQMFI%3D","message":"\\OC\\Repair::info: Repair info: No need to remove link shares.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0","version":"19.0.2.0"}';
php > $logLine=str_replace('\\', '\\\\', $logLine);
php > $entry=json_decode($logLine,true);
php > if(json_last_error()){var_dump($entry);echo json_last_error_msg().' ('.json_last_error().')' ;}else{var_dump($entry);}
php shell code:1:
array(11) {
'reqId' =>
string(20) "PItQPEON8tyXiPLICJbQ"
'level' =>
int(1)
'time' =>
string(25) "2020-08-27T07:14:12+00:00"
'remoteAddr' =>
string(9) "10.0.2.15"
'user' =>
string(2) "--"
'app' =>
string(7) "updater"
'method' =>
string(3) "GET"
'url' =>
string(136) "/core/ajax/update.php?requesttoken=os7AxDkzf7DXkZFLXbECjrQ41qVzxzIbEVR3t3w5eBA%3D%3A8r24qml%2BVMe2qfAjb%2F1s%2Bptzn8ogq3doSGcN8hpQMFI%3D"
'message' =>
string(61) "\OC\Repair::info: Repair info: No need to remove link shares."
'userAgent' =>
string(76) "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0"
'version' =>
string(8) "19.0.2.0"
}
Should be fixed with https://github.com/nextcloud/logreader/pull/631 :)
Steps to reproduce
Use NC 18.0-18.04, 19.0
Actual behaviour
log: [PHP] Error: Trying to access array offset on value of type null at /var/www/nextcloud/apps/logreader/lib/Log/LogIterator.php#78
GET /apps/logreader/get?offset=0&count=50&levels=00111
Server configuration
Operating system: Linux 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64
Web server: nginx/1.18.0 (fpm-fcgi)
Database: pgsql PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
PHP version: 7.4.6
Nextcloud version: (see Nextcloud admin page) 19.0.0 - 19.0.0.12
Where did you install Nextcloud from: 18 was clear install 19 was updated from 18
List of activated apps:
Nextcloud configuration:
Client configuration
latest Chrome and firefox
Operating system: Windows, Ubuntu
Logs
Nextcloud log (data/owncloud.log)