core icon indicating copy to clipboard operation
core copied to clipboard

Trying to access array offset on value of type bool at CalDavBackend.php#996

Open appsolutionspl opened this issue 2 years ago • 3 comments

Steps to reproduce

  1. Outlook 2019 + CalDav Synchronizer. Also mobile phone Android + DavX two way synchronization enabled.
  2. Create calendar and enable two way integration on both devices. It usually works fine but sometimes starts logging this error every automatic or forced sync.
  3. We believe request fails when Outlook's CalDav start querying time ranges.

Expected behaviour

No error in log at each sync request.

Actual behaviour

Error in log: Trying to access array offset on value of type bool at apps\dav\lib\CalDAV\CalDavBackend.php#996

Our solution

We did additional "isset" check on $timeRange variable (seems it is a boolean sometimes) and issue was gone.

Source CalDavBackend.php#996: if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['prop-filters'] && (!$timeRange['start'] || !$timeRange['end']))

Fixed CalDavBackend.php#996: if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['prop-filters'] && (!isset($timeRange['start']) || !isset($timeRange['end'])))

Server configuration

Operating system: Windows Server 2016

Web server: IIS10

Database: 10.6.4-MariaDB, for Win64 (AMD64)

PHP version: PHP 7.4.27 (cli) (built: Dec 14 2021 19:52:04) ( NTS Visual C++ 2017 x64 ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies

ownCloud version: (see ownCloud admin page) 10.9.1

Updated from an older ownCloud or fresh install: Updated two times before + db upgraded

Where did you install ownCloud from: ZIP package

Signing status (ownCloud 9.0 and above): Signing fails because of our modifications to make ownCloud working on Windows platform. But reported php file with error was untouched. BTW. If you are interested in working Windows version we are open to share it. We are successfully using it since over a year :).

The content of config/config.php: "config": { "dbtype": "mysql", "version": "10.9.1.2", "dbname": "owncloud", "dbhost": "localhost:3306", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "installed": true, "maintenance": false, "loglevel": 3, "log_rotate_size": 10485760, "integrity.check.disabled": true, "filelocking.enabled": true, "memcache.local": "\OC\Memcache\APCu", "memcache.locking": "\OC\Memcache\APCu", }

List of activated apps: Enabled:

  • announcementcenter:
    • Version: 1.2.2
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/announcementcenter
  • calendar:
    • Version: 1.6.4
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps-external/calendar
  • comments:
    • Version: 0.3.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/comments
  • configreport:
    • Version: 0.2.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/configreport
  • contacts:
    • Version: 1.5.5
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps-external/contacts
  • dav:
    • Version: 0.7.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/dav
  • federatedfilesharing:
    • Version: 0.5.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/federatedfilesharing
  • federation:
    • Version: 0.1.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/federation
  • files:
    • Version: 1.5.2
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/files
  • files_external:
    • Version: 0.8.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/files_external
  • files_sharing:
    • Version: 0.14.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/files_sharing
  • files_trashbin:
    • Version: 0.9.1
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/files_trashbin
  • files_versions:
    • Version: 1.3.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/files_versions
  • firstrunwizard:
    • Version: 1.2.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/firstrunwizard
  • market:
    • Version: 0.6.3
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps-external/market
  • notifications:
    • Version: 0.5.4
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/notifications
  • oauth2:
    • Version: 0.5.2
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps-external/oauth2
  • tasks:
    • Version: 0.9.7
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps-external/tasks
  • updatenotification:
    • Version: 0.2.1
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/updatenotification
  • user_ldap:
    • Version: 0.16.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps/user_ldap
  • web:
    • Version: 5.2.0
    • Path: C:/inetpub/www/cloud.app-solutions.pl/apps-external/web

Are you using external storage, if yes which one: no

Are you using encryption: no

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

Client configuration

Browser: N/A

Operating system: Windows 10

Logs

ownCloud log (data/owncloud.log)

{"reqId":"N0UL6cg9u1qhRr4KcRRl","level":3,"time":"2022-02-19T16:46:49+00:00","remoteAddr":"192.168.0.2","user":"xxx","app":"PHP","method":"REPORT","url":"/remote.php/dav/calendars/xxx/calendar/","message":"Trying to access array offset on value of type bool at xxx\apps\dav\lib\CalDAV\CalDavBackend.php#996"}

