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

[BUG]: Resource not found -> when the original user who create the password and share it is now deleted #587

Open
6 tasks done
CypLef opened this issue Apr 5, 2023 · 2 comments
Labels
bug Something in the app is not working as expected

Comments

@CypLef
Copy link

CypLef commented Apr 5, 2023

⚠️ This issue respects the following points: ⚠️

  • This is a single bug, not a question or a configuration/webserver/proxy issue.
  • This is not a bug in the browser extension or another client.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server and the Passwords App is up to date. See Nextcloud Apps.
  • There are no warnings and errors reported in the Passwords App settings in the admin area
  • The following apps are not installed: Rainloop

Server Information

{
    "version": {
        "server": "25.0.3.2",
        "app": "2023.2.22",
        "lsr": false,
        "php": "8.1.16",
        "cronPhp": "8.1.16"
    },
    "environment": {
        "os": "Linux",
        "architecture": "x86_64",
        "bits": 64,
        "database": "mysql",
        "cron": "cron",
        "proxy": false,
        "sslProxy": false,
        "subdirectory": false
    },
    "services": {
        "images": "imagick",
        "favicons": "default",
        "previews": "default",
        "security": "hibp",
        "words": "leipzig",
        "previewApi": false,
        "faviconApi": false
    },
    "status": {
        "autoBackupRestored": false
    },
    "settings": {
        "channel": "stable",
        "nightlies": false,
        "handbook": false,
        "performance": 5
    },
    "encryption": {
        "sse": {
            "SSEv1r1": false,
            "SSEv1r2": true,
            "SSEv2r1": false,
            "SSEv3r1": false,
            "none": true,
            "default": "SSEv1r2"
        },
        "cse": {
            "CSEv1r1": true,
            "none": true,
            "default": "none"
        }
    }
}

Client Information

Browser and Version: Firefox V 111.0.1 (64 bits)
Client OS and Version: Ubuntu 20.04 LTS

Bug description

When i try to share a password that a user (now deleted) shared to me, i have a bug: Resource not found
image

Steps to reproduce

  1. Create user 1
  2. User 1 create password 1
  3. User 1 share password 1 to User 2
  4. User Admin delete the NC account of User 1
  5. User 2 try to share the password to User 3
  6. The bug appear

Note: User 2 can still see and use the Password 1, but can't share it

Expected behavior

It should be possible to edit and share Password 1 without having to create a new one.

Option 1: Create a way to transfer the ownership of the password to another user (like for nextcloud file)

Nextcloud Logs

[passwords] Fatal: OCP\AppFramework\Db\DoesNotExistException: Did expect one result but found none when executing: query "SELECT * FROM `*PREFIX*passwords_share` WHERE (`deleted` = :dcValue1) AND ((`user_id` = :dcValue2) OR ((`receiver` = :dcValue3) AND (`target_password` IS NOT NULL))) AND (`uuid` = :dcValue4)";  at <<closure>>

 0. /var/www/html/nextcloud/lib/public/AppFramework/Db/QBMapper.php line 362
    OCP\AppFramework\Db\QBMapper->findOneQuery()
 1. /var/www/html/nextcloud/apps/passwords/lib/Db/AbstractMapper.php line 194
    OCP\AppFramework\Db\QBMapper->findEntity()
 2. /var/www/html/nextcloud/apps/passwords/lib/Db/AbstractMapper.php line 167
    OCA\Passwords\Db\AbstractMapper->findOneByFields()
 3. /var/www/html/nextcloud/apps/passwords/lib/Db/AbstractMapper.php line 107
    OCA\Passwords\Db\AbstractMapper->findOneByField()
 4. /var/www/html/nextcloud/apps/passwords/lib/Services/Object/ShareService.php line 155
    OCA\Passwords\Db\AbstractMapper->findByUuid()
 5. /var/www/html/nextcloud/apps/passwords/lib/Helper/ApiObjects/PasswordObjectHelper.php line 293
    OCA\Passwords\Services\Object\ShareService->findByUuid()
 6. /var/www/html/nextcloud/apps/passwords/lib/Helper/ApiObjects/PasswordObjectHelper.php line 129
    OCA\Passwords\Helper\ApiObjects\PasswordObjectHelper->getShares()
 7. /var/www/html/nextcloud/apps/passwords/lib/Controller/Api/AbstractObjectApiController.php line 145
    OCA\Passwords\Helper\ApiObjects\PasswordObjectHelper->getApiObject()
 8. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Passwords\Controller\Api\AbstractObjectApiController->show()
 9. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
10. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
11. /var/www/html/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
12. /var/www/html/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
13. /var/www/html/nextcloud/index.php line 36
    OC::handleRequest()

POST /index.php/apps/passwords/api/1.0/password/show
from 93.0.57.167 by Cyprien at 2023-04-05T17:21:56+00:00


-----

[passwords] Erreur: Error "Did expect one result but found none when executing: query "SELECT * FROM `*PREFIX*passwords_share` WHERE (`deleted` = :dcValue1) AND ((`user_id` = :dcValue2) OR ((`receiver` = :dcValue3) AND (`target_password` IS NOT NULL))) AND (`uuid` = :dcValue4)"; " in OCA\Passwords\Controller\Api\PasswordApiController::show

POST /index.php/apps/passwords/api/1.0/password/show
from 93.0.57.167 by Cyprien at 2023-04-05T17:21:56+00:00

Browser Logs

No response

@CypLef CypLef added the bug Something in the app is not working as expected label Apr 5, 2023
@mokkin
Copy link

mokkin commented Aug 2, 2023

I have the same issue here.

@marius-wieschollek
Copy link
Owner

I will look into this. But FYI: If a user gets deleted, the intended process is to delete all their data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something in the app is not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants