Server: Notification error (not showing for any users) after update to PHP 7.3 and NC. 17.0.3

Created on 15 Feb 2020  Â·  21Comments  Â·  Source: nextcloud/server

After update of the php version from 7.1 to 7.3 and NC 17.0.1 to 17.0.3 the following error occurs when trying to make a notification (even announcements):
[PHP] Error: Undefined index: changelogURL at /var/www/nextcloud/core/Controller/WhatsNewController.php#91

GET /ocs/v2.php/core/whatsnew?format=json
from 41.220.232.230 by 577A26BB-789B-4FB9-8BD1-1C032F960496 at 2020-02-15T18:35:04+00:00

This is a long running instance since version 15 using only stable update channel !
I never had problems with the notifications or any part of the system

Steps to reproduce

  1. Use PHP7.3-fpm, MySQL db, nginx, redis server, APCu and opcache
  2. Update from NC 17.0.1 to 17.0.3
  3. try to post an announcement with notification to users

Expected behaviour

The notification should apear for all/selected users

Actual behaviour

In the logging the PHP error apears

Server configuration

Operating system:
Ubuntu 18.04.3
Web server:
Nginx
Database:
MySQL
PHP version:
7.3
Nextcloud version: (see Nextcloud admin page)
17.0.3
Updated from an older Nextcloud/ownCloud or fresh install:
update
Where did you install Nextcloud from:

Signing status:


Signing status
No errors have been found.

List of activated apps:


App list

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:


Config report

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...
yes, local + smb

Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Samba AD (Zentyal 6) + NC user backend

0. Needs triage bug

Most helpful comment

It's included in the upcoming maintenance release.

All 21 comments

cc @blizzz

Same here, on PHP 7.2.24, updating from 16.0.8 to 17.0.3.

The error already happened when upgrading from 16.0.7 to 16.0.8.

Same for me. This started to happen after my upgrade from 17.0.3 to 18.0.1:

[PHP] Error: Undefined index: changelogURL at /srv/www/htdocs/nextcloud/core/Controller/WhatsNewController.php#91

GET /ocs/v2.php/core/whatsnew?format=json
from IP by user at 2020-02-14T13:03:41+00:00

Using also php 7.3 and similar setup.

After some checking the code I found a "partial" solution for the issue, at least for the error message:
add a column in the table "whats_new" (oc_whats_new) named "changelogURL", type varchar(), size i left 255 but i think can be lower with NO NULL and a default value.
The idea is from the OCUpdater namespace in the files ChangesMapper and ChangesCheck ('nextcloud-install-folderlibprivateUpdater') you can see that it tries reading and writing from that column and returns or inserts the result in the database. By default that column does not exist so when the controller checks the response, that field does not exist in the response object.

@kesselb This resolution has to be confirmed by the Nextcloud Team contributors !!

Sadly my main problem is still there, no notification and no activity after posting an announcement :( .. but I think this is an issue for the announcementcenter module or the notification component. Again, if someone from the Nextcloud contributers can confirm this.

Thanks

P.S. other notifications work, ex: calendar

Hi!
Just for the record: same issue here on PHP 7.3 after upgrading from 17.0.2 to 17.0.3.

https://github.com/nextcloud/server/blob/cb81fd52578d662164b32b7b8b89b4e6efd9fa9c/core/src/OCP/whatsnew.js#L97 has already a check if the changelogURL is present or not.

https://github.com/nextcloud/server/blob/cb81fd52578d662164b32b7b8b89b4e6efd9fa9c/core/Controller/WhatsNewController.php#L90-L94
probably easier to change the above code like

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

@kesselb Your answer is much appreciated, thank you. Will modify the controller accordingly; will the changelogURL field be eliminated in the future ? Asking out of curiosity since it's missing in the database.

Regarding my issue from the announcement app, you have any suggestion ?

@cclmed you closed this issue because? ;)

Sorry, that was not my intention. :) .. I wanted to copy the link on the phone app.

Hei,

is this issue solved?
I get the same error:
[PHP] Error: Undefined index: changelogURL at /var/www/html/nextcloud/core/Controller/WhatsNewController.php#91

GET /ocs/v2.php/core/whatsnew?format=json
from IP by user at 2020-02-19T21:27:17+01:00

Nextcloud 18.0.1
Fedora 31 Server Edition
PHP-FPM 7.3.14
Apache 2.4.41
MariaDB 10.3.21

I'm seeing this issue too > Undefined index: changelogURL at /usr/local/www/nextcloud/core/Controller/WhatsNewController.php#91

Nextcloud 18.0.1
FreeBSD 11.3 (FreeNAS Jail)
PHP-FPM 7.4.2
NGINX 1.16.1_11
MariaDB 10.2.31

19465 but this is not the same issue, is it?

https://github.com/nextcloud/server/blob/cb81fd52578d662164b32b7b8b89b4e6efd9fa9c/core/src/OCP/whatsnew.js#L97
has already a check if the changelogURL is present or not.

https://github.com/nextcloud/server/blob/cb81fd52578d662164b32b7b8b89b4e6efd9fa9c/core/Controller/WhatsNewController.php#L90-L94

probably easier to change the above code like

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

When I try this code I get:
[PHP] Error: ParseError: syntax error, unexpected 'catch' (T_CATCH) at /path/on/server/nextcloud/core/Controller/WhatsNewController.php#105

19465 but this is not the same issue, is it?

You are seeing a symptom of it.

@Wotisrv the patch changes only lib/private/Updater/ChangesCheck.php, not the server/core/Controller/WhatsNewController.php

I am getting the same error logs using the docker image "nextcloud:production-fpm" it is currently version 16.0.8 of nextcloud

Seems like #19465 fixes this issue indeed.

Sorry but I do not understand right. Do I have to fix by myself or will a patch be delivered?

It's included in the upcoming maintenance release.

I have a NC 18.0.2 running on NCP, but I still don't see the changes in _server/core/Controller/WhatsNewController.php_ made by #19465. Is it just me or am I missing something?

Thank you for your help in advance.

That PR didn't change the controller. But the fix is in 18.0.2: https://github.com/nextcloud/server/blob/v18.0.2/lib/private/Updater/ChangesCheck.php#L58-L61

Was this page helpful?
0 / 5 - 0 ratings