NoteDoesNotExistException Is Being Written to the Log Continuously
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 738
- Forks
- 162
- Avg merge
- 6h 2m
- Merged PRs (30d)
- 35
Description
The Notes app is registering the following exception in the NextCloud log several times per minute:
[notes] Error: Controller failed with OCA\Notes\Service\NoteDoesNotExistException
GET /apps/notes/notes/1821221
from 192.168.1.26 by ***REMOVED SENSITIVE VALUE*** at Jan 12, 2024, 2:13:03 PM
The notes referenced by the URL id have been apparently deleted. The source IPs all belong to PCs. The first error appeared on January 5th, 2023 while on version 27.1.5 and continues after upgrading to 28.0.1.
Steps to reproduce
n/a
Expected behaviour
The error is registered once if the note was expected to exist.
Actual behaviour
The same error is plaguing the log multiple times per minute.
Screenshots
Server
Please complete the following information.
- Notes app version: 4.9.2
- Nextcloud version: 28.0.1
- OS: Ubuntu 20.04.6 LTS
- Web server: Apache 2.4.41
- PHP version: 8.1.14
- Database: MySQL 15.1
Nextcloud configuration:
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***",
"***REMOVED SENSITIVE VALUE***",
"192.168.1.112"
],
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "28.0.1.1",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"overwriteprotocol": "https",
"forcessl": "true",
"htaccess.RewriteBase": "\/",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"apc.enable_cli": 1,
"memcache.local": "\\OC\\Memcache\\APCu",
"filelocking.enabled": true,
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0,
"timeout": 0
},
"mail_smtpmode": "smtp",
"mail_smtpsecure": "tls",
"mail_sendmailmode": "smtp",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "LOGIN",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "587",
"maintenance": false,
"theme": "",
"loglevel": 2,
"default_phone_region": "US",
"app_install_overwrite": [
"health"
],
"updater.secret": "***REMOVED SENSITIVE VALUE***"
}
}
Client
Please complete the following information.
- Browser (incl. version):
- Brave 1.61.114 Chromium: 120.0.6099.199 (Official Build) (64-bit)]
- Firefox 121.0 (64-bit)
- OS: Windows 10 and Windows 11
Log files
Full sample log entry:
{
"reqId": "mtvtqhPY1yXaGniBKzlW",
"level": 3,
"time": "2024-01-12T21:13:03+00:00",
"remoteAddr": "192.168.1.26",
"user": "***REMOVED SENSITIVE VALUE***",
"app": "notes",
"method": "GET",
"url": "/apps/notes/notes/1821221",
"message": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
"version": "28.0.1.1",
"exception": {
"Exception": "OCA\\Notes\\Service\\NoteDoesNotExistException",
"Message": "",
"Code": 0,
"Trace": [{
"file": "/var/www/nextcloud/apps/notes/lib/Service/NotesService.php",
"line": 73,
"function": "getFileById",
"class": "OCA\\Notes\\Service\\NotesService",
"type": "::"
}, {
"file": "/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php",
"line": 138,
"function": "get",
"class": "OCA\\Notes\\Service\\NotesService",
"type": "->"
}, {
"file": "/var/www/nextcloud/apps/notes/lib/Service/Util.php",
"line": 26,
"function": "OCA\\Notes\\Controller\\{closure}",
"class": "OCA\\Notes\\Controller\\NotesController",
"type": "->",
"args": ["*** sensitive parameters replaced ***"]
}, {
"file": "/var/www/nextcloud/apps/notes/lib/Controller/Helper.php",
"line": 140,
"function": "retryIfLocked",
"class": "OCA\\Notes\\Service\\Util",
"type": "::"
}, {
"file": "/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php",
"line": 152,
"function": "handleErrorResponse",
"class": "OCA\\Notes\\Controller\\Helper",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "get",
"class": "OCA\\Notes\\Controller\\NotesController",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
}, {
"file": "/var/www/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
}, {
"file": "/var/www/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/apps/notes/lib/Service/NotesService.php",
"Line": 219,
"message": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException",
"exception": [],
"CustomMessage": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException"
},
"id": "65a1ab5fdb37a"
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/Service/NotesService.php around getFileById and lib/Controller/NotesController.php around lines 138 and 152, following the GET /apps/notes/notes/{id} path. Determine why requests for the deleted note recur and how the controller handles NoteDoesNotExistException. Done means the missing-note request no longer floods the Nextcloud log while expected existing-note errors remain handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100