marius-wieschollek / passwords

A simple, yet feature rich password manager for Nextcloud
GNU Affero General Public License v3.0
215 stars 45 forks source link

Sharing password can not complete, user icons keep spinning #421

Closed novakg closed 1 year ago

novakg commented 3 years ago

System Information

Server:

{
    "version": {
        "server": "22.1.0.1",
        "app": "2021.7.23",
        "lsr": false,
        "php": "7.4.22"
    },
    "environment": {
        "os": "Linux",
        "architecture": "x86_64",
        "bits": 64,
        "database": "mysql",
        "cron": "cron",
        "proxy": false,
        "sslProxy": true,
        "subdirectory": false
    },
    "legacyApi": {
        "enabled": 0,
        "used": false
    },
    "services": {
        "images": "imagick",
        "favicons": "default",
        "previews": "default",
        "security": "hibp",
        "words": "random",
        "previewApi": false,
        "faviconApi": false
    },
    "settings": {
        "channel": "stable",
        "nightlies": false,
        "handbook": false,
        "performance": 5
    },
    "encryption": {
        "sse": {
            "SSEv1r1": false,
            "SSEv1r2": true,
            "SSEv2r1": false,
            "none": false,
            "default": "SSEv1r2"
        },
        "cse": {
            "CSEv1r1": false,
            "none": true,
            "default": "none"
        }
    }
}

Client:

 Browser and Version:
Firefox 78.13.0esr on Linux
 Client OS and Version:

Steps to reproduce

  1. Create a new password, or select an existing one
  2. Open the Share tab of it
  3. Select a person to share with

I've also tried running occ config:app:delete passwords cron/sharing/time. It solves the problem for some seconds, but in case I share another pw, I experience the same issue again.

Expected result

What should happen? The sharing process should complete and the spinning circle should disappear from the user's icon.

Actual result

What does happen? The selected person remains in the list even when I reload the page (this is good), but the spinning wheel remains on their icon and when I move my mouse over the icon, I can see: "Some data is waiting to be synchronized"

I can see requests going to /index.php/apps/passwords/cron/sharing, but the response is always {"success":false}

Nextcloud log

