nextcloud / server

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

[Bug]: MaxInstancesExceededException Recurring events are only allowed to generate 3500 - Error cleaning up reminders of a calendar object #43647

Open eibex opened 9 months ago

eibex commented 9 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Similarly to #34442 I am encountering this issue since upgrading to Nextcloud 28 (I am not sure if it's a result of NC28 or a new calendar event). The data in the log is extremely limited and I cannot track down which event is causing this issue. The user in question has loads of events in the calendar and tracking down the issue is becoming complex.

The error appears multiple times a day.

Steps to reproduce

I cannot reliably reproduce this.

Expected behavior

No error

Installation method

Community Docker image

Nextcloud Server version

28

Operating system

Other

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxx.yyy.zzz"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "28.0.2.5",
        "overwriteprotocol": "https",
        "overwrite.cli.url": "https:\/\/xxx.yyy.zzz\/",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 3
        },
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauthtype": "PLAIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "loglevel": 3,
        "maintenance_window_start": 1,
        "updater.release.channel": "stable",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\Image",
            "OC\\Preview\\Movie",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\HEIC"
        ],
        "lost_password_link": "disabled",
        "auth.webauthn.enabled": false,
        "default_phone_region": "IT",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "X-Forwarded-For",
            "HTTP_X_FORWARDED_FOR"
        ],
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.gis_type": 2,
        "defaultapp": "files",
        "activity_expire_days": 365
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - bruteforcesettings: 2.8.0
  - calendar: 4.6.5
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contacts: 5.5.1
  - dav: 1.29.1
  - end_to_end_encryption: 1.14.1
  - federatedfilesharing: 1.18.0
  - files: 2.0.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - impersonate: 1.15.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - memories: 6.2.2
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - notify_push: 0.6.9
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - side_menu: 3.11.7
  - snappymail: 2.34.2
  - support: 1.11.0
  - systemtags: 1.18.0
  - tasks: 0.15.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_totp: 10.0.0-beta.2
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - workflowengine: 2.10.0
Disabled:
  - admin_audit: 1.18.0
  - circles: 28.0.0-dev (installed 27.0.1)
  - contactsinteraction: 1.9.0 (installed 1.2.0)
  - dashboard: 7.8.0 (installed 7.3.0)
  - encryption: 2.16.0
  - external: 5.3.1 (installed 5.3.1)
  - federation: 1.18.0 (installed 1.9.0)
  - files_external: 1.20.0
  - survey_client: 1.16.0 (installed 1.4.0)
  - suspicious_login: 6.0.0 (installed 5.0.0)
  - user_ldap: 1.19.0
  - weather_status: 1.8.0 (installed 1.0.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{
  "reqId": "***",
  "level": 3,
  "time": "2024-02-18T17:00:22+00:00",
  "remoteAddr": "***",
  "user": "***",
  "app": "dav",
  "method": "PUT",
  "url": "/remote.php/dav/calendars/***/personal/***.ics",
  "message": "Error cleaning up reminders of a calendar object: Recurring events are only allowed to generate 3500",
  "userAgent": "iOS/17.2.1 dataaccessd/1.0",
  "version": "28.0.2.5",
  "exception": {
    "Exception": "Sabre\\VObject\\Recur\\MaxInstancesExceededException",
    "Message": "Recurring events are only allowed to generate 3500",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/apps/dav/lib/CalDAV/Reminder/ReminderService.php",
        "line": 293,
        "function": "valid",
        "class": "Sabre\\VObject\\Recur\\EventIterator",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/lib/CalDAV/Reminder/ReminderService.php",
        "line": 366,
        "function": "onCalendarObjectCreate",
        "class": "OCA\\DAV\\CalDAV\\Reminder\\ReminderService",
        "type": "->",
        "args": [
          [
            7718231,
            "*** sensitive parameters replaced ***",
            1708275622,
            "\"dc734f290912690b18d328cae6cf25e8\"",
            "*** sensitive parameters replaced ***",
            "And 5 more entries, set log level to debug to see all entries"
          ]
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php",
        "line": 138,
        "function": "onCalendarObjectEdit",
        "class": "OCA\\DAV\\CalDAV\\Reminder\\ReminderService",
        "type": "->",
        "args": [
          [
            7718231,
            "*** sensitive parameters replaced ***",
            1708275622,
            "\"dc734f290912690b18d328cae6cf25e8\"",
            "*** sensitive parameters replaced ***",
            "And 5 more entries, set log level to debug to see all entries"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 86,
        "function": "handle",
        "class": "OCA\\DAV\\Listener\\CalendarObjectReminderUpdaterListener",
        "type": "->",
        "args": [
          [
            "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 230,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->",
        "args": [
          [
            "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
          ],
          "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent",
          [
            "Symfony\\Component\\EventDispatcher\\EventDispatcher"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 59,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ]
          ],
          "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent",
          [
            "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 94,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
          ],
          "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
        ]
      },
      {
        "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 106,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent",
          [
            "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/CalDAV/CalDavBackend.php",
        "line": 1338,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\DAV\\Events\\CalendarObjectUpdatedEvent"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/public/AppFramework/Db/TTransactional.php",
        "line": 63,
        "function": "OCA\\DAV\\CalDAV\\{closure}",
        "class": "OCA\\DAV\\CalDAV\\CalDavBackend",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/CalDAV/CalDavBackend.php",
        "line": 1312,
        "function": "atomic",
        "class": "OCA\\DAV\\CalDAV\\CalDavBackend",
        "type": "->",
        "args": [
          [
            "Closure"
          ],
          [
            "OC\\DB\\ConnectionAdapter"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/CalDAV/CalendarObject.php",
        "line": 103,
        "function": "updateCalendarObject",
        "class": "OCA\\DAV\\CalDAV\\CalDavBackend",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1137,
        "function": "put",
        "class": "Sabre\\CalDAV\\CalendarObject",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 492,
        "function": "updateFile",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpPut",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          [
            "Sabre\\HTTP\\Request"
          ],
          [
            "Sabre\\HTTP\\Response"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "method:PUT",
          [
            [
              "Sabre\\HTTP\\Request"
            ],
            [
              "Sabre\\HTTP\\Response"
            ]
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          [
            "Sabre\\HTTP\\Request"
          ],
          [
            "Sabre\\HTTP\\Response"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/lib/Server.php",
        "line": 370,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/remote.php",
        "line": 172,
        "args": [
          "/var/www/html/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/3rdparty/sabre/vobject/lib/Recur/EventIterator.php",
    "Line": 306,
    "message": "Error cleaning up reminders of a calendar object: Recurring events are only allowed to generate 3500",
    "exception": [],
    "CustomMessage": "Error cleaning up reminders of a calendar object: Recurring events are only allowed to generate 3500"
  },
  "id": "***"
}

Additional info

OS: Linux 6.1.74-Unraid x86_64

StefanoWoerner commented 5 months ago

I am also experiencing this since upgrading to NC28. The problem still persists in NC29.

section1 commented 4 months ago

Hi i see this problem too but in version "version":"27.1.4.1" and with clients like MacOs and in less count with Thunderbird.

shuther commented 2 months ago

I have the same issue with version 29.0.6 I am not sure how to get further details about which calendar event is causing the problem (I am not expecting any device to connect to caldav while I had this error); could it be a cron/background job? For example in the trace when this error happens, is it possible to add some extra details? Maybe it is the id but I am missing how to access it?

  "Trace": [
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/vobject/lib/Recur/EventIterator.php",
        "line": 399,
        "function": "valid",
        "class": "Sabre\\VObject\\Recur\\EventIterator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/vobject/lib/Component/VEvent.php",
        "line": 41,
        "function": "fastForward",
        "class": "Sabre\\VObject\\Recur\\EventIterator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/CalDAV/CalendarQueryValidator.php",
        "line": 277,
        "function": "isInTimeRange",
        "class": "Sabre\\VObject\\Component\\VEvent",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/CalDAV/CalendarQueryValidator.php",
        "line": 80,
        "function": "validateTimeRange",
        "class": "Sabre\\CalDAV\\CalendarQueryValidator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/CalDAV/CalendarQueryValidator.php",
        "line": 41,
        "function": "validateCompFilters",
        "class": "Sabre\\CalDAV\\CalendarQueryValidator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php",
        "line": 139,
        "function": "validate",
        "class": "Sabre\\CalDAV\\CalendarQueryValidator",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
        "line": 2072,
        "function": "validateFilterForObject",
        "class": "Sabre\\CalDAV\\Backend\\AbstractBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
        "line": 2006,
        "function": "searchCalendarObjects",
        "class": "OCA\\DAV\\CalDAV\\CalDavBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/CalendarImpl.php",
        "line": 126,
        "function": "search",
        "class": "OCA\\DAV\\CalDAV\\CalDavBackend",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Calendar/Manager.php",
        "line": 210,
        "function": "search",
        "class": "OCA\\DAV\\CalDAV\\CalendarImpl",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/Status/StatusService.php",
        "line": 196,
        "function": "searchForPrincipal",
        "class": "OC\\Calendar\\Manager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/Status/StatusService.php",
        "line": 71,
        "function": "getCalendarEvents",
        "class": "OCA\\DAV\\CalDAV\\Status\\StatusService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php",
        "line": 79,
        "function": "processCalendarStatus",
        "class": "OCA\\DAV\\CalDAV\\Status\\StatusService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 232,
        "function": "getStatus",
        "class": "OCA\\UserStatus\\Controller\\UserStatusController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 138,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 331,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/ocs/v1.php",
        "line": 66,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/nextcloud/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/3rdparty/sabre/vobject/lib/Recur/EventIterator.php",
    "Line": 306,
    "message": "Recurring events are only allowed to generate 3500",
    "exception": [],
    "CustomMessage": "Recurring events are only allowed to generate 3500"
  },
  "id": "66e156da7c5a0"
}
m3tabar0n commented 2 months ago

I have Thunderbird connected to the Nextcloud CalDAV backend. In my Thunderbird calendar notifications there were two notifications (!) for one (!) event. The error described above came up, when I dismissed these notifications in Thunderbird. My temporary solution: deleting and recreating the calendar event in Nextcloud calendar app.