nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.36k stars 4.06k forks source link

Cronjob failed with error in "parseCalendarData" #30112

Closed KaeTuuN closed 2 years ago

KaeTuuN commented 2 years ago

How to use GitHub

Steps to reproduce

I don't know how to reproduce it, because I don't know where it comes from.

Expected behaviour

No error while running cronjob.

Actual behaviour

Get the following Error Message:

{
  "reqId": "bmtWNBRe4cYWSvwC78wo",
  "level": 3,
  "time": "2021-12-06T11:45:03+01:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )",
  "userAgent": "--",
  "version": "22.2.3.0",
  "exception": {
    "Exception": "TypeError",
    "Message": "Argument 1 passed to OCA\\DAV\\CalDAV\\Reminder\\ReminderService::parseCalendarData() must be of the type string, null given, called in /var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php on line 122",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php",
        "line": 122,
        "function": "parseCalendarData",
        "class": "OCA\\DAV\\CalDAV\\Reminder\\ReminderService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php",
        "line": 66,
        "function": "processReminders",
        "class": "OCA\\DAV\\CalDAV\\Reminder\\ReminderService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/BackgroundJob/Job.php",
        "line": 51,
        "function": "run",
        "class": "OCA\\DAV\\BackgroundJob\\EventReminderJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php",
        "line": 58,
        "function": "execute",
        "class": "OC\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 127,
        "function": "execute",
        "class": "OC\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php",
    "Line": 666,
    "CustomMessage": "Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )"
  }
}

Server configuration

Operating system: bare metal Ubuntu 20.04 LTS HWE (All patches installed)

Web server: Apache 2.4.51-1+ubuntu20.04.1+deb.sury.org+1

Database: MariaDB 10.4.22+maria~focal

PHP version: 7.4.3-4ubuntu2.7

Nextcloud version: 22.2.3

Updated from an older Nextcloud/ownCloud or fresh install: Installation is from NC20, DB and Files started from an old owncloud Installation years ago.

Where did you install Nextcloud from: Your website

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - activity: 2.15.0 - admin_audit: 1.12.0 - apporder: 0.13.0 - audioplayer: 3.2.2 - calendar: 3.0.1 - checksum: 1.1.3 - cloud_federation_api: 1.5.0 - comments: 1.12.0 - contacts: 4.0.6 - contactsinteraction: 1.3.0 - cookbook: 0.9.8 - cospend: 1.4.3 - dav: 1.19.0 - deck: 1.5.5 - drawio: 1.0.1 - encryption: 2.10.0 - federatedfilesharing: 1.12.0 - federation: 1.12.0 - files: 1.17.0 - files_mindmap: 0.0.25 - files_pdfviewer: 2.3.1 - files_rightclick: 1.1.0 - files_sharing: 1.14.0 - files_trashbin: 1.12.0 - files_versions: 1.15.0 - files_videoplayer: 1.11.0 - firstrunwizard: 2.11.0 - forms: 2.4.0 - guests: 2.1.0 - keeweb: 0.6.8 - logreader: 2.7.0 - lookup_server_connector: 1.10.0 - mail: 1.11.0 - metadata: 0.15.0 - nextcloud_announcements: 1.11.0 - notes: 4.2.0 - notifications: 2.10.1 - oauth2: 1.10.0 - password_policy: 1.12.0 - photos: 1.4.0 - polls: 3.3.0 - privacy: 1.6.0 - provisioning_api: 1.12.0 - qownnotesapi: 21.12.0 - ransomware_protection: 1.12.0 - recommendations: 1.1.0 - serverinfo: 1.12.0 - settings: 1.4.0 - sharebymail: 1.12.0 - socialsharing_diaspora: 2.4.0 - socialsharing_email: 2.4.0 - socialsharing_facebook: 2.4.0 - socialsharing_twitter: 2.4.0 - systemtags: 1.12.0 - tasks: 0.14.2 - text: 3.3.0 - theming: 1.13.0 - twofactor_backupcodes: 1.11.0 - twofactor_totp: 6.2.0 - unsplash: 1.2.4 - updatenotification: 1.12.0 - user_status: 1.2.0 - viewer: 1.6.0 - weather_status: 1.2.0 - workflowengine: 2.4.0

Nextcloud configuration:

Config report { "system": { "activity_expire_days": 14, "app_install_overwrite": [ "apporder", "files_clipboard", "keeweb", "twofactor_rcdevsopenotp", "files_frommail", "keeporsweep", "audioplayer", "checksum", "cookbook", "groupfolders", "socialsharing_diaspora", "socialsharing_email", "socialsharing_facebook", "socialsharing_twitter" ], "auth.bruteforce.protection.enabled": true, "blacklisted_files": [ ".htaccess", "Thumbs.db", "thumbs.db" ], "cron_log": true, "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbname": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbtype": "mysql", "dbuser": "***REMOVED SENSITIVE VALUE***", "default_phone_region": "DE", "encryption_skip_signature_check": true, "filelocking.enabled": "true", "filesystem_check_changes": 0, "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "integrity.check.disabled": false, "knowledgebaseenabled": false, "log_rotate_size": 104857600, "loglevel": 2, "logtimezone": "Europe\/Berlin", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtpauthtype": "LOGIN", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpsecure": "ssl", "maintenance": false, "memcache.local": "\\OC\\Memcache\\APCu", "mysql.utf8mb4": true, "overwrite.cli.url": "https:\/\/cloud.wellmann.wtf", "overwriteprotocol": "https", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "quota_include_external_storage": false, "secret": "***REMOVED SENSITIVE VALUE***", "share_folder": "\/Shares", "theme": "", "trashbin_retention_obligation": "auto, 70", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***", "***REMOVED SENSITIVE VALUE***", "****REMOVED SENSITIVE VALUE***" ], "updater.release.channel": "stable", "version": "22.2.3.0", "encryption.legacy_format_support": false, "encryption.key_storage_migrated": false } }

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

Are you using encryption: yes

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

Client configuration

Not needed here, since it is a server side cron error.

Web server error log

Just some encryption errors, nothing interessting.

Nextcloud log (data/nextcloud.log)

Just 3 example Logentries. First entry in Log appeared 2021-09-06T14:45:05+02:00

Nextcloud log {"reqId":"EjFZcGsCkedfYZlm11wc","level":3,"time":"2021-12-06T12:05:01+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )","userAgent":"--","version":"22.2.3.0","exception":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\DAV\\CalDAV\\Reminder\\ReminderService::parseCalendarData() must be of the type string, null given, called in /var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php on line 122","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","line":122,"function":"parseCalendarData","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php","line":66,"function":"processReminders","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\DAV\\BackgroundJob\\EventReminderJob","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":127,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","Line":666,"CustomMessage":"Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )"}} {"reqId":"Ww89igGGcyIi9yE7TY5z","level":3,"time":"2021-12-06T12:10:04+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )","userAgent":"--","version":"22.2.3.0","exception":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\DAV\\CalDAV\\Reminder\\ReminderService::parseCalendarData() must be of the type string, null given, called in /var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php on line 122","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","line":122,"function":"parseCalendarData","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php","line":66,"function":"processReminders","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\DAV\\BackgroundJob\\EventReminderJob","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":127,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","Line":666,"CustomMessage":"Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )"}} {"reqId":"NFEV6i4JKBZ5CejfxjYl","level":3,"time":"2021-12-06T12:15:01+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )","userAgent":"--","version":"22.2.3.0","exception":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\DAV\\CalDAV\\Reminder\\ReminderService::parseCalendarData() must be of the type string, null given, called in /var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php on line 122","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","line":122,"function":"parseCalendarData","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php","line":66,"function":"processReminders","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\DAV\\BackgroundJob\\EventReminderJob","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":127,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","Line":666,"CustomMessage":"Error while running background job (class: OCA\\DAV\\BackgroundJob\\EventReminderJob, arguments: )"}}

Browser log

Not needed here, since it is a server side cron error.

ChristophWurst commented 2 years ago

hey @KaeTuuN. Do you have easy access to your database? I would like you to check something.

Run SELECT COUNT(*) FROM oc_calendarobjects WHERE calendardata IS NULL.

KaeTuuN commented 2 years ago

Hi @ChristophWurst , Zero hits. +----------+ | COUNT(*) | +----------+ | 0 | +----------+

ChristophWurst commented 2 years ago

Okay. Then it's only the join data.

SELECT COUNT(*) FROM oc_calendar_reminders cr LEFT JOIN oc_calendarobjects co ON cr.object_id=co.id LEFT JOIN oc_calendars c ON cr.calendar_id=c.id WHERE co.calendardata IS NULL

KaeTuuN commented 2 years ago

@ChristophWurst two hits there! What should I do with them? I did some further Investigation and found out, that these two Entries (should) have been deleted month ago via an Android Smartphone with DAVx⁵ App. They do not appear in the Users Calendar any more, so I think something went wrong with the deletion. So my assumption is, that I can delete those entries, but I wanna make sure to not break Anything.

Greetings KaeTuuN

ChristophWurst commented 2 years ago

Does the joined calendar or calendar_object have deleted_at set to anything but NULL?

The deletion of those rows will most definitely make the error go away, but I'd like to understand how we ended up there. This might lead us to the root cause of the issue.

KaeTuuN commented 2 years ago

Nope, both rows say NULL at cr.deleted_at

ChristophWurst commented 2 years ago

it's co.deleted_at and c.deleted_at

tcitworld commented 2 years ago

Related ? https://github.com/nextcloud/server/pull/20766

KaeTuuN commented 2 years ago

@ChristophWurst My fault, copied the wrong string. But yes, both ( co & c) are empty.

@tcitworld Seems Possible. If i could reproduce this error in my Dev Environment, I would test your patch.

KaeTuuN commented 2 years ago

I made some further Investigation and found out, that the error was handmade... Someone manipulated (deleted) two Entries to help a Costumer with an error... So I think this one can be closed.

Thx 4 help everyone!