nextcloud-secrets icon indicating copy to clipboard operation
nextcloud-secrets copied to clipboard

Could not find secret for creating retrieval notification

Open handkerchief333 opened this issue 10 months ago • 3 comments

I received two of this error at the same time in my logs. I don't know why, because the secrets-app was not in active use.

Secrets: 2.1.2

Error: {"reqId":"Z4i1uvFcFB3OVeVXRW3DOQAAbzE","level":3,"time":"2025-01-16T07:31:07+00:00","remoteAddr":"12.345.6.78","user":"exampleuser","app":"secrets","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"Could not find secret for creating retrieval notification: Did expect one result but found none when executing: query \"SELECT * FROM PREFIXsecrets WHERE (uuid = :dcValue1) AND (user_id= :dcValue2)\"; ","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0","version":"30.0.4.1","exception":{"Exception":"OCA\\Secrets\\Service\\SecretNotFound","Message":"Did expect one result but found none when executing: query \"SELECT * FROMPREFIXsecrets WHERE (uuid = :dcValue1) AND (user_id= :dcValue2)\"; ","Code":0,"Trace":[{"file":"/apps/secrets/lib/Service/SecretService.php","line":52,"function":"handleException","class":"OCA\\Secrets\\Service\\SecretService","type":"->","args":[{"__class__":"OCP\\AppFramework\\Db\\DoesNotExistException"}]},{"file":"/apps/secrets/lib/Notification/Notifier.php","line":66,"function":"find","class":"OCA\\Secrets\\Service\\SecretService","type":"->","args":["a344b790730d492c8952c18e8548a0a8","exampleuser"]},{"file":"/lib/private/Notification/Manager.php","line":337,"function":"prepare","class":"OCA\\Secrets\\Notification\\Notifier","type":"->","args":[{"__class__":"OC\\Notification\\Notification"},"de"]},{"file":"/apps/notifications/lib/Controller/EndpointController.php","line":103,"function":"prepare","class":"OC\\Notification\\Manager","type":"->","args":[{"__class__":"OC\\Notification\\Notification"},"de"]},{"file":"/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"listNotifications","class":"OCA\\Notifications\\Controller\\EndpointController","type":"->","args":["v2"]},{"file":"/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Notifications\\Controller\\EndpointController"},"listNotifications"]},{"file":"/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Notifications\\Controller\\EndpointController"},"listNotifications"]},{"file":"/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Notifications\\Controller\\EndpointController","listNotifications",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"apiVersion":"v2","_route":"ocs.notifications.endpoint.listnotifications"}]},{"file":"/ocs/v1.php","line":43,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/notifications/api/v2/notifications"]},{"file":"/ocs/v2.php","line":7,"args":["/ocs/v1.php"],"function":"require_once"}],"File":"/apps/secrets/lib/Service/SecretService.php","Line":42,"message":"Could not find secret for creating retrieval notification: Did expect one result but found none when executing: query \"SELECT * FROMPREFIXsecrets WHERE (uuid = :dcValue1) AND (user_id= :dcValue2)\"; ","exception":[],"CustomMessage":"Could not find secret for creating retrieval notification: Did expect one result but found none when executing: query \"SELECT * FROMPREFIXsecrets WHERE (uuid = :dcValue1) AND (user_id = :dcValue2)\"; "},"id":"6788b8273ceac"}

handkerchief333 avatar Jan 16 '25 07:01 handkerchief333

Hi, thanks for the report. Did you anonymize/mask anything in the logs (e.g. exampleuser or PREFIX)? Asking, because the PREFIX in the table name might hint a bug.

theCalcaholic avatar Jan 26 '25 13:01 theCalcaholic

yes i have replaced my real username with exampleuser, changed the remoteAddr to 12.345.6.78 and removed the real folder-path of my nextcloud-project. But thats all.

Here only the message:

 SecretNotFound Did expect one result but found none when executing: query "SELECT * FROM `*PREFIX*secrets` WHERE (`uuid` = :dcValue1) AND (`user_id` = :dcValue2)";
Could not find secret for creating retrieval notification: Did expect one result but found none when executing: query "SELECT * FROM `*PREFIX*secrets` WHERE (`uuid` = :dcValue1) AND (`user_id` = :dcValue2)"; 

handkerchief333 avatar Jan 27 '25 08:01 handkerchief333

Do you still receive these or was it a temporary issue?

theCalcaholic avatar Apr 02 '25 22:04 theCalcaholic

Closed due to inactivity

theCalcaholic avatar Sep 29 '25 09:09 theCalcaholic