Log error Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91

Since I upgraded to NC17.0.3 I get many errors like this in the log.
What does it mean? Can I do something?
NC17.0.3, Ubuntu 18.0.4, nginx

{“reqId”:“DyMla2zQDpddvXfSeX6d”,“level”:3,“time”:“2020-02-29T21:59:15+01:00”,“remoteAddr”:“1XX.1X.9X.4X”,“user”:“usersnamn”,“app”:“PHP”,“method”:“GET”,“url”:"/ocs/v2.php/core/whatsnew?format=json",“message”:“Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0”,“version”:“17.0.3.1”,“id”:“5e5b94a541bf8”}

I have a very similar error.
NC 18.0.1, Ubuntu 18.0.4, apache

I have the same error.
NC 18.0.1.3
Ubuntu 18.0.4,
Apache 2
running Nextcloud as an VM by hanssonit.se

{“reqId”:“Xl0-qabXVJH-vfKdAluszQAAAG8”,“level”:3,“time”:“2020-03-02T18:17:30+01:00”,“remoteAddr”:"{censored}",“user”:"{censored}",“app”:“PHP”,“method”:“GET”,“url”:"/ocs/v2.php/core/whatsnew?format=json",“message”:“Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0”,“version”:“18.0.1.3”,“id”:“5e5d429e84ea9”}

mee too

Undefined index: changelogURL at /var/www/html/nextcloud/core/Controller/WhatsNewController.php#91

NC 18.0.1
Apache2
Debian 10
PHP 7.3

Same error for me :

NC 18.0.1 upgraded from 17.0.3 ( started with OwnCloud 5)
Ubuntu 18.04 standard package :
Apache 2.4
PHP 7.2

Hallo,

change the WhatsNewController.php in nextcloud / core / controller / as this follows.

CHANGE OF:
$resultData = [
‘changelogURL’ => $whatsNew[‘changelogURL’],
‘product’ => $this->defaults->getName(),
‘version’ => $currentVersion,
];

CHANGE IN:
$resultData = [
‘product’ => $this->defaults->getName(),
‘version’ => $currentVersion,
];
if (isset($whatsNew[‘changelogURL’])) {
$resultData[‘changelogURL’] = $whatsNew[‘changelogURL’];
}

Best regards.
Enis.

2 Likes

Hey!
Can you please elaborate what that does in practice?

Big thanks in advance!
//Benis

Ok. first bug fixed. The next error is
/apps/workflowengine/lib/Helper/LogContext.php#55

Go now to https://github.com/nextcloud/server/commit/41fd0aaa264cde537aff20f951bf75eaf23d36c0

Good luck

Before that, the php file tried to evaluate a ‘zero’, of course this is not possible. Zero is not defined. If (isset ()) checks whether changelogURL is not ‘zero’ and if this is true it writes the result to the log.

1 Like

Is this a bug that should be reported at Github?

I got a new error messages after applying this change:

Use of undefined constant ‘changelogURL’ - assumed ‘‘changelogURL’’ (this will throw an Error in a future version of PHP) at /var/www/html/core/Controller/WhatsNewController.php#94

Use of undefined constant ‘version’ - assumed ‘‘version’’ (this will throw an Error in a future version of PHP) at /var/www/html/core/Controller/WhatsNewController.php#92

Use of undefined constant ‘product’ - assumed ‘‘product’’ (this will throw an Error in a future version of PHP) at /var/www/html/core/Controller/WhatsNewController.php#91

Update: I change ’ to " and didn’t get the error message when restarted the docker container. Maybe the solution? (My knowledge of PHP is like 1 on a scale 1-100)

That was probably due to the formatting of the text in the code box from @enis45 . For anyone else having the issue benis had, here the copy&paste friendly version:

CHANGE OF:

$resultData = [
'changelogURL' => $whatsNew['changelogURL'],
'product' => $this->defaults->getName(),
'version' => $currentVersion,
];

CHANGE IN:

$resultData = [
'product' => $this->defaults->getName(),
'version' => $currentVersion,
];
if (isset($whatsNew['changelogURL'])) {
$resultData['changelogURL'] = $whatsNew['changelogURL'];
}

EDIT: It seems that people already made the developers aware of this on Github (https://github.com/nextcloud/server/issues/19490) and that it will be fixed with the next update. For the time being the above code fixes it temporary.

Still complaining about ’ instead of ". With " it seems to work tho.

In that case it seems to be a problem with the editor you are using. I tried it with Atom, Notepad++ and the internal editor of WinSCP and it works.

You can however also swap ' with " if that’s working better for you.

Interesting, I am using nano.

Indeed, since nano and vim is working for me as well. Ah well, if double quotes is working for you and/or others, you can use double quotes as well.

I was just worried that it would “mean” something else with " instead of ’ (my PHP knowledge is extremely low).

No worries :+1:t3: The difference between single and double quotes is actually pretty slim. One just needs to be careful of the case when to use them.