Nextcloud log ``` {"reqId":"vbBhjGZVkXPglDx5mQ7V","level":4,"time":"2021-08-18T12:58:39+00:00","remoteAddr":"89.134.236.188","user":"admin","app":"passwords","method":"GET","url":"/index.php/apps/passwords/cron/sharing","message":"Did expect one result but found none when executing: query \"SELECT `a`.* FROM `*PREFIX*passwords_password_rv` `a` INNER JOIN `*PREFIX*passwords_password` `b` ON a.`model` = b.`uuid` WHERE (`a`.`deleted` = :dcValue1) AND (`b`.`user_id` = `a`.`user_id`) AND (`b`.`revision` = `a`.`uuid`) AND (`b`.`uuid` = :dcValue2)\"; ","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"22.1.0.1","exception":{"Exception":"OCP\\AppFramework\\Db\\DoesNotExistException","Message":"Did expect one result but found none when executing: query \"SELECT `a`.* FROM `*PREFIX*passwords_password_rv` `a` INNER JOIN `*PREFIX*passwords_password` `b` ON a.`model` = b.`uuid` WHERE (`a`.`deleted` = :dcValue1) AND (`b`.`user_id` = `a`.`user_id`) AND (`b`.`revision` = `a`.`uuid`) AND (`b`.`uuid` = :dcValue2)\"; ","Code":0,"Trace":[{"file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php","line":361,"function":"findOneQuery","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[{"__class__":"OC\\DB\\QueryBuilder\\QueryBuilder"}]},{"file":"/var/www/html/custom_apps/passwords/lib/Db/AbstractRevisionMapper.php","line":39,"function":"findEntity","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[{"__class__":"OC\\DB\\QueryBuilder\\QueryBuilder"}]},{"file":"/var/www/html/custom_apps/passwords/lib/Services/Object/AbstractRevisionService.php","line":136,"function":"findCurrentRevisionByModel","class":"OCA\\Passwords\\Db\\AbstractRevisionMapper","type":"->","args":["6f41628a-8644-4e88-8611-cb7b16814823"]},{"file":"/var/www/html/custom_apps/passwords/lib/Cron/SynchronizeShares.php","line":401,"function":"findCurrentRevisionByModel","class":"OCA\\Passwords\\Services\\Object\\AbstractRevisionService","type":"->","args":["6f41628a-8644-4e88-8611-cb7b16814823",true]},{"file":"/var/www/html/custom_apps/passwords/lib/Cron/SynchronizeShares.php","line":325,"function":"createNewPasswordRevision","class":"OCA\\Passwords\\Cron\\SynchronizeShares","type":"->","args":["f724fff4-b0c7-4446-9b05-08a55682c591","6f41628a-8644-4e88-8611-cb7b16814823"]},{"file":"/var/www/html/custom_apps/passwords/lib/Cron/SynchronizeShares.php","line":302,"function":"updateTargetPasswords","class":"OCA\\Passwords\\Cron\\SynchronizeShares","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/custom_apps/passwords/lib/Cron/SynchronizeShares.php","line":114,"function":"updatePasswords","class":"OCA\\Passwords\\Cron\\SynchronizeShares","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/custom_apps/passwords/lib/Cron/SynchronizeShares.php","line":126,"function":"runJob","class":"OCA\\Passwords\\Cron\\SynchronizeShares","type":"->","args":[null]},{"file":"/var/www/html/custom_apps/passwords/lib/Controller/CronController.php","line":54,"function":"runManually","class":"OCA\\Passwords\\Cron\\SynchronizeShares","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"execute","class":"OCA\\Passwords\\Controller\\CronController","type":"->","args":["sharing"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Passwords\\Controller\\CronController"},"execute"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Passwords\\Controller\\CronController"},"execute"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Passwords\\Controller\\CronController","execute",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"job":"sharing","_route":"passwords.cron.execute"}]},{"file":"/var/www/html/lib/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/passwords/cron/sharing"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php","Line":283,"CustomMessage":"Did expect one result but found none when executing: query \"SELECT `a`.* FROM `*PREFIX*passwords_password_rv` `a` INNER JOIN `*PREFIX*passwords_password` `b` ON a.`model` = b.`uuid` WHERE (`a`.`deleted` = :dcValue1) AND (`b`.`user_id` = `a`.`user_id`) AND (`b`.`revision` = `a`.`uuid`) AND (`b`.`uuid` = :dcValue2)\"; "},"id":"611d07b6ca6ff"} ```

Browser log

Browser log ``` No OC found index.js:46:12 JQMIGRATE: Migrate is installed, version 3.3.2 jquery-migrate.min.js:2:708 jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15 jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:62:15 Proxying an event bus of version 1.3.0 with 2.0.0 ProxyBus.ts:17:12 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:62:15 jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:62:15 $ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:62:15 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment 2 util.js:135:11 ```
CypLef commented 3 years ago

I have the same error: OCP\AppFramework\Db\DoesNotExistException: Did expect one result but found none when executing: query "SELECT a. FROM `PREFIXpasswords_password_rv`a INNER JOIN `PREFIX*passwords_password`b ON a.model = b.uuid WHERE (a.deleted = :dcValue1) AND (b.user_id = a.user_id) AND (b.revision = a.uuid) AND (b.uuid = :dcValue2)";

And i have no column pwid or other like mentionned in #433 . I guess the bug come from somewhere else

leuedaniel commented 2 years ago

Same here

marius-wieschollek commented 2 years ago

@leuedaniel Do you have the same error message?

leuedaniel commented 2 years ago

@leuedaniel Do you have the same error message?

Yes it's the same: OCP\AppFramework\Db\DoesNotExistException: Did expect one result but found none when executing: query "SELECTa.* FROMPREFIXpasswords_password_rv`a INNER JOIN *PREFIX*passwords_password b ON a.model = b.uuid WHERE (a.deleted = :dcValue1) AND (b.user_id = a.user_id) AND (b.revision = a.uuid) AND (b.uuid = :dcValue2)";`

