nextcloud / nextcloud/notes

Tries to rename notes to the full text spamming error log

Open
#1,990 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The app initially save(d) notes with an abbreviated text. It tries to rename the notes to the whole text failing because of filename length constraints. This spams my error log:

Steps to reproduce

  1. Type chinese text into a not
  2. Error log is full of renaming attempts
Expected behaviour

Truncate the filename to a sensible value.

Actual behaviour

Rename is attempted to the full text over and over and over

Screenshots
Image

Server

  • Notes app version: 6.0.1
  • Nextcloud version: 34.03
  • OS: Linux
  • Web server: niginx
  • PHP version: 5.8.9
  • Database: MariaDB 12.3.2

Nextcloud configuration:

``` { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost", "cloud.falix.de" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "http:\/\/localhost", "dbtype": "mysql", "version": "34.0.3.2", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "instanceid": "***REMOVED SENSITIVE VALUE***", "serverid": 242, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "defaultapp": "", "default_language": "de", "default_locale": "de_DE", "default_phone_region": "de", "skeletondirectory": "", "installed": true, "maintenance": false, "maintenance_window_start": "1", "log_type": "file", "loglevel": 0, "syslog_tag": "nextcloud", "theme": "", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "updater.release.channel": "stable", "app_install_overwrite": [ "calendar", "socialsharing_email", "sharepoint", "files_mindmap" ], "mysql.utf8mb4": true, "memcache.local": "\\OC\\Memcache\\APCu", "mail_sendmailmode": "smtp", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "memories.db.triggers.fcu": true, "memories.exiftool_no_local": true, "memories.vod.path": "\/srv\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64", "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg", "memories.vod.ffprobe": "\/usr\/bin\/ffprobe", "enabledPreviewProviders": [ "OC\\Preview\\Image", "OC\\Preview\\HEIC", "OC\\Preview\\TIFF", "OC\\Preview\\Movie" ], "preview_max_x": 1024, "preview_max_y": 1024, "config_preset": 3, "forbidden_filename_basenames": [ "con", "prn", "aux", "nul", "com0", "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9", "com\u00b9", "com\u00b2", "com\u00b3", "lpt0", "lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "lpt\u00b9", "lpt\u00b2", "lpt\u00b3" ], "forbidden_filename_characters": [ "<", ">", ":", "\"", "|", "?", "*", "\\", "\/" ], "forbidden_filename_extensions": [ " ", ".", ".filepart", ".part" ] } } ```

Log files

Add relevant parts of your nextcloud.log and/or your browser's JavaScript console here.
{"reqId":"cLCSu1CR8T9d3S3vAnpc","level":3,"time":"2026-08-18T20:13:18+00:00","remoteAddr":"2001:a61:11ff:ca01:a041:1108:d605:5486","user":"fuli","app":"notes","method":"PUT","url":"/index.php/apps/notes/api/v1/notes/237036?","scrip
tName":"/index.php","message":"Controller failed with OCP\Files\NotPermittedException","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/34.1.0","version":"34.0.3.2","exception":{"Exception":"OCP\Files\NotPermittedException"
,"Message":"Could not move /fuli/files/Notizen/\u5988\u5988\u6628\u665a\u770b\u5230\u4f60.md to /fuli/files/Notizen/\u201c\u5988\u5988\u6628\u665a\u770b\u5230\u4f60\u653e\u5728\u684c\u4e0a\u7684\u6210\u7ee9\u5355\u4e86\u3002\u4e0a
u9762\u4e0d\u662f\u4f18\u5c31\u662f\u826f\uff0c\u800c\u4e14\u4f60\u8fd8\u8df3\u4e86\u4e00\u5e74\u7ea7\u3002\u8fd9\u5e94\u8be5\u662f\u4f60\u4e2d\u5b66\u4ee5\u6765\u6700\u597d\u7684\u6210\u7ee9\u4e86\u5427\uff1f\u8fd9\u4e24\u5e74\u51
e0\u4e4e\u90fd\u662f\u4f60\u81ea\u5df1\u4e00\u4e2a\u4eba\u5b66\u7684\uff0c\u5988\u5988\u4ee5\u524d\u5728\u4f60\u9700\u8981\u5e2e\u52a9\u7684\u65f6\u5019\u8fd8\u8001\u8bad\u4f60\uff0c\u771f\u662f\u5e2e\u4e86\u5012\u5fd9\u3002\u62ff
u5230\u8fd9\u4e2a\u6210.md","Code":0,"Trace":[{"file":"/srv/www/nextcloud/apps/notes/lib/Service/Note.php","line":166,"function":"move","class":"OC\Files\Node\Node","type":"->"},{"file":"/srv/www/nextcloud/apps/notes/lib/Control
ler/NotesApiController.php","line":180,"function":"setTitleCategory","class":"OCA\Notes\Service\Note","type":"->"},{"file":"/srv/www/nextcloud/apps/notes/lib/Service/Util.php","line":25,"function":"{closure:OCA\Notes\Controlle
r\NotesApiController::update():164}","class":"OCA\Notes\Controller\NotesApiController","type":"->","args":["*** sensitive parameters replaced "]},{"file":"/srv/www/nextcloud/apps/notes/lib/Controller/Helper.php","line":135,"
function":"retryIfLocked","class":"OCA\Notes\Service\Util","type":"::"},{"file":"/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php","line":164,"function":"handleErrorResponse","class":"OCA\Notes\Controller\H
elper","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":165,"function":"update","class":"OCA\Notes\Controller\NotesApiController","type":"->","args":["
sensitive parameters replace
d ***"]},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":78,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramew
ork/App.php","line":137,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/Route/Router.php","line":324,"function":"main","class":"OC\AppFramework\App","type":"
::"},{"file":"/srv/www/nextcloud/lib/base.php","line":1172,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/srv/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/
srv/www/nextcloud/lib/private/Files/Node/Node.php","Line":478,"message":"Controller failed with OCP\Files\NotPermittedException","exception":"{"class":"OCP\Files\NotPermittedException","message":"Could not move /fuli/fil
es/Notizen/\u5988\u5988\u6628\u665a\u770b\u5230\u4f60.md to /fuli/files/Notizen/\u201c\u5988\u5988\u6628\u665a\u770b\u5230\u4f60\u653e\u5728\u684c\u4e0a\u7684\u6210\u7ee9\u5355\u4e86\u3002\u4e0a\u9762\u4e0d\u662f\u4f18\u5c31\u662f
u826f\uff0c\u800c\u4e14\u4f60\u8fd8\u8df3\u4e86\u4e00\u5e74\u7ea7\u3002\u8fd9\u5e94\u8be5\u662f\u4f60\u4e2d\u5b66\u4ee5\u6765\u6700\u597d\u7684\u6210\u7ee9\u4e86\u5427\uff1f\u8fd9\u4e24\u5e74\u51e0\u4e4e\u90fd\u662f\u4f60\u81ea\u5d
f1\u4e00\u4e2a\u4eba\u5b66\u7684\uff0c\u5988\u5988\u4ee5\u524d\u5728\u4f60\u9700\u8981\u5e2e\u52a9\u7684\u65f6\u5019\u8fd8\u8001\u8bad\u4f60\uff0c\u771f\u662f\u5e2e\u4e86\u5012\u5fd9\u3002\u62ff\u5230\u8fd9\u4e2a\u6210.md","code
":0,"file":"/srv/www/nextcloud/lib/private/Files/Node/Node.php:478","trace":"#0 /srv/www/nextcloud/apps/notes/lib/Service/Note.php(166): OC\Files\Node\Node->move()\n#1 /srv/www/nextcloud/apps/notes/lib/Controller/NotesAp
iController.php(180): OCA\Notes\Service\Note->setTitleCategory()\n#2 /srv/www/nextcloud/apps/notes/lib/Service/Util.php(25): OCA\Notes\Controller\NotesApiController->{closure:OCA\Notes\Controller\NotesApiController::updat
e():164}()\n#3 /srv/www/nextcloud/apps/notes/lib/Controller/Helper.php(135): OCA\Notes\Service\Util::retryIfLocked()\n#4 /srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php(164): OCA\Notes\Controller\Helper-

handleErrorResponse()\n#5 /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(165): OCA\Notes\Controller\NotesApiController->update()\n#6 /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(78): OC\Ap
pFramework\Http\Dispatcher->executeController()\n#7 /srv/www/nextcloud/lib/private/AppFramework/App.php(137): OC\AppFramework\Http\Dispatcher->dispatch()\n#8 /srv/www/nextcloud/lib/private/Route/Router.php(324): OC\AppFrame
work\App::main()\n#9 /srv/www/nextcloud/lib/base.php(1172): OC\Route\Router->match()\n#10 /srv/www/nextcloud/index.php(25): OC::handleRequest()\n#11 {main}"}","CustomMessage":"Controller failed with OCP\Files\NotPermittedE
xception"}}
{"reqId":"9ERLSKFWkaHihV9mF4NK","level":3,"time":"2026-08-18T20:13:18+00:00","remoteAddr":"82.135.70.44","user":"fuli","app":"notes","method":"PUT","url":"/index.php/apps/notes/api/v1/notes/237036?","scriptName":"/index.php","messa
ge":"Controller failed with OCP\Files\NotPermittedException","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/34.1.0","version":"34.0.3.2","exception":{"Exception":"OCP\Files\NotPermittedException","Message":"Could not move
/fuli/files/Notizen/\u5988\u5988\u6628\u665a\u770b\u5230\u4f60.md to /fuli/files/Notizen/\u201c\u5988\u5988\u6628\u665a\u770b\u5230\u4f60\u653e\u5728\u684c\u4e0a\u7684\u6210\u7ee9\u5355\u4e86\u3002\u4e0a\u9762\u4e0d\u662f\u4f18\u5c31\u662f\u826f\uff0c\u800c\u4e14\u4f60\u8fd8\u8df3\u4e86\u4e00\u5e74\u7ea7\u3002\u8fd9\u5e94\u8be5\u662f\u4f60\u4e2d\u5b66\u4ee5\u6765\u6700\u597d\u7684\u6210\u7ee9\u4e86\u5427\uff1f\u8fd9\u4e24\u5e74\u51e0\u4e4e\u90fd\u662f\u4f60\u81ea\u5df1\u4e00\u4e2a\u4eba\u5b66\u7684\uff0c\u5988\u5988\u4ee5\u524d\u5728\u4f60\u9700\u8981\u5e2e\u52a9\u7684\u65f6\u5019\u8fd8\u8001\u8bad\u4f60\uff0c\u771f\u662f\u5e2e\u4e86\u5012\u5fd9\u3002\u62ff\u5230\u8fd9\u4e2a\u6210.md","Code":0,"Trace":[{"file":"/srv/www/nextcloud/apps/notes/lib/Service/Note.php","line":166,"function":"move","class":"OC\Files\Node\Node","type":"->"},{"file":"/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php","line":180,"function":"setTitleCategory","class":"OCA\Notes\Service\Note","type":"->"},{"file":"/srv/www/nextcloud/apps/notes/lib/Service/Util.php","line":25,"function":"{closure:OCA\Notes\Controller\NotesApiController::update():164}","class":"OCA\Notes\Controller\NotesApiController","type":"->","args":["*** sensitive parameters replaced "]},{"file":"/srv/www/nextcloud/apps/notes/lib/Controller/Helper.php","line":135,"function":"retryIfLocked","class":"OCA\Notes\Service\Util","type":"::"},{"file":"/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php","line":164,"function":"handleErrorResponse","class":"OCA\Notes\Controller\Helper","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":165,"function":"update","class":"OCA\Notes\Controller\NotesApiController","type":"->","args":[" sensitive parameters replaced ***"]},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":78,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/Route/Router.php","line":324,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/srv/www/nextcloud/lib/base.php","line":1172,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/srv/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/srv/www/nextcloud/lib/private/Files/Node/Node.php","Line":478,"message":"Controller failed with OCP\Files\NotPermittedException","exception":"{"class":"OCP\Files\NotPermittedException","message":"Could not move /fuli/files/Notizen/\u5988\u5988\u6628\u665a\u770b\u5230\u4f60.md to /fuli/files/Notizen/\u201c\u5988\u5988\u6628\u665a\u770b\u5230\u4f60\u653e\u5728\u684c\u4e0a\u7684\u6210\u7ee9\u5355\u4e86\u3002\u4e0a\u9762\u4e0d\u662f\u4f18\u5c31\u662f\u826f\uff0c\u800c\u4e14\u4f60\u8fd8\u8df3\u4e86\u4e00\u5e74\u7ea7\u3002\u8fd9\u5e94\u8be5\u662f\u4f60\u4e2d\u5b66\u4ee5\u6765\u6700\u597d\u7684\u6210\u7ee9\u4e86\u5427\uff1f\u8fd9\u4e24\u5e74\u51e0\u4e4e\u90fd\u662f\u4f60\u81ea\u5df1\u4e00\u4e2a\u4eba\u5b66\u7684\uff0c\u5988\u5988\u4ee5\u524d\u5728\u4f60\u9700\u8981\u5e2e\u52a9\u7684\u65f6\u5019\u8fd8\u8001\u8bad\u4f60\uff0c\u771f\u662f\u5e2e\u4e86\u5012\u5fd9\u3002\u62ff\u5230\u8fd9\u4e2a\u6210.md","code":0,"file":"/srv/www/nextcloud/lib/private/Files/Node/Node.php:478","trace":"#0 /srv/www/nextcloud/apps/notes/lib/Service/Note.php(166): OC\Files\Node\Node->move()\n#1 /srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php(180): OCA\Notes\Service\Note->setTitleCategory()\n#2 /srv/www/nextcloud/apps/notes/lib/Service/Util.php(25): OCA\Notes\Controller\NotesApiController->{closure:OCA\Notes\Controller\NotesApiController::update():164}()\n#3 /srv/www/nextcloud/apps/notes/lib/Controller/Helper.php(135): OCA\Notes\Service\Util::retryIfLocked()\n#4 /srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php(164): OCA\Notes\Controller\Helper->handleErrorResponse()\n#5 /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(165): OCA\Notes\Controller\NotesApiController->update()\n#6 /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(78): OC\AppFramework\Http\Dispatcher->executeController()\n#7 /srv/www/nextcloud/lib/private/AppFramework/App.php(137): OC\AppFramework\Http\Dispatcher->dispatch()\n#8 /srv/www/nextcloud/lib/private/Route/Router.php(324): OC\AppFramework\App::main()\n#9 /srv/www/nextcloud/lib/base.php(1172): OC\Route\Router->match()\n#10 /srv/www/nextcloud/index.php(25): OC::handleRequest()\n#11 {main}"}","CustomMessage":"Controller failed with OCP\Files\NotPermittedException"}}

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 in apps/notes/lib/Service/Note.php at line 166, where setTitleCategory moves the note, and trace the call from NotesApiController.php around line 180. Reproduce with a long Chinese title and inspect the filename-length failure. Done means long note titles use a sensible truncated filename and repeated updates no longer spam the error log.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.