Occasional Caldav hangs

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.8
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 13
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.66-1~deb13u2
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • None
  • PHP version (e.g, 8.3):
    • 8.4 (Apache2 mod_php)
  • Is this the first time you’ve seen this error? (Yes / No):
    • Seen this several times during the last few weeks
  • When did this problem seem to first start?
    • After update from Nextcloud 31 to 32
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare Metal/Archive
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

When subscribing multiple Nextcloud calendars in Thunderbird (other clients seem to be ok), from time to time (can be minutes or days) Nextcloud hangs. This affects the web interface and Caldav/Carddav/Webdav access for everyone. New incoming requests simply start additional Apache processes, which also hang, consuming lots of CPU, until Apache’s process limit is reached.

There seems to be a deadlock somewhere.

Steps to replicate it (hint: details matter!):

  1. Create around 20 calendars in Nextcloud

  2. In Thunderbird (I’m using Debian’s 140.9ESR) subscribe to those calendars using CalDAV and set sync intervall to e.g. 5 minutes.

  3. Wait

Log entries

Apache’s server-info page shows “W” (Waiting) for the hanging CalDAV “profind” and “get” requests.

Nextcloud

Nothing.

Web server / Reverse Proxy

Nothing.

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "debug": false,
        "installed": true,
        "dbtype": "mysql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "forcessl": false,
        "trusted_domains": [
      **REMOVED**
        ],
        "overwrite.cli.url": "**REMOVED**",
        "default_phone_region": "DE",
        "logtimezone": "Europe\/Berlin",
        "log_query": false,
        "log_authfailip": true,
        "log_rotate_size": 10485760,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpdebug": false,
        "mail_smtpmode": "sendmail",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtptimeout": 10,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/nextcloud\/extra-apps",
                "url": "\/extra-apps",
                "writable": true
            }
        ],
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\BMP",
            "OC\\Preview\\GIF",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\Krita",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\MP3",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\PNG",
            "OC\\Preview\\TXT",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Font",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\Postscript",
            "OC\\Preview\\StarOffice",
            "OC\\Preview\\SVG",
            "OC\\Preview\\TIFF"
        ],
        "preview_max_scale_factor": 10,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "version": "32.0.8.2",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "appstore.experimental.enabled": true,
        "updatechecker": false,
        "loglevel": 2,
        "theme": "",
        "integrity.check.disabled": false,
        "asset-pipeline.enabled": true,
        "upgrade.disable-web": "true",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "mail_sendmailmode": "smtp",
        "mysql.utf8mb4": true,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "simpleSignUpLink.shown": false,
        "trashbin_retention_obligation": "30, 90",
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.gis_type": 1,
        "maintenance_window_start": "1",
        "allow_local_remote_servers": "1",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
- activity: 5.0.0
- bookmarks: 16.1.3
- calendar: 6.2.2
- checksum: 2.0.3
- circles: 32.0.0
- cloud_federation_api: 1.16.0
- comments: 1.22.0
- contacts: 8.3.7
- contactsinteraction: 1.13.1
- dav: 1.34.2
- epubviewer: 1.9.2
- event_update_notification: 2.8.0
- federatedfilesharing: 1.22.0
- federation: 1.22.0
- files: 2.4.0
- files_3dmodelviewer: 0.0.16
- files_antivirus: 6.2.0
- files_downloadactivity: 1.18.1
- files_downloadlimit: 5.0.0
- files_external: 1.24.1
- files_fulltextsearch: 32.0.2
- files_fulltextsearch_tesseract: 32.0.0
- files_pdfviewer: 5.0.0
- files_reminders: 1.5.0
- files_sharing: 1.24.1
- files_trashbin: 1.22.0
- files_versions: 1.25.0
- firstrunwizard: 5.0.0
- forms: 5.2.5
- fulltextsearch: 32.0.0
- fulltextsearch_elasticsearch: 32.0.2
- guests: 4.6.0
- integration_github: 3.2.2
- integration_gitlab: 4.0.0
- ldap_write_support: 1.14.1
- lookup_server_connector: 1.20.0
- mail: 5.7.6
- maps: 1.6.0
- music: 3.0.0
- notes: 4.13.1
- notifications: 5.0.0
- notify_push: 1.3.1
- oauth2: 1.20.0
- photos: 5.0.0
- polls: 8.6.3
- previewgenerator: 5.13.0
- privacy: 4.0.0
- profile: 1.1.0
- provisioning_api: 1.22.0
- quota_warning: 1.23.0
- related_resources: 3.0.0
- richdocuments: 9.0.5
- serverinfo: 4.0.0
- settings: 1.15.1
- sharebymail: 1.22.0
- spreed: 22.0.11
- systemtags: 1.22.0
- tasks: 0.17.1
- text: 6.0.1
- theming: 2.7.0
- twofactor_backupcodes: 1.21.0
- user_ldap: 1.23.0
- viewer: 5.0.0
- weather_status: 1.12.0
- webhook_listeners: 1.3.0
- workflowengine: 2.14.0

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

So you can access to it. When this hang happens, can you access the disk and e.g. read a random file? Perhaps it puts the disk in a sleep mode and it has trouble spinning up? I’d also check other system logs. Or if you run low on memory and the system starts caching or something like that?
Or is there another systematic, e.g. certain cronjobs?

During that CalDAV hangs, the server itself works fine (except for the extreme CPU load due to Apache/Nextcloud). I don’t see any abnormal I/O activity or other suspicious things happen in any logs. Reading data from the disk works perfectly, accessing the MariaDB database as well.

As soon as I close Thunderbird and restart Apache, the server goes back to normal.

The more Nextcloud calendars are subscribed in Thunderbird, the more likely this happens.

As this did never ever happen in Nextcloud 31 and before.

Anything in your nextcloud.log? Can you check if at the time of the hang there’s a deadlock situation in MariaDB?

No errors or warnings in nextcloud.log.

How can I check for a deadlock situtation in MariaDB?