marius-wieschollek commented 2 years ago

in that case i would recommend running php ./occ maintenace:repair from the root directory of your nextcloud installation. This seems like a data consistency issue to me

leuedaniel commented 2 years ago

After repair, pending shares works now. But when i share a new password with another user, i've the same problem with the same log message.

michel-thomas commented 1 year ago

Hello,

I have the same problem only with Firefox browser (version 111.0 on Ubuntu 22.04). No problem with Chromium.

Running occ maintenance:repair does not solve anything.

I occurs mostly for the second sharing, but sometimes also for first sharing.

friedrichkeydel commented 1 year ago

got the exact same issue on the following setup:

{
    "version": {
        "server": "26.0.2.1",
        "app": "2023.5.30",
        "lsr": false,
        "php": "8.1.16",
        "cronPhp": "8.1.16"
    },
    "environment": {
        "os": "Linux",
        "architecture": "x86_64",
        "bits": 64,
        "database": "mysql",
        "cron": "webcron",
        "proxy": false,
        "sslProxy": false,
        "subdirectory": false
    },
    "services": {
        "images": "gdlib",
        "favicons": "fg",
        "previews": "pageres",
        "security": "hibp",
        "words": "leipzig",
        "previewApi": false,
        "faviconApi": false
    },
    "settings": {
        "channel": "stable",
        "nightlies": false,
        "handbook": false,
        "performance": 5
    },
    "status": {
        "autoBackupRestored": false
    },
    "apps": {
        "guests": {
            "installed": false,
            "enabled": false
        },
        "occweb": {
            "installed": false,
            "enabled": false
        },
        "theming": {
            "installed": false,
            "enabled": false
        },
        "passman": {
            "installed": false,
            "enabled": false
        },
        "unsplash": {
            "installed": false,
            "enabled": false
        },
        "impersonate": {
            "installed": false,
            "enabled": false
        },
        "passwords_handbook": {
            "installed": false,
            "enabled": false
        }
    },
    "sharing": {
        "shares": 501
    },
    "encryption": {
        "sse": {
            "SSEv1r1": false,
            "SSEv1r2": true,
            "SSEv2r1": false,
            "SSEv3r1": false,
            "none": false,
            "default": "SSEv1r2"
        },
        "cse": {
            "CSEv1r1": false,
            "none": true,
            "default": "none"
        }
    }
}
friedrichkeydel commented 1 year ago

I still get this error Passwords Version 2023.6.30 and Nextcloud Version 27.0.0. Working with passwords as a team is very difficult right now.

Are there any plans for investigating in this issue?

I'm also getting the following log message: Did expect one result but found none when executing: query \"SELECTa.* FROMPREFIXpasswords_password_rv`a INNER JOIN *PREFIX*passwords_password b ON a.model = b.uuid WHERE (a.deleted = :dcValue1) AND (b.user_id = a.user_id) AND (b.revision = a.uuid) AND (b.uuid = :dcValue2)`

I tried to solve this regarding this issue: https://github.com/marius-wieschollek/passwords/issues/225 I have a simmilar setup like described there (also all-inkl as shared hoster) and I also https://www.subdomain.domain.de/nextcloud/index.php/apps/passwords/cron/sharing returns {"success":false}.

I would really appreciate further investigations.

marius-wieschollek commented 1 year ago

I don't know what causes this, but from the log in the original ticket it seems that there is a share where the local copy in the account of the user with whom the password was shared "got lost".

I have made some changes in the nightly version of the app so that the background job no longer crashes when that happens and i added a migration which resets these shares.

friedrichkeydel commented 1 year ago

Hey Marius,

thanks for your fast reply and the effort to fix this. Unfortunatly I can not confirm it is fixed with the current nightly-build.

friedrichkeydel commented 1 year ago

I have to apologize - it seems to work fine now - maybe it needed some time or the right user to reset the lost share.

Thank you again for fixing this!