Sidebar for frequently edited text file hangs web browser tab, leaks GB of memory

Nextcloud version: 27.1.1.0
Operating system and version: Nextcloud server runs from community Docker image 27.1.1-apache, host is Ubuntu 22.04 64-bit server.
Apache or nginx version: Apache 2.4.57 (per the Docker image)
PHP version: 8.2.10 (per the Docker image)
Database: MariaDB 10.6.15
Updated from an older Nextcloud/ownCloud or fresh install: updated, many times

The issue you are facing:

I’ve got a Markdown text file that is only about 150KB but is been edited relatively often (say, 3x/week) by multiple users. When I try to open the sidebar in the Nextcloud web ui (Activity/Comments/Sharing/Versions) for this file (say, to view recent activity) the browser tab hangs. While I’m waiting, I see the CPU for that browser tab is 100% and the memory footprint climbs into the gigabytes. Sometimes part of the sidebar (say, Activity) loads after a few minutes, sometimes it remains blank as long as I care to wait. This happens in both Firefox (v117) and Chromium (looks like I’m also using v117). My (client) computer OS running the web browsers is 64-bit Ubuntu 22.04 LTS desktop. I’ve also noticed problems when I try to lock and locally edit the misbehaving file: I’m getting spurious conflicts often.

Is this the first time you’ve seen this error?:

I think so. I’m not certain.

Steps to replicate it:

I don’t have a consistent repro, unfortunately. I’ve only noticed this behavior for this one file so far.

Workaround:

Copy the file to a new file, edit that one instead. Sidebar works as expected with the new file. Local locking and editing works well with the new file, too (less or no conflicts).

Logs…

I don’t see anything unusual or relevant in any server-side logs, nor in the web browser javascript console. I don’t see any slow queries in the db. The only symptom is the web browser tab hanging and leaking memory (and, if related, the symptoms I mentioned re: locking and local editing causing conflicts, above).

List of activated apps

Enabled:

  • activity: 2.19.0
  • admin_audit: 1.17.0
  • bruteforcesettings: 2.7.0
  • calendar: 4.5.1
  • circles: 27.0.1
  • cloud_federation_api: 1.10.0
  • comments: 1.17.0
  • contacts: 5.4.2
  • contactsinteraction: 1.8.0
  • cookbook: 0.10.2
  • dav: 1.27.0
  • deck: 1.11.0
  • drawio: 2.1.2
  • event_update_notification: 2.2.0
  • federatedfilesharing: 1.17.0
  • files: 1.22.0
  • files_antivirus: 5.2.2
  • files_automatedtagging: 1.17.0
  • files_external: 1.19.0
  • files_fulltextsearch: 27.0.1
  • files_lock: 27.0.1
  • files_pdfviewer: 2.8.0
  • files_reminders: 1.0.0
  • files_retention: 1.16.0
  • files_rightclick: 1.6.0
  • files_sharing: 1.19.0
  • files_trashbin: 1.17.0
  • files_versions: 1.20.0
  • firstrunwizard: 2.16.0
  • forms: 3.3.1
  • fulltextsearch: 27.0.1
  • fulltextsearch_elasticsearch: 27.0.2
  • impersonate: 1.14.0
  • integration_openai: 1.0.13
  • logreader: 2.12.0
  • lookup_server_connector: 1.15.0
  • maps: 1.1.1
  • memories: 5.4.1
  • metadata: 0.19.0
  • nextcloud_announcements: 1.16.0
  • notes: 4.8.1
  • notifications: 2.15.0
  • oauth2: 1.15.1
  • password_policy: 1.17.0
  • passwords: 2023.9.30
  • phonetrack: 0.7.6
  • photos: 2.3.0
  • polls: 5.3.2
  • provisioning_api: 1.17.0
  • recommendations: 1.6.0
  • related_resources: 1.2.0
  • richdocuments: 8.2.0
  • serverinfo: 1.17.0
  • settings: 1.9.0
  • sharebymail: 1.17.0
  • spreed: 17.1.1
  • support: 1.10.0
  • suspicious_login: 5.0.0
  • systemtags: 1.17.0
  • tasks: 0.15.0
  • text: 3.8.0
  • theming: 2.2.0
  • theming_customcss: 1.14.0
  • twofactor_backupcodes: 1.16.0
  • twofactor_nextcloud_notification: 3.7.0
  • twofactor_totp: 9.0.0
  • twofactor_webauthn: 1.2.0
  • updatenotification: 1.17.0
  • user_status: 1.7.0
  • viewer: 2.1.0
  • workflowengine: 2.9.0
    Disabled:
  • analytics: 4.10.0
  • appointments: 1.15.3
  • assistant: 1.0.1
  • dashboard: 7.4.0
  • encryption: 2.8.1
  • federation: 1.11.0
  • holiday_calendars: 0.3.0
  • mail: 3.4.0
  • news: 23.0.0
  • privacy: 1.5.0
  • survey_client: 1.9.0
  • user_ldap: 1.11.0
  • weather_status: 1.1.0

My stack is straightforward as well… I’m using Traefik v2.10.4 as a reverse proxy and for SSL termination.

Configuration (config/config.php)
{
    "loglevel": "1",
    "version": "27.1.1.0",
    "maintenance": false,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "has_internet_connection": true,
    "htaccess.IgnoreFrontController": true,
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "cloud.example.com"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "3306",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED_FOR",
        "HTTP_X_REAL_IP"
    ],
    "overwriteprotocol": "https",
    "overwrite.cli.url": "https:\/\/cloud.example.com",
    "ldapIgnoreNamingRules": false,
    "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
    "enable_previews": true,
    "enabledPreviewProviders": [
        "OC\\Preview\\BMP",
        "OC\\Preview\\GIF",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\MP3",
        "OC\\Preview\\MarkDown",
        "OC\\Preview\\Movie",
        "OC\\Preview\\PDF",
        "OC\\Preview\\PNG",
        "OC\\Preview\\SVG",
        "OC\\Preview\\TXT",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\OpenDocument",
        "OC\\Preview\\Image",
        "OC\\Preview\\HEIC"
    ],
    "app_install_overwrite": [
        "cookbook",
        "gpxedit",
        "fulltextsearch",
        "fulltextsearch_elasticsearch",
        "files_fulltextsearch",
        "impersonate",
        "holiday_calendars"
    ],
    "default_phone_region": "US",
    "preview_max_x": "2048",
    "preview_max_y": "2048",
    "jpeg_quality": "60",
    "theme": "",
    "trashbin_retention_obligation": "auto, 30",
    "htaccess.RewriteBase": "\/",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "apps_paths": [
        {
            "path": "\/var\/www\/html\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/www\/html\/custom_apps",
            "url": "\/custom_apps",
            "writable": true
        }
    ],
    "reference_opengraph": true,
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "password": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    },
    "mail_smtpmode": "smtp",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_sendmailmode": "smtp",
    "mail_smtpport": "25",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "upgrade.disable-web": true,
    "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/exiftool-bin\/exiftool-amd64-glibc",
    "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/exiftool-bin\/go-vod-amd64",
    "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
    "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
    "memories.gis_type": 1,
    "memories.vod.disable": false
}
Cron Configuration:
Array
(
    [backgroundjobs_mode] => cron
    [lastcron] => 1695665553
)
Misc: Encryption: **no** External storages: **yes**

Guesses as to root cause:

  1. database corruption
  2. too many records, and missing index and/or web frontend not expecting so many records