marius-wieschollek / passwords

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

[BUG]: Error after upgrade from 2023.1.13 LSR to 2023.2.21 : A().crypto_pwhash is not a function #576

Closed CypLef closed 1 year ago

CypLef commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Server Information

{
    "version": {
        "server": "25.0.3.2",
        "app": "2023.2.21",
        "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 109.0.1 (64 bits) Client OS and Version: Ubuntu 20.04 LTS

Bug description

When i try to write my masterpassword in https://mycloud.domain/apps/passwords/, i have this error: A().crypto_pwhash is not a function image

So i can't log into passwords anymore, and i can't access to any of my passwords or

Steps to reproduce

  1. Have password app with masterpassword (encryption enabled)
  2. upgrade nextcloud 23 to 24 and to 25
  3. upgrade password app LSR to the latest LSR available (2023.1.13 for NC 25)
  4. upgrade php7.4 to php8.1
  5. upgrade password app from 2023.1.13 (LSR) to 2023.2.21
  6. go to https://youcloud.domain/apps/password
  7. Type your masterpassword

Expected behavior

No error should appear. I should be able to log into my passwords apps and see all my passwords: before login: image after login: image

Nextcloud Logs

i have two different type of error, but i don't know if they are related to this:
[passwords] Fatal: OCP\AppFramework\Db\DoesNotExistException: 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)";  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/AbstractRevisionMapper.php line 69
    OCP\AppFramework\Db\QBMapper->findEntity()
 2. /var/www/html/nextcloud/apps/passwords/lib/Services/Object/AbstractRevisionService.php line 172
    OCA\Passwords\Db\AbstractRevisionMapper->findCurrentRevisionByModel()
 3. /var/www/html/nextcloud/apps/passwords/lib/Cron/SynchronizeShares.php line 401
    OCA\Passwords\Services\Object\AbstractRevisionService->findCurrentRevisionByModel()
 4. /var/www/html/nextcloud/apps/passwords/lib/Cron/SynchronizeShares.php line 325
    OCA\Passwords\Cron\SynchronizeShares->createNewPasswordRevision()
 5. /var/www/html/nextcloud/apps/passwords/lib/Cron/SynchronizeShares.php line 302
    OCA\Passwords\Cron\SynchronizeShares->updateTargetPasswords("*** sensitive parameters replaced ***")
 6. /var/www/html/nextcloud/apps/passwords/lib/Cron/SynchronizeShares.php line 114
    OCA\Passwords\Cron\SynchronizeShares->updatePasswords("*** sensitive parameters replaced ***")
 7. /var/www/html/nextcloud/apps/passwords/lib/Cron/AbstractTimedJob.php line 74
    OCA\Passwords\Cron\SynchronizeShares->runJob()
 8. /var/www/html/nextcloud/lib/private/BackgroundJob/Job.php line 54
    OCA\Passwords\Cron\AbstractTimedJob->run()
 9. /var/www/html/nextcloud/lib/private/BackgroundJob/TimedJob.php line 60
    OC\BackgroundJob\Job->execute()
10. /var/www/html/nextcloud/cron.php line 152
    OC\BackgroundJob\TimedJob->execute()

at 2023-02-17T14:06:10+00:00

And the second one:
[cron] Erreur: Error: Class 'Symfony\Polyfill\Php80\Php80' not found at <<closure>>

 0. /var/www/html/nextcloud/apps/passwords/lib/AppInfo/Application.php line 265
    str_starts_with()
 1. <<closure>>
    OCA\Passwords\AppInfo\Application->OCA\Passwords\AppInfo\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/html/nextcloud/3rdparty/symfony/polyfill-php80/bootstrap.php line 32
    spl_autoload_call()
 3. /var/www/html/nextcloud/apps/passwords/lib/AppInfo/Application.php line 265
    str_starts_with()
 4. <<closure>>
    OCA\Passwords\AppInfo\Application->OCA\Passwords\AppInfo\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/html/nextcloud/lib/private/Server.php line 687
    spl_autoload_call()
 6. /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 162
    OC\Server->OC\{closure}("*** sensitive parameters replaced ***")
 7. /var/www/html/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php line 122
    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensitive parameters replaced ***")
 8. /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 129
    Pimple\Container->offsetGet()
 9. /var/www/html/nextcloud/lib/private/ServerContainer.php line 136
    OC\AppFramework\Utility\SimpleContainer->query()
10. /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 57
    OC\ServerContainer->query()
11. /var/www/html/nextcloud/lib/private/Server.php line 1749
    OC\AppFramework\Utility\SimpleContainer->get()
12. /var/www/html/nextcloud/lib/base.php line 244
    OC\Server->getL10N()
13. /var/www/html/nextcloud/lib/base.php line 679
    OC::checkConfig()
14. /var/www/html/nextcloud/lib/base.php line 1144
    OC::init()
15. /var/www/html/nextcloud/cron.php line 43
    require_once("/var/www/html/nextcloud/lib/base.php")

at 2023-02-17T13:35:01+00:00
For the second one, it appears before i update php version in the crontab. now i don't have it anymore.

Browser Logs

Cette page utilise la propriété non standard « zoom ». Envisagez d’utiliser calc() dans les valeurs des propriétés pertinentes ou utilisez « transform » avec « transform-origin: 0 0 ». app.js:2:1249495
----
jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 184 globals.js:60:15
CypLef commented 1 year ago

precision: on my production instance of NC, i run passwords 2023.1.13 LSR with php 8.1 without any problem. "version": { "server": "25.0.3.2", "app": "2023.1.13", "lsr": true, "php": "8.1.16", "cronPhp": "8.1.16" } The error really came when i upgrade to the new version of passwords 2023.2.21

marius-wieschollek commented 1 year ago

I can reproduce the bug. apparently upgrading to libsodium 0.7.11 (the encryption library) has caused this

LoganHub1 commented 1 year ago

I am having the same issue in my instance of Snapcraft Nextcloud 25.03. I'm running PHP 8.0.27 (hoping that PHP will be updated in the snap soon). Is there a workaround in progress for this, or is there a way to downgrade to an older version of the passwords app? Thanks!

marius-wieschollek commented 1 year ago

You can download the latest version with a fix from the appstore already: https://apps.nextcloud.com/apps/passwords

LoganHub1 commented 1 year ago

Thanks so much! Trying to get the latest version to be recognized via occ app:update passwords but it doesn't seem to find it. Is the latest fix marked as a unstable/beta version that the system would not be able to grab?

For reference, the app is technically listed as 'Passwords (Legacy Support Release)' in my instance of nextcloud, probably due to the old version of PHP in the Snap..

Thanks a ton, appreciate the quick responses here.

marius-wieschollek commented 1 year ago

occ app:update does not check for new versions in the appstore. It can take up to a day until the local cache is updated.

You can try again in 1 - 2 hours with the command or download the app manually from the appstore (you need 2023.2.12 if you have the Legacy Support Release).

LoganHub1 commented 1 year ago

Got it, it finally showed up in the update list. Thank you for the help, I appreciate all that you do!

CypLef commented 1 year ago

The update works well! thanks a lot @marius-wieschollek !