Server: CalDavBackend.php: Trying to access array offset on value of type bool

Created on 2 May 2020  路  12Comments  路  Source: nextcloud/server

How to use GitHub

  • Please use the 馃憤 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Create a calendar
  2. Add the Nextcloud account to Gnome

Expected behaviour

No errors in the log file

Actual behaviour

Trying to access array offset on value of type bool at /var/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php#1323
Refers to this line in the master branch:
https://github.com/nextcloud/server/blob/8910a1ffcba8d78831a238d170700e8ace3e0979/apps/dav/lib/CalDAV/CalDavBackend.php#L1320

Server configuration

Operating system: CentOS 8

Web server: Nginx

Database: PostgreSQL

PHP version: 7.4

Nextcloud version: 18.0.4.2

Updated from an older Nextcloud/ownCloud or fresh install: Updated from previous minor version

Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/latest.tar.bz2

Signing status: No errors have been found.

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Logs


Nextcloud log

{"reqId":"XXX","level":3,"time":"XXX","remoteAddr":"XXX","user":"admin","app":"PHP","method":"REPORT","url":"/remote.php/caldav/calendars/admin/XXX/","message":"Trying to access array offset on value of type bool at /var/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php#1323","userAgent":"Evolution/3.34.4","version":"18.0.4.2"}

0. Needs triage bug

Most helpful comment

Please use the Github Reactions feature instead of commenting +1, 馃憤 etc. These kinds of comments just unnecessarily notify everyone subscribed to this issue. Thx! :)

All 12 comments

cc @nextcloud/calendar :bug:

Same here:
Trying to access array offset on value of type bool at /var/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php#1323

Have upgraded 18.0.3.x to 18.0.4.2 and using now php7.4-fpm
Since changing the php version logfiles flooded with errors e.g. above

Also see:
https://help.nextcloud.com/t/trying-to-access-array-offset-on-value-of-type-bool-at-var-www-nextcloud-apps-dav-lib-caldav-caldavbackend-php-1323/80193

This issue is still present with NC 19.0.2 and seems to be connected to using PHP 7.4. With earlier versions of PHP this issue did not occur.

I can confirm this for my constellation
NC 19.0.2 in combination with PHP 7.4.9

My error logfile is full of messages like this one, seems to be the same source
Trying to access array offset on value of type bool at /var/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php#1320

I experience this issue in Nextcloud 19.0.2.

Please use the Github Reactions feature instead of commenting +1, 馃憤 etc. These kinds of comments just unnecessarily notify everyone subscribed to this issue. Thx! :)

Since update to NC 19.0.3 my error log has been changed.
Now my logfiles are flooded with this modified failures:

Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheJail.php#98

Does this belong to the same source concerning the error messages? Seems so...

The same error in the logs:

Trying to access array offset on value of type null at /home/nlpgkdfv/public_html/apps/dav/lib/CalDAV/BirthdayService.php#299

Nextcloud 19.0.3
Operating System: | Linux 3.10.0-962.3.2.lve1.5.38.el7.x86_64 x86_64
PHP Version: 7.4.9

I think I found the culprit of this. Some CalDav clients (such as Evolution/GNOME Contacts) seem to send time-range: false instead of not adding it at all if no time range is defined:

{
    "id":"13",
    "filters":
    {
        "name":"VCALENDAR",
        "is-not-defined":false,
        "comp-filters":
        [{
            "name":"VEVENT",
            "is-not-defined":false,
            "comp-filters":[],
            "prop-filters":[],
            "time-range":false
        }],
        "prop-filters":[],
        "time-range":false
    },
    "calendarType":0,
    "componentType":"VEVENT",
    "requirePostFilter":false,
    "timeRange":false
}

with "userAgent":"Evolution/3.36.4".

The fix should be to also check if time-range is an array before using it. See #23497

Some CalDav clients (such as Evolution/GNOME Contacts) seem to send time-range: false instead of not adding it at all if no time range is defined.

CalDAV/CardDAV/WebDAV are XML based. How is the notion of false expressed by that clients in XML?

Thanks @dilyanpalauzov :+1:

The "issue" is indeed the xml deserialization: https://github.com/nextcloud/3rdparty/blob/b0afba6d6508a1c85332cf8c61e90ad91b289ebc/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php

Default for no time-range is false.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blackcrack picture blackcrack  路  3Comments

mama21mama picture mama21mama  路  3Comments

brylie picture brylie  路  3Comments

ThomasLeister picture ThomasLeister  路  3Comments

rullzer picture rullzer  路  3Comments