appsolutionspl avatar Mar 24 '22 21:03 appsolutionspl

because of our modifications to make ownCloud working on Windows platform.

Checked if problem not come by own modifications or unsupported Windows platform? Checked if happening by also using standard ownCloud on Linux?

ho4ho avatar Mar 26 '22 12:03 ho4ho

Unfortunately we don't have working linux instance but we did debug and it is all about Time Range parameter in Outlooks CalDAV plugin. image

If not checked $timeRange variable is false: image

If checked everything works fine: image

Also we are almost sure this issue is unrelated to OS platform. Since adding safer isset check this error has gone from logs. We hope it will help.

appsolutionspl avatar Mar 26 '22 20:03 appsolutionspl

I'm getting the same message in my logs for each calendar synced with the Manjaro Calendar 41.3. I can trigger this by manually running a sync in the Calendar.

I'm running Owncloud 10.9.1 on Debian with PHP 7.4.27. This isn't happening using the Thunderbird Calendar.

EDIT: I tested the workaround from the issue reporter and it's working for me as well. And I forgot to mention that I used Manjaro's Online Accounts feature picking NextCloud to add the calendar to the system as there's no separate CalDAV or Owncloud option. For Thunderbird this isn't used in my case, but it has its own CalDAV implementation as part of the Calendar feature.

example syslog entry May 9 07:30:35 x ownCloud[4907]: [xxx][x.x.x.x][xxx][PHP][REPORT][/owncloud/remote.php/caldav/calendars/xxx/contact_birthdays/] Trying to access array offset on value of type bool at /var/www/owncloud/apps/dav/lib/CalDAV/CalDavBackend.php#996

Enabled Apps:

  • activity:
    • Version: 2.6.1
    • Path: /var/www/owncloud/apps/activity
    • bookmarks:
      • Version: 0.10.6
      • Path: /var/www/owncloud/apps-my/bookmarks
    • calendar:
      • Version: 1.6.4
      • Path: /var/www/owncloud/apps-my/calendar
    • comments:
      • Version: 0.3.0
      • Path: /var/www/owncloud/apps/comments
    • configreport:
      • Version: 0.2.0
      • Path: /var/www/owncloud/apps/configreport
    • contacts:
      • Version: 1.5.5
      • Path: /var/www/owncloud/apps-my/contacts
    • dav:
      • Version: 0.7.0
      • Path: /var/www/owncloud/apps/dav
    • federatedfilesharing:
      • Version: 0.5.0
      • Path: /var/www/owncloud/apps/federatedfilesharing
    • federation:
      • Version: 0.1.0
      • Path: /var/www/owncloud/apps/federation
    • files:
      • Version: 1.5.2
      • Path: /var/www/owncloud/apps/files
    • files_external:
      • Version: 0.8.0
      • Path: /var/www/owncloud/apps/files_external
    • files_mediaviewer:
      • Version: 1.0.5
      • Path: /var/www/owncloud/apps/files_mediaviewer
    • files_pdfviewer:
      • Version: 1.0.1
      • Path: /var/www/owncloud/apps/files_pdfviewer
    • files_sharing:
      • Version: 0.14.0
      • Path: /var/www/owncloud/apps/files_sharing
    • files_texteditor:
      • Version: 2.4.1
      • Path: /var/www/owncloud/apps/files_texteditor
    • files_trashbin:
      • Version: 0.9.1
      • Path: /var/www/owncloud/apps/files_trashbin
    • files_versions:
      • Version: 1.3.0
      • Path: /var/www/owncloud/apps/files_versions
    • firstrunwizard:
      • Version: 1.2.0
      • Path: /var/www/owncloud/apps/firstrunwizard
    • gallery:
      • Version: 16.1.1
      • Path: /var/www/owncloud/apps-my/gallery
    • impersonate:
      • Version: 0.5.0
      • Path: /var/www/owncloud/apps-my/impersonate
    • market:
      • Version: 0.6.2
      • Path: /var/www/owncloud/apps/market
    • notes:
      • Version: 2.3.2
      • Path: /var/www/owncloud/apps-my/notes
    • notifications:
      • Version: 0.5.4
      • Path: /var/www/owncloud/apps/notifications
    • oauth2:
      • Version: 0.5.2
      • Path: /var/www/owncloud/apps/oauth2
    • provisioning_api:
      • Version: 0.5.0
      • Path: /var/www/owncloud/apps/provisioning_api
    • systemtags:
      • Version: 0.3.0
      • Path: /var/www/owncloud/apps/systemtags
    • templateeditor:
      • Version: 0.4.0
      • Path: /var/www/owncloud/apps/templateeditor
    • twofactor_totp:
      • Version: 0.7.2
      • Path: /var/www/owncloud/apps-my/twofactor_totp
    • updatenotification:
      • Version: 0.2.1
      • Path: /var/www/owncloud/apps/updatenotification

CONFIG.PHP 'instanceid' => 'xxx', 'passwordsalt' => 'xxx', 'datadirectory' => '/mnt/data/owncloud/data', 'dbtype' => 'pgsql', 'version' => '10.9.1.2', 'dbname' => 'owncloud', 'dbhost' => 'localhost', 'maintenance' => false, 'dbtableprefix' => 'oc_', 'dbuser' => 'oc_user', 'dbpassword' => 'xxx', 'installed' => true, 'theme' => '', 'forcessl' => false, 'allowZipDownload' => true, 'maxZipInputSize' => 314572800, 'log_type' => 'syslog', 'loglevel' => 2, 'log_authfailip' => true, 'logdateformat' => 'M d H:i:s', 'logtimezone' => 'Europe/Berlin', 'filelocking.enabled' => true, 'memcache.local' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0, 'password' => 'xxx', ), 'enable_previews' => true, 'enabledPreviewProviders' => array ( 0 => 'OC\Preview\PNG', 1 => 'OC\Preview\JPEG', 2 => 'OC\Preview\GIF', 3 => 'OC\Preview\BMP', 4 => 'OC\Preview\XBitmap', 5 => 'OC\Preview\MP3', 6 => 'OC\Preview\TXT', 7 => 'OC\Preview\MarkDown', ), 'preview_max_x' => 6144, 'preview_max_y' => 6144, 'preview_max_scale_factor' => 5, 'preview_max_filesize_image' => 50, 'integrity.check.disabled' => true, 'mail_domain' => 'xxx', 'apps_paths' => array ( 0 => array ( 'path' => '/var/www/owncloud/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/www/owncloud/apps-my', 'url' => '/apps-my', 'writable' => true, ), ), 'activity_expire_days' => 90, 'trusted_domains' => array ( 0 => 'xxx', 1 => 'xxx', ), 'xframe_restriction' => true, 'share_folder' => '/Shared', 'overwritewebroot' => '/owncloud', 'overwrite.cli.url' => '/owncloud', 'check_for_working_htaccess' => false, 'secret' => 'xxx', 'mail_smtpmode' => 'smtp', 'asset-pipeline.enabled' => false, 'appstore.experimental.enabled' => true, 'trashbin_retention_obligation' => 'auto', 'mail_from_address' => 'no-reply', 'updatechecker' => false, 'mail_smtphost' => 'localhost', 'allow_user_to_change_mail_address' => '',

rain1155 avatar May 09 '22 06:05 rain1155

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 06 '22 01:11 github-actions[bot]

This still happens with 10.11.0

rain1155 avatar Nov 06 '22 10:11 rain1155

Agree @rain1155 it's also in current stable version and our proposed fix still works fine.

appsolutionspl avatar Nov 06 '22 11:11 appsolutionspl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 17 '23 01:10 github-actions[bot]

With the latest owncloud 10.13.2 this appears to be fixed. @appsolutionspl can you confirm?

rain1155 avatar Oct 17 '23 08:10 rain1155

@rain1155 @appsolutionspl please have a look at #41050 - THX

DeepDiver1975 avatar Oct 17 '23 08:10 DeepDiver1975

No, I moved to nextcloud. But I don't see any change in mentioned line of code comparing to core/master.

appsolutionspl avatar Oct 17 '23 08:10 appsolutionspl

PR updated to have the isolated fix only ....

DeepDiver1975 avatar Oct 17 '23 09:10 DeepDiver1975