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

fix(external_storage): Cast id to int #49602

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

oleksandr-nc
Copy link
Contributor

follow up to #49464

Should solve error:

"message": "OCA\\Files_External\\Service\\DBConfigService::getMountById(): Argument #1 ($mountId) must be of type int, string given, called in /var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php on line 164 in file '/var/www/html/nextcloud_test1/apps/files_external/lib/Service/DBConfigService.php' line 69"

@come-nc
Copy link
Contributor

come-nc commented Dec 2, 2024

Do you have the full stacktrace?

This will work only because strict typing is off in this file I think, but the real problem is upper in the call stack, these methods should already be receiving an int.

@oleksandr-nc
Copy link
Contributor Author

{"reqId":"CKVFUb9FTOrJUfb8qPKq","level":3,"time":"2024-11-01T13:19:54+00:00","remoteAddr":"172.30.104.10","user":"V1_4089","app":"index","method":"GET","url":"/index.php/apps/files_external/userstorages/undefined?testOnly=false","message":"OCA\\Files_External\\Service\\DBConfigService::getMountById(): Argument #1 ($mountId) must be of type int, string given, called in /var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php on line 164 in file '/var/www/html/nextcloud_test1/apps/files_external/lib/Service/DBConfigService.php' line 67","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","version":"28.0.11.1","exception":{"Exception":"Exception","Message":"OCA\\Files_External\\Service\\DBConfigService::getMountById(): Argument #1 ($mountId) must be of type int, string given, called in /var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php on line 164 in file '/var/www/html/nextcloud_test1/apps/files_external/lib/Service/DBConfigService.php' line 67","Code":0,"Trace":[{"file":"/var/www/html/nextcloud_test1/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud_test1/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud_test1/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud_test1/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud_test1/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"OCA\\Files_External\\Service\\DBConfigService::getMountById(): Argument #1 ($mountId) must be of type int, string given, called in /var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php on line 164","Code":0,"Trace":[{"file":"/var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php","line":164,"function":"getMountById","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/www/html/nextcloud_test1/apps/files_external/lib/Controller/StoragesController.php","line":296,"function":"getStorage","class":"OCA\\Files_External\\Service\\StoragesService","type":"->"},{"file":"/var/www/html/nextcloud_test1/apps/files_external/lib/Controller/UserStoragesController.php","line":110,"function":"show","class":"OCA\\Files_External\\Controller\\StoragesController","type":"->"},{"file":"/var/www/html/nextcloud_test1/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"show","class":"OCA\\Files_External\\Controller\\UserStoragesController","type":"->"},{"file":"/var/www/html/nextcloud_test1/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud_test1/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud_test1/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud_test1/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud_test1/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud_test1/apps/files_external/lib/Service/DBConfigService.php","Line":67},"message":"OCA\\Files_External\\Service\\DBConfigService::getMountById(): Argument #1 ($mountId) must be of type int, string given, called in /var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php on line 164 in file '/var/www/html/nextcloud_test1/apps/files_external/lib/Service/DBConfigService.php' line 67","exception":{},"CustomMessage":"OCA\\Files_External\\Service\\DBConfigService::getMountById(): Argument #1 ($mountId) must be of type int, string given, called in /var/www/html/nextcloud_test1/apps/files_external/lib/Service/StoragesService.php on line 164 in file '/var/www/html/nextcloud_test1/apps/files_external/lib/Service/DBConfigService.php' line 67"}}

@oleksandr-nc oleksandr-nc merged commit f1754ee into master Dec 3, 2024
191 checks passed
Copy link

welcome bot commented Dec 3, 2024

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

@oleksandr-nc oleksandr-nc deleted the fix/external-storage-service-cast-id branch December 3, 2024 12:58
@oleksandr-nc
Copy link
Contributor Author

/backport to stable29

@oleksandr-nc
Copy link
Contributor Author

/backport to stable30

@oleksandr-nc
Copy link
Contributor Author

/backport to stable28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants