Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoteDoesNotExistException Is Being Written to the Log Continuously #1205

Open
r01k opened this issue Jan 12, 2024 · 6 comments
Open

NoteDoesNotExistException Is Being Written to the Log Continuously #1205

r01k opened this issue Jan 12, 2024 · 6 comments
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced

Comments

@r01k
Copy link

r01k commented Jan 12, 2024

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

image

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"
}
@r01k r01k added bug Something isn't working need to reproduce Issue that has not been reproduced labels Jan 12, 2024
@grimcz
Copy link

grimcz commented Feb 9, 2024

Hi

I had the same issue.
Do not know the cause but possibly related with corrupted table oc_filecache (SQLSTATE[HY000]: General error: 1034 Index for table oc_filecache is corrupt; try to repair it). I solved this by recreating the table (drop it, recreate and then occ files:scan --all -vvv)

Fix:

  • find user causing the issue - see /var/www/nextcloud/nextcloud.log
  • sign-off the user (web browser in my case)
  • after sign-in no more errors

Hope this help

@McLibboc
Copy link

I have the same issue bloating my log files.
The Android app keeps trying to delete a note that is no longer in the system.

@joshtrichards
Copy link
Member

Do the fileId's vary or are the entries all the same number?

@joshtrichards
Copy link
Member

Possibly related: #1196

@McLibboc
Copy link

In my case it is always the same note id.

@MrRinkana
Copy link

MrRinkana commented May 22, 2024

I have only gotten this error 4 times the last 30 days (didn't before).

Its different notes in the four errors.

Its always the DELETE call.

The user agent seems to be from the nextcloud android app everytime. I don't think I (userA) have handled/opened notes in the nextcloud app at all, but maybe it's the notes app (which I do use) that uses the nextcloud app for sync? Not sure how that works..

The errors

1:

{
  "reqId": "MW2oNdTnuMgJNe12xzi4",
  "level": 3,
  "time": "2024-04-18T08:25:04+00:00",
  "remoteAddr": "xxx.xxx.xxx.xxx",
  "user": "userA",
  "app": "notes",
  "method": "DELETE",
  "url": "/index.php/apps/notes/api/v1/notes/145473?",
  "message": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException",
  "userAgent": "Mozilla/5.0 (Android) Nextcloud-android/3.28.1",
  "version": "28.0.4.1",
  "exception": {
    "Exception": "OCA\\Notes\\Service\\NoteDoesNotExistException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/NotesService.php",
        "line": 140,
        "function": "getFileById",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 220,
        "function": "delete",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/Util.php",
        "line": 26,
        "function": "OCA\\Notes\\Controller\\{closure}",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/Helper.php",
        "line": 140,
        "function": "retryIfLocked",
        "class": "OCA\\Notes\\Service\\Util",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 222,
        "function": "handleErrorResponse",
        "class": "OCA\\Notes\\Controller\\Helper",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "destroy",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/srv/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": "664daa5900ccb"
}

2:

{
  "reqId": "Mf3YToA0lXDdoLgVZYy2",
  "level": 3,
  "time": "2024-04-25T12:04:13+00:00",
  "remoteAddr": "xxx.xxx.xxx.xxx",
  "user": "userA",
  "app": "notes",
  "method": "DELETE",
  "url": "/index.php/apps/notes/api/v1/notes/145678?",
  "message": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException",
  "userAgent": "Mozilla/5.0 (Android) Nextcloud-android/3.28.2",
  "version": "28.0.4.1",
  "exception": {
    "Exception": "OCA\\Notes\\Service\\NoteDoesNotExistException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/NotesService.php",
        "line": 140,
        "function": "getFileById",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 220,
        "function": "delete",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/Util.php",
        "line": 26,
        "function": "OCA\\Notes\\Controller\\{closure}",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/Helper.php",
        "line": 140,
        "function": "retryIfLocked",
        "class": "OCA\\Notes\\Service\\Util",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 222,
        "function": "handleErrorResponse",
        "class": "OCA\\Notes\\Controller\\Helper",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "destroy",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/srv/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": "664daa5900b54"
}

3:

{
  "reqId": "SmhEqNTgoJEE1t5Zhlm4",
  "level": 3,
  "time": "2024-05-05T19:33:02+00:00",
  "remoteAddr": "xxx.xxx.xxx.xxx",
  "user": "userA",
  "app": "notes",
  "method": "DELETE",
  "url": "/index.php/apps/notes/api/v1/notes/14083?",
  "message": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException",
  "userAgent": "Mozilla/5.0 (Android) Nextcloud-android/3.29.0",
  "version": "28.0.5.1",
  "exception": {
    "Exception": "OCA\\Notes\\Service\\NoteDoesNotExistException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/NotesService.php",
        "line": 140,
        "function": "getFileById",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 220,
        "function": "delete",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/Util.php",
        "line": 26,
        "function": "OCA\\Notes\\Controller\\{closure}",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/Helper.php",
        "line": 140,
        "function": "retryIfLocked",
        "class": "OCA\\Notes\\Service\\Util",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 222,
        "function": "handleErrorResponse",
        "class": "OCA\\Notes\\Controller\\Helper",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "destroy",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/srv/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": "664da9691f3be"
}

4:

{
  "reqId": "NuENZvnRntUXRTDV0biu",
  "level": 3,
  "time": "2024-05-20T03:24:38+00:00",
  "remoteAddr": "xxx.xxx.xxx.xxx",
  "user": "userA",
  "app": "notes",
  "method": "DELETE",
  "url": "/index.php/apps/notes/api/v1/notes/156231?",
  "message": "Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException",
  "userAgent": "Mozilla/5.0 (Android) Nextcloud-android/3.29.0",
  "version": "28.0.5.1",
  "exception": {
    "Exception": "OCA\\Notes\\Service\\NoteDoesNotExistException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/NotesService.php",
        "line": 140,
        "function": "getFileById",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 220,
        "function": "delete",
        "class": "OCA\\Notes\\Service\\NotesService",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Service/Util.php",
        "line": 26,
        "function": "OCA\\Notes\\Controller\\{closure}",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/Helper.php",
        "line": 140,
        "function": "retryIfLocked",
        "class": "OCA\\Notes\\Service\\Util",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/apps/notes/lib/Controller/NotesApiController.php",
        "line": 222,
        "function": "handleErrorResponse",
        "class": "OCA\\Notes\\Controller\\Helper",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "destroy",
        "class": "OCA\\Notes\\Controller\\NotesApiController",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/srv/www/nextcloud/lib/base.php",
        "line": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/srv/www/nextcloud/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/srv/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": "664da9691f1b6"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced
Projects
None yet
Development

No branches or pull requests

5 participants