marius-wieschollek / passwords

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

[BUG]: Unable to verify user on 30.0.2 RC1 #683

Closed blizzz closed 2 weeks ago

blizzz commented 3 weeks ago

⚠️ This issue respects the following points: ⚠️

Server Information

{
    "version": {
        "server": "30.0.2.0",
        "app": "2024.11.20-build5581",
        "lsr": false,
        "php": "8.3.6",
        "cronPhp": "8.3.6"
    },
    "environment": {
        "os": "Linux",
        "architecture": "x86_64",
        "bits": 64,
        "database": "mysql",
        "cron": "cron",
        "proxy": false,
        "sslProxy": false,
        "subdirectory": false
    },
    "services": {
        "images": "imaginary",
        "favicons": "default",
        "previews": "default",
        "security": "hibp",
        "words": "auto",
        "previewApi": false,
        "faviconApi": false
    },
    "settings": {
        "channel": "beta",
        "nightlies": false,
        "handbook": false,
        "performance": 5
    },
    "status": {
        "autoBackupRestored": false
    },
    "apps": {
        "guests": {
            "installed": true,
            "enabled": true
        },
        "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": 10
    },
    "encryption": {
        "sse": {
            "SSEv1r1": false,
            "SSEv1r2": true,
            "SSEv2r1": false,
            "SSEv3r1": false,
            "none": false,
            "default": "SSEv1r2"
        },
        "cse": {
            "CSEv1r1": false,
            "none": true,
            "default": "none"
        }
    }
}

### Client Information

unrelated

### Bug description

With 30.0.2 RC1, passwords cause a 500 on, for example, dashboard and the admin settings page, and passwords itself obviously.  `Login attempt with invalid session for $USERID` and `Unable to verify user $USERID` are logged (full log see below). 

The root cause it that passwords directly looks up the `login_credentials` information from the session instead of using the API provided by `OCP\Authentication\LoginCredentials\IStore`. And its format has changed in https://github.com/nextcloud/server/pull/48939

### Steps to reproduce

1. Update to 30.0.2 RC1 (beta channel)
2. Open Dashboard, or admin settings, or passwords itself
3. see the internal error page

### Expected behavior

1. It continues to work as before

### Nextcloud Logs

```shell
{
  "reqId": "QvZuldoTfZWiuCbwNnKN",
  "level": 2,
  "time": "2024-11-01T08:52:29+00:00",
  "remoteAddr": "REDACTED",
  "user": "$USERID",
  "app": "passwords",
  "method": "GET",
  "url": "/settings/admin/overview",
  "message": "Login attempt with invalid session for $USERID",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0",
  "version": "30.0.2.0",
  "data": {
    "app": "passwords"
  }
}
{
  "reqId": "QvZuldoTfZWiuCbwNnKN",
  "level": 3,
  "time": "2024-11-01T08:52:29+00:00",
  "remoteAddr": "REDACTED",
  "user": "$USERID",
  "app": "index",
  "method": "GET",
  "url": "/settings/admin/overview",
  "message": "Unable to verify user $USERID",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0",
  "version": "30.0.2.0",
  "exception": {
    "Exception": "Exception",
    "Message": "Unable to verify user $USERID",
    "Code": 0,
    "Trace": [
      {
        "file": "/path/to/nextcloud/apps/passwords/lib/Services/EnvironmentService.php",
        "line": 361,
        "function": "loadUserInformation",
        "class": "OCA\\Passwords\\Services\\EnvironmentService",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/apps/passwords/lib/Services/EnvironmentService.php",
        "line": 185,
        "function": "determineAppMode",
        "class": "OCA\\Passwords\\Services\\EnvironmentService",
        "type": "->"
      },
      {
        "function": "__construct",
        "class": "OCA\\Passwords\\Services\\EnvironmentService",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 61,
        "function": "newInstanceArgs",
        "class": "ReflectionClass",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 106,
        "function": "buildClass",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 124,
        "function": "resolve",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 448,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 420,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 74,
        "function": "query",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "function": "OC\\AppFramework\\Utility\\{closure}",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 61,
        "function": "array_map"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 106,
        "function": "buildClass",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 124,
        "function": "resolve",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 448,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 420,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 74,
        "function": "query",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "function": "OC\\AppFramework\\Utility\\{closure}",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 61,
        "function": "array_map"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 106,
        "function": "buildClass",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 124,
        "function": "resolve",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
        "line": 448,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/ServerContainer.php",
        "line": 137,
        "function": "queryNoFallback",
        "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 42,
        "function": "query",
        "class": "OC\\ServerContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/Settings/Manager.php",
        "line": 175,
        "function": "get",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/Settings/Manager.php",
        "line": 323,
        "function": "getSettings",
        "class": "OC\\Settings\\Manager",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 70,
        "function": "getAllowedAdminSettings",
        "class": "OC\\Settings\\Manager",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 105,
        "function": "formatSections",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 55,
        "function": "formatAdminSections",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",
        "line": 141,
        "function": "getNavigationParameters",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php",
        "line": 58,
        "function": "getIndexResponse",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 208,
        "function": "index",
        "class": "OCA\\Settings\\Controller\\AdminSettingsController",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/path/to/nextcloud/lib/base.php",
        "line": 1001,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/path/to/nextcloud/index.php",
        "line": 24,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/path/to/nextcloud/apps/passwords/lib/Services/EnvironmentService.php",
    "Line": 398,
    "message": "Unable to verify user $USERID",
    "exception": {},
    "CustomMessage": "Unable to verify user $USERID"
  }
}


### Browser Logs

_No response_
ozgurkazancci commented 2 weeks ago

Updated my Nextcloud from 30.0.1 to Nextcloud 30.0.2, then bam! Login failed (Internal Server Error), the log file says;

(“message”:“Login attempt with invalid session for myuser)

I did: sudo -u www php occ app:disable passwords and now I can log in again.

Figoware commented 2 weeks ago

Same here!

VeloAddict commented 2 weeks ago

A release with a fix would be nice.

EnercoopJNE commented 2 weeks ago

Same ! I rely too much on Passwords to be able to disable it... Luckily the client synchro is still working, it only affects webUI. Looking forward to the apparently upcoming fix ;)

mhzawadi commented 2 weeks ago

I dont use the passwords app, but too have this issue. Disabled the app and now works fine

ckraushaar commented 2 weeks ago

Same issue in Chrome with Nextcloud 29.0.9. Works in Firefox still but immediately pops up the bug in Chrome

kylespencer commented 2 weeks ago

This is a critical problem that urgently needs a resolution.

mpractic commented 2 weeks ago

Same here. @blizzz thanks for reporting it and finding the cause (https://github.com/nextcloud/server/pull/48939)

himpierre commented 2 weeks ago

Same issue in Chrome with Nextcloud 29.0.9. Works in Firefox still but immediately pops up the bug in Chrome

Is that true? 29.0.9 affected too? Can someone confirm this?

janmuennich commented 2 weeks ago

Is that true? 29.0.9 affected too? Can someone confirm this?

Yes. 29.0.9 affected too. Independent of browser.

michaave commented 2 weeks ago

Thank you very much for the fix, it's working great now!

michaave commented 2 weeks ago

For those who can't wait for the update, just erase the contents of your apps/passwords/lib/Services/EnvironmentService.php and copy/paste the contents of the file from here: https://github.com/blizzz/passwords/blob/6d6fdef9484b2e3ddbec718aee16e657674cf4ce/src/lib/Services/EnvironmentService.php

DIY89 commented 2 weeks ago

Thx for this quit tmp solution. Working fine for now

gelbphoenix commented 2 weeks ago

Works also for a bug where the Passwords app blocks the admin and user settings pages.

jans23 commented 2 weeks ago

For us the fix is not working. We use 2FA and OIDC and perhaps this is why it still fails in our case?

"reqId":"1PlTbUawP9BdEJ1Bimvw","level":2,"time":"2024-11-07T15:32:17+00:00","remoteAddr":"87.138....","user":"jan","app":"passwords","method":"GET","url":"/apps/passwords/","message":"Login attempt with invalid session for jan","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"29.0.9.2","data":{"app":"passwords"}} {"reqId":"1PlTbUawP9BdEJ1Bimvw","level":3,"time":"2024-11-07T15:32:17+00:00","remoteAddr":"87.138....","user":"jan","app":"index","method":"GET","url":"/apps/passwords/","message":"Unable to verify user jan","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"29.0.9.2","exception":{"Exception":"Exception","Message":"Unable to verify user jan","Code":0,"Trace":[{"file":"/var/www/nextcloud/passwords.patched/src/lib/Services/EnvironmentService.php","line":365,"function":"loadUserInformation","class":"OCA\Passwords\Services\EnvironmentService","type":"->"},{"file":"/var/www/nextcloud/passwords.patched/src/lib/Services/EnvironmentService.php","line":189,"function":"determineAppMode","class":"OCA\Passwords\Services\EnvironmentService","type":"->"},{"function":"__construct","class":"OCA\Passwords\Services\EnvironmentService","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"function":"OC\AppFramework\Utility\{closure}","class":"OC\AppFramework\Utility\SimpleContainer","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"function":"OC\AppFramework\Utility\{closure}","class":"OC\AppFramework\Utility\SimpleContainer","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"function":"OC\AppFramework\Utility\{closure}","class":"OC\AppFramework\Utility\SimpleContainer","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"function":"OC\AppFramework\Utility\{closure}","class":"OC\AppFramework\Utility\SimpleContainer","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\AppFramework\Utility\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/AppFramework/App.php","line":163,"function":"query","class":"OC\AppFramework\DependencyInjection\DIContainer","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/lib/private/Route/Router.php","line":331,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/www/nextcloud/lib/base.php","line":1058,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/nextcloud/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/passwords.patched/src/lib/Services/EnvironmentService.php","Line":409,"message":"Unable to verify user jan","exception":{},"CustomMessage":"Unable to verify user jan"}}

mehdiMj-ir commented 2 weeks ago

Just updated my Nextcloud instance to 30.0.2 and yes I had 500 and panicked for a second and fixed with above comment Thanks.

benoit-smith commented 2 weeks ago

THANK YOU! Just encountered the bug after upgrading to 29.0.9, fixed by disabling Passwords...

squid-f commented 2 weeks ago

For those who can't wait for the update, just erase the contents of your apps/passwords/lib/Services/EnvironmentService.php and copy/paste the contents of the file from here: https://github.com/blizzz/passwords/blob/6d6fdef9484b2e3ddbec718aee16e657674cf4ce/src/lib/Services/EnvironmentService.php

doesn't work for me. I reach a password github page after connecting. Server 29.0.9.2

joergmschulz commented 2 weeks ago

does not seem to work for users logging in with OIDC (as opposed to native users). Do you need more info on this?

TropicLegend commented 2 weeks ago

Bug is still present and needs fixing. {"reqId":"mtgdyTyFfNEUdgTy1HTa","level":3,"time":"2024-11-09T11:49:36+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"amani","app":"index","method":"GET","url":"/apps/dashboard/","message":"Unable to verify user amani","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","version":"29.0.9.2","exception":{"Exception":"Exception","Message":"Unable to verify user amani","Code":0,"Trace":[{"file":"/var/www/html/apps/passwords/lib/Services/EnvironmentService.php","line":361,"function":"loadUserInformation","class":"OCA\\Passwords\\Services\\EnvironmentService","type":"->"},{"file":"/var/www/html/apps/passwords/lib/Services/EnvironmentService.php","line":185,"function":"determineAppMode","class":"OCA\\Passwords\\Services\\EnvironmentService","type":"->"},{"function":"__construct","class":"OCA\\Passwords\\Services\\EnvironmentService","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":443,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":96,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":83,"function":"array_map"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":471,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":64,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/html/lib/private/Dashboard/Manager.php","line":83,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/html/lib/private/Dashboard/Manager.php","line":146,"function":"loadLazyPanels","class":"OC\\Dashboard\\Manager","type":"->"},{"file":"/var/www/html/apps/dashboard/lib/Controller/DashboardController.php","line":82,"function":"getWidgets","class":"OC\\Dashboard\\Manager","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"index","class":"OCA\\Dashboard\\Controller\\DashboardController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":331,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1058,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/apps/passwords/lib/Services/EnvironmentService.php","Line":398,"message":"Unable to verify user amani","exception":{},"CustomMessage":"Unable to verify user amani"}}

[Nextcloud Hub 8 (29.0.9)

squid-f commented 2 weeks ago

does not seem to work for users logging in with OIDC (as opposed to native users). Do you need more info on this?

if the question was for me, thanks, no, I have deactivated the password app and I am awaiting for the update.

Anduin2017 commented 2 weeks ago

For those who can't wait for the update, just erase the contents of your apps/passwords/lib/Services/EnvironmentService.php and copy/paste the contents of the file from here: https://github.com/blizzz/passwords/blob/6d6fdef9484b2e3ddbec718aee16e657674cf4ce/src/lib/Services/EnvironmentService.php

Thanks for the solution. It worked for me!!

a3linux commented 2 weeks ago

I tested the quick fix and. found it works for Nextcloud native user, but do not work for SSO users. Could anyone confirm this?

janmuennich commented 2 weeks ago

I tested the quick fix and. found it works for Nextcloud native user, but do not work for SSO users. Could anyone confirm this?

Yes. Experienced the same on 29.0.9. Fix worked for native admin user but not for SSO users. Did a rollback to 29.0.8 until this is fixed.

marius-wieschollek commented 2 weeks ago

It seems like the behavior has changed with the update and NC now returns an empty string as user password instead of null if the user uses an SSO login method. I have added a patch to the latest nightly to include this case.

Can some of the affected users confirm that build 5587 works for you?

It's available in the app store or here: https://git.mdns.eu/nextcloud/passwords/-/packages/215

joergmschulz commented 2 weeks ago

installed 5587. My nc test environment does not crash any longer. The issue seems to be fixed now. Thank you for your patience and swift reaction. @janmuennich can you confirm as well? 2 witnesses are better than one

marius-wieschollek commented 2 weeks ago

well then off to release :horse_racing:

a3linux commented 2 weeks ago

I tried again with SSO user today and I found the fix also works. I wonder it require to refresh the session or something there. I can open the passwords app and dashboard with SSO user too. NC 30.0.2. Applied the quick fix EnvironmentService.php to password app. Thanks.

fyah commented 2 weeks ago

Hello, Running nextcloud 30.0.2, password app just updated to 2024.11.20. Still having the problem, when password app in enabled: "message":"Login attempt with invalid session for xxxx"

"Trace":[{"file":"/var/www/html/custom_apps/passwords/lib/Services/EnvironmentService.php"
"line":361
"function":"loadUserInformation"
"class":"OCA\\Passwords\\Services\\EnvironmentService"
"type":"->"
"args":["xxx"
{"__class__":"OC\\AppFramework\\Http\\Request"}]}
squid-f commented 2 weeks ago

Hi. I had disabled the password app; unchanged apps/passwords/lib/Services/EnvironmentService.php Then, after updating password to 2024.11.20 and enabling it again, there is no issue anymore, with or without SSO login. Server 29.0.9

durfejs commented 2 weeks ago

Z

For those who can't wait for the update, just erase the contents of your apps/passwords/lib/Services/EnvironmentService.php and copy/paste the contents of the file from here: https://github.com/blizzz/passwords/blob/6d6fdef9484b2e3ddbec718aee16e657674cf4ce/src/lib/Services/EnvironmentService.php This helped but a fix is needed

maedball commented 2 weeks ago

Hi. I had disabled the password app; unchanged apps/passwords/lib/Services/EnvironmentService.php Then, after updating password to 2024.11.20 and enabling it again, there is no issue anymore, with or without SSO login. Server 29.0.9

Tried this without success :-(. After enabling the app it is back to the issue.

Server 30.0.2

janmuennich commented 2 weeks ago

installed 5587. My nc test environment does not crash any longer. The issue seems to be fixed now. Thank you for your patience and swift reaction. @janmuennich can you confirm as well? 2 witnesses are better than one

Can confirm that the nightly build works for me as well. Thanks all!

fyah commented 2 weeks ago

Hello, Running nextcloud 30.0.2, password app just updated to 2024.11.20. Still having the problem, when password app in enabled: "message":"Login attempt with invalid session for xxxx"

"Trace":[{"file":"/var/www/html/custom_apps/passwords/lib/Services/EnvironmentService.php"
"line":361
"function":"loadUserInformation"
"class":"OCA\\Passwords\\Services\\EnvironmentService"
"type":"->"
"args":["xxx"
{"__class__":"OC\\AppFramework\\Http\\Request"}]}

Note for the docker users. I had to restart the containers in order for the fix to apply. The update of the password app alone was not sufficient

Conclusion: 30.0.2 + pwd 2024.11.20 + restart containers = Problem solved

marius-wieschollek commented 2 weeks ago

I will lock this issue now. Version 2024.11.* contains the patch for the bug identified in this issue and i can no longer reproduce the issue with the provided information. If you are still experiencing issues with the latest version please file a new bug report and include precise details about your setup where not the default is used.