nextcloud / recognize

👁 👂 Smart media tagging for Nextcloud: recognizes faces, objects, landscapes, music genres
https://apps.nextcloud.com/apps/recognize
GNU Affero General Public License v3.0
564 stars 45 forks source link

Argument #2 ($userId) must be of type string, int given #1058

Closed keesfluitman closed 10 months ago

keesfluitman commented 11 months ago

Which version of recognize are you using?

6.0.1

Enabled Modes

Face recognition

TensorFlow mode

Normal mode

Downstream App

Files App

Which Nextcloud version do you have installed?

28.0.0

Which Operating system do you have installed?

Windows

Which database are you running Nextcloud on?

MariaDB 10.11.5

Which Docker container are you using to run Nextcloud? (if applicable)

Linuxserver 28.0

How much RAM does your server have?

64GB

What processor Architecture does your CPU have?

x86_64

Describe the Bug

{"reqId":"l3Ek9h5BISh33RdPfGYt","level":3,"time":"December 16, 2023 13:23:47","remoteAddr":"2001:1711:fa46:3bc0:548c:ccb2:bf30:dd42","user":"kees","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Exception thrown: Exception","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0","version":"28.0.0.11","exception":{"Exception":"Exception","Message":"OCA\\Recognize\\Db\\FaceDetectionMapper::findByFileIdAndUser(): Argument #2 ($userId) must be of type string, int given, called in /config/www/nextcloud/apps/recognize/lib/Hooks/FileListener.php on line 89 in file '/config/www/nextcloud/apps/recognize/lib/Db/FaceDetectionMapper.php' line 91","Code":0,"Trace":[{"file":"/app/www/public/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/app/www/public/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/app/www/public/ocs/v2.php","line":23,"args":["/app/www/public/ocs/v1.php"],"function":"require_once"}],"File":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"OCA\\Recognize\\Db\\FaceDetectionMapper::findByFileIdAndUser(): Argument #2 ($userId) must be of type string, int given, called in /config/www/nextcloud/apps/recognize/lib/Hooks/FileListener.php on line 89","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/recognize/lib/Hooks/FileListener.php","line":89,"function":"findByFileIdAndUser","class":"OCA\\Recognize\\Db\\FaceDetectionMapper","type":"->"},{"file":"/app/www/public/lib/private/EventDispatcher/ServiceEventListener.php","line":86,"function":"handle","class":"OCA\\Recognize\\Hooks\\FileListener","type":"->"},{"file":"/app/www/public/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":230,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/app/www/public/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":59,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/app/www/public/lib/private/EventDispatcher/EventDispatcher.php","line":94,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/app/www/public/lib/private/EventDispatcher/EventDispatcher.php","line":106,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/app/www/public/lib/private/Share20/Manager.php","line":834,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php","line":863,"function":"createShare","class":"OC\\Share20\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"createShare","class":"OCA\\Files_Sharing\\Controller\\ShareAPIController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/app/www/public/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/app/www/public/ocs/v2.php","line":23,"args":["/app/www/public/ocs/v1.php"],"function":"require_once"}],"File":"/config/www/nextcloud/apps/recognize/lib/Db/FaceDetectionMapper.php","Line":91},"CustomMessage":"Exception thrown: Exception"}}

This error came after trying to share a folder with a user that has a Integer UID. I've setup Authentik as SAML authentication Method in Nextcloud, and use the UID as unique identifier. Nextcloud probably receives it as type Integer, and Recognize has issues with that. When i disable this app, i can share folders just fine. It seems just that Recognize is not able to handle Integer type.

Or am I wrong?

Expected Behavior

Recognize is not an issue when i want to share folders?

To Reproduce

Have a User with integer UID. Share a Folder. Read the error log.

Debug log

No response

github-actions[bot] commented 11 months ago

Hello :wave:

Thank you for taking the time to open this issue with recognize. I know it's frustrating when software causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at and if possible solved. I try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it. Until then, please be patient. Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can collaborate to make this software better. For everyone. Thus, if you can, you could also look at other issues to see whether you can help other people with your knowledge and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and try to fix the odd bug yourself. Everyone will be thankful for extra helping hands! One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum, to twitter or somewhere else. But this is a technical issue tracker, so please make sure to focus on the tech and keep your opinions to yourself. (Also see our Code of Conduct. Really.)

I look forward to working with you on this issue Cheers :blue_heart: