nextcloud / nextcloud/notes

Notes are not loading (user has ~5k notes). HTTP 504 Gateway Timeout.

Open
#1,226 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug need to reproduce performance 🚀
Dominant language
JavaScript
Stars
738
Forks
162
Avg merge
6h 2m
Merged PRs (30d)
35

Description

Server times out (HTTP 504) when loading notes in the web UI. Tested with over 5000 files.

I migrated to Nextcloud Notes from SimpleNote for the sake of better security, encryption. I've been using SimpleNote for a while and have over 5000 note text files. When loading notes in Nextcloud web UI, Notes app takes 30 sec to 1 minute. The request will eventually time out.

Steps to reproduce

  1. Clean install the Nextcloud. Tested v.28.0.2.
  2. SSH as root to the Nextcloud server and navigate to the user's files directory.
  3. In Terminal create a test folder with 10000 random notes:
wget https://gist.githubusercontent.com/petrstepanov/fd60e1eec0b56ca18b6a0999fbf24a1c/raw/generate-notes.sh
chmod +x ./generate-notes.sh
./generate-notes.sh
  1. In Terminal, navigate to the Nextcloud installation folder and update file cache:
cd /var/www/html
sudo -u www-data php occ files:scan --all
  1. Set Notes app to use the "NotesTest" folder. In the Nextcloud web UI open "Notes" tab, go to "Notes settings". Under the "NotesPath" select the "NotesTest" folder.
  2. Reload the web page.
  3. Notes app takes forever to load. App shows error "Fetching notes has failed. See JavaScript console and server log for details."
Expected behaviour

Notes should load in the web interface within a reasonable timeframe.

Actual behaviour

Notes are not loading. Error message is displayed.

Possible solution

Implement lazy loading?

Screenshots

Screenshot from 2024-02-03 15-27-42

Server

Please complete the following information.

  • Notes app version: 4.9.2
  • Nextcloud version: 28.0.2
  • OS: Ubuntu 22.05 Kernel 5.15.0-92-generic
  • Web server: nginx/1.24.0
  • PHP version: 8.1.27
  • Database: mariadb

Nextcloud configuration:

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "149.248.33.245",
            "cloud.petrstepanov.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.2.5",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        }
    }
}

Client

Please complete the following information.

  • Browser (incl. version): Mozilla Firefox 121.0.1
  • OS: Fedora 39

Log files

Add relevant parts of your nextcloud.log and/or your browser's JavaScript console here.

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

Reproduce the issue with the provided 5,000–10,000-note setup and inspect the browser JavaScript console and server log, which the report identifies as relevant but does not provide. Trace the Notes web UI request that fetches the collection and determine where it exceeds the timeout. Done means large note collections load in the web interface without an HTTP 504.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.