nextcloud / nextcloud/server

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

Open
#43,647 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 28-feedback bug feature: caldav performance 🚀
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ 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?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/dav/lib/CalDAV/Reminder/ReminderService.php around lines 293 and 366, then follow CalendarObjectReminderUpdaterListener.php at line 138 and the reported calendar-object update flow. Investigate the recurring event that exceeds 3500 generated instances; done means reminder cleanup no longer emits the logged MaxInstancesExceededException.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.