nextcloud / deck

πŸ—‚ Kanban-style project & personal management tool for Nextcloud, similar to Trello
https://apps.nextcloud.com/apps/deck
GNU Affero General Public License v3.0
1.2k stars 273 forks source link

($boardId) must be of type int #4637

Closed enoch85 closed 1 year ago

enoch85 commented 1 year ago

How to use GitHub

Describe the bug Sorry, can't provide such, just wanted to let you know about these errors in the log. We have issues with users that can't access the boards even if they have permission to do so. This started to happen on 26.0.1 afaik.

To Reproduce N/A

Expected behavior No errors

Screenshots If applicable, add screenshots to help explain your problem.

Client details:

Server details **Operating system**: Ubuntu Server 20.04 **Web server:** Apache 2.4 **Database:** MariaDB 10.5 **PHP version:** 8.0 **Nextcloud version:** (see Nextcloud admin page) 26.0.1 **Where did you install Nextcloud from:** **Signing status:** ``` No errors ``` **List of activated apps:** ``` Enabled: - activity: 2.18.0 - admin_audit: 1.16.0 - bruteforcesettings: 2.6.0 - circles: 26.0.0 - cloud_federation_api: 1.9.0 - comments: 1.16.0 - contacts: 5.2.0 - contactsinteraction: 1.7.0 - dashboard: 7.6.0 - dav: 1.25.0 - deck: 1.9.0 - federatedfilesharing: 1.16.0 - federation: 1.16.0 - files: 1.21.1 - files_accesscontrol: 1.16.0 - files_automatedtagging: 1.16.1 - files_lock: 26.0.0 - files_pdfviewer: 2.7.0 - files_rightclick: 1.5.0 - files_sharing: 1.18.0 - files_trashbin: 1.16.0 - files_versions: 1.19.1 - flow_notifications: 1.6.0 - forms: 3.2.0 - groupfolders: 14.0.1 - guests: 2.4.0 - logreader: 2.11.0 - lookup_server_connector: 1.14.0 - nextcloud_announcements: 1.15.0 - notifications: 2.14.0 - notify_push: 0.6.2 - oauth2: 1.14.0 - officeonline: 2.0.1 - password_policy: 1.16.0 - polls: 5.0.4 - privacy: 1.10.0 - provisioning_api: 1.16.0 - recommendations: 1.5.0 - related_resources: 1.1.0-alpha1 - serverinfo: 1.16.0 - settings: 1.8.0 - sharebymail: 1.16.0 - support: 1.9.0 - systemtags: 1.16.0 - text: 3.7.2 - theming: 2.1.1 - twofactor_backupcodes: 1.15.0 - twofactor_totp: 8.0.0-alpha.0 - twofactor_webauthn: 1.1.2 - updatenotification: 1.16.0 - user_saml: 5.1.2 - viewer: 1.10.0 - weather_status: 1.6.0 - welcome: 1.0.9 - workflow_script: 1.11.1 - workflowengine: 2.8.0 Disabled: - encryption: 2.14.0 - files_external: 1.18.0 - firstrunwizard: 2.15.0 (installed 2.13.0) - photos: 2.2.0 (installed 1.6.0) - survey_client: 1.14.0 (installed 1.12.0) - suspicious_login: 4.4.0 - user_ldap: 1.16.0 - user_status: 1.6.0 (installed 1.4.0) - wopi: 3.5.11 (installed 3.5.11) ``` **Nextcloud configuration:** ``` { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "samarbeta..XYZ.TLD" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "26.0.1.1", "overwrite.cli.url": "https:\/\/samarbeta.XYZ.TLD", "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, "filelocking.enabled": true, "memcache.locking": "\\OC\\Memcache\\Redis", "memcache.local": "\\OC\\Memcache\\Redis", "memcache.distributed": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0.5, "dbindex": 0 }, "default_phone_region": "se", "default_language": "sv", "force_language": "sv", "default_locale": "sv_SE", "log.condition": { "apps": [ "admin_audit" ] }, "skeletondirectory": "\/srv\/skeleton", "defaultapp": "dashboard,files", "allow_user_to_change_display_name": false, "instanceid": "***REMOVED SENSITIVE VALUE***", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "maintenance": false, "simpleSignUpLink.shown": false, "loglevel": 2, "share_folder": "\/Delade dokument", "twofactor_enforced": "true", "twofactor_enforced_groups": [ "guest_app" ], "twofactor_enforced_excluded_groups": [], "app_install_overwrite": [ "wopi" ], "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "preview_concurrency_new": "16", "preview_concurrency_all": "32", "enabledPreviewProviders": [ "OC\\Preview\\Imaginary", "OC\\Preview\\Image", "OC\\Preview\\MarkDown", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\OpenDocument", "OC\\Preview\\Movie" ], "preview_imaginary_url": "http:\/\/127.0.0.1:9000", "preview_max_x": "2048", "preview_max_y": "2048", "jpeg_quality": "60", "preview_max_memory": "256" } } ``` **Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
Logs #### Nextcloud log (data/nextcloud.log) ``` [deck] Fel: Exception: OCA\Deck\Service\BoardService::find(): Argument #1 ($boardId) must be of type int, string given, called in /srv/www/nextcloud/apps/deck/lib/Controller/BoardController.php on line 60 in file '/srv/www/nextcloud/apps/deck/lib/Service/BoardService.php' line 173 at <> 0. /srv/www/nextcloud/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch() 1. /srv/www/nextcloud/lib/private/Route/Router.php line 315 OC\AppFramework\App::main() 2. /srv/www/nextcloud/lib/base.php line 1056 OC\Route\Router->match() 3. /srv/www/nextcloud/index.php line 36 OC::handleRequest() Caused by: TypeError: OCA\Deck\Service\BoardService::find(): Argument #1 ($boardId) must be of type int, string given, called in /srv/www/nextcloud/apps/deck/lib/Controller/BoardController.php on line 60 at <> 0. /srv/www/nextcloud/apps/deck/lib/Controller/BoardController.php line 60 OCA\Deck\Service\BoardService->find() 1. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Deck\Controller\BoardController->read() 2. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController() 3. /srv/www/nextcloud/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch() 4. /srv/www/nextcloud/lib/private/Route/Router.php line 315 OC\AppFramework\App::main() 5. /srv/www/nextcloud/lib/base.php line 1056 OC\Route\Router->match() 6. /srv/www/nextcloud/index.php line 36 OC::handleRequest() GET /apps/deck/boards/undefined ########### [deck] Fel: Exception: OCA\Deck\Controller\SessionController::close(): Argument #2 ($token) must be of type string, null given, called in /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 230 in file '/srv/www/nextcloud/apps/deck/lib/Controller/SessionController.php' line 86 at <> 0. /srv/www/nextcloud/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch() 1. /srv/www/nextcloud/lib/private/Route/Router.php line 315 OC\AppFramework\App::main() 2. /srv/www/nextcloud/ocs/v1.php line 64 OC\Route\Router->match() 3. /srv/www/nextcloud/ocs/v2.php line 23 require_once("/srv/www/nextcloud/ocs/v1.php") Caused by: TypeError: OCA\Deck\Controller\SessionController::close(): Argument #2 ($token) must be of type string, null given, called in /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 230 at <> 0. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Deck\Controller\SessionController->close("*** sensitive parameters replaced ***") 1. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController() 2. /srv/www/nextcloud/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch() 3. /srv/www/nextcloud/lib/private/Route/Router.php line 315 OC\AppFramework\App::main() 4. /srv/www/nextcloud/ocs/v1.php line 64 OC\Route\Router->match() 5. /srv/www/nextcloud/ocs/v2.php line 23 require_once("/srv/www/nextcloud/ocs/v1.php") POST /ocs/v2.php/apps/deck/api/v1.0/session/close ``` #### Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
juliushaertl commented 1 year ago

Those logs look like being caused by a frontend bug that calls the API endpoints with insufficient data (undefined instead of the actual board id). Do you have a way to trigger them in the frontend?

enoch85 commented 1 year ago

Think I found the issue and how it's reproduced...

Same user had two accounts with the same email and username. When she logged in, she was presented with the frontend without any permissions (set to the user).

Didn't even know that was possible. Closing as corner case?

juliushaertl commented 1 year ago

Sounds odd, especially if the user id is the same there should be no difference for the deck app parts.

SergeyMosin commented 1 year ago

Similar error, Deck v1.7.3 , Linux + PHP 8 + MySQL

Exception: OCA\Deck\Db\CardMapper::findBoardId(): Return value must be of type ?int, string returned in file '/var/www/html/apps/deck/lib/Db/CardMapper.php' line 577
...
Caused by TypeError: OCA\Deck\Db\CardMapper::findBoardId(): Return value must be of type ?int, string returned
...

https://github.com/nextcloud/deck/blob/b158d794030b37060e02185d99f92f8882bcbe46/lib/Db/CardMapper.php#L561-L578

In Linux + PHP + MySQL setups db queries return type string for most int db fields, ref: https://stackoverflow.com/a/5323169 (PostgreSQL does return an int)

Possible fix:

# return $result !== false ? $result : null;
return $result !== false ? (int)$result : null;
solracsf commented 1 year ago

Fixed by https://github.com/nextcloud/deck/pull/4765