nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
622 stars 134 forks source link

Allowed memory size exhausted. Unable to read notes #906

Closed MrSauna closed 2 years ago

MrSauna commented 2 years ago

Notes app in incapable of handing larger directory structures. The app hangs and leaves the user with unresponsive notes app that is unfixable from the ui. It seems that the app does something stupid and hangs itself because of files that it should not even touch.

Steps to reproduce

  1. Change notes folder to 15GiB PKM directory, a lot of markdown files but also everything else

Expected behaviour

The app should read my PKM directory without problems

Actual behaviour

The app gives a slow response in Notes tab, but finally prints

Error

true

Please see Nextcloud server log for details.

Screenshots

image

Server

Please complete the following information.

Nextcloud configuration:

``` { "system": { "overwritehost": "REMOVED", "overwrite.cli.url": "REMOVED", "overwriteprotocol": "https", "overwritecondaddr": "^192\\.168\\.123\\.64$", "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 } ], "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "REMOVED", "REMOVED" ], "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "23.0.3.2", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "theme": "", "loglevel": 0, "maintenance": false, "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtpsecure": "tls", "default_phone_region": "FI", "lost_password_link": "disabled" } } ```

Client

Please complete the following information.

Log files

(REMOVED substitution by me)

{"reqId":"nXOJFRte00SeYu6ld68e","level":3,"time":"2022-08-28T23:00:53+00:00","remoteAddr":"192.168.123.15","user":"REMOVED","app":"PHP","method":"GET","url":"/apps/notes/notes","message":"Allowed memory size of 536870912 bytes exhausted (tried to allocate 483158486 bytes) at /var/www/html/custom_apps/notes/lib/Service/Note.php#49","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0","version":"23.0.3.2","id":"630bf3a53bec9"}
MrSauna commented 2 years ago

I'm mostly interested how to revert back my user specific app config from the custom defined directory back to the Default notes. I would like to know where the user's app configuration data is stored, some pointer where to start looking, from the files or from what sql table, and where more specifically?

MrSauna commented 2 years ago

I'm debugging this a bit tired, but I just realized I can rename the PKM folder/folder that hung Notes app and Notes app will re-initialize itself when the directory doesn't exist. And therefore I can access it's config again.