mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
"t is null error" Vaultwarden + AD #1652
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ptzetaa on GitHub (Jul 31, 2023).
Subject of the issue
I sync my vaultwarden with AD using Bitwarden Directory Connector but when i try to confirm a user "t is null" error appears .
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: ADMIN_TOKEN
Install method: docker image
Clients used: web vault
Reverse proxy and version:
MySQL/MariaDB or PostgreSQL version:
Other relevant details:
Steps to reproduce
Sync AD with vaultwarden, go to the org, try to confirm an userExpected behaviour
confirm usersActual behaviour
"t is null" error displayedTroubleshooting data
no error logs@BlackDex commented on GitHub (Jul 31, 2023):
There should be some logs report this.
Try to set the log_level to debug and try again.
Without some useful logs I'm afraid we can't reproduce it correctly or know where to look at all.
@ptzetaa commented on GitHub (Jul 31, 2023):
How can i set the log level?
@BlackDex commented on GitHub (Jul 31, 2023):
Configure the env variable
LOG_LEVEL=debug@ptzetaa commented on GitHub (Jul 31, 2023):
I dont know if ive done it good but im getting only this:
[2023-07-31 12:42:46.842][start][INFO] Rocket has launched from https://0.0.0.0:80
[2023-07-31 12:42:51.877][request][INFO] GET /api/config
[2023-07-31 12:42:51.878][response][INFO] (config) GET /api/config => 200 OK
[2023-07-31 12:42:51.917][request][INFO] POST /identity/connect/token
[2023-07-31 12:42:51.926][response][INFO] (login) POST /identity/connect/token => 200 OK
[2023-07-31 12:42:51.957][request][INFO] GET /api/sync?excludeDomains=true
[2023-07-31 12:42:51.960][response][INFO] (sync) GET /api/sync?<data..> => 200 OK
[2023-07-31 12:42:52.009][request][INFO] GET /api/config
[2023-07-31 12:42:52.010][response][INFO] (config) GET /api/config => 200 OK
[2023-07-31 12:42:55.742][request][INFO] GET /api/organizations/5f1201a2-6aa5-4260-8fb5-cf60e92e2db5/users?includeCollections=true
[2023-07-31 12:42:55.747][response][INFO] (get_org_users) GET /api/organizations/<org_id>/users?<data..> => 200 OK
[2023-07-31 12:42:55.750][request][INFO] GET /api/organizations/5f1201a2-6aa5-4260-8fb5-cf60e92e2db5/collections
[2023-07-31 12:42:55.752][response][INFO] (get_org_collections) GET /api/organizations/<org_id>/collections => 200 OK
[2023-07-31 12:42:55.753][request][INFO] GET /notifications/hub?access_token=eyJ0eXAiOiJKV1QiL
[2023-07-31 12:42:55.753][vaultwarden::api::notifications][INFO] Accepting Rocket WS connection from 172.16.150.89
[2023-07-31 12:42:55.754][response][INFO] (websockets_hub) GET /notifications/hub?<data..> => 200 OK
[2023-07-31 12:42:57.474][request][INFO] GET /api/users/c6cd01a5-5e03-46c7-8e6d-fee127c615e8/public-key
[2023-07-31 12:42:57.476][response][INFO] (get_public_keys) GET /api/users//public-key => 200 OK
@BlackDex commented on GitHub (Jul 31, 2023):
But now we need the logs during the time you get the error because these logs do not seem to contain anything in regards to confirming a user.
@BlackDex commented on GitHub (Jul 31, 2023):
I quickly tested this again, and it works just fine. So, unless you can provide some more logs which shows an error, or maybe browser error's via F12 Developer Console, I think this is a configuration issues on your side.
I see that the Admin panel shows a Domain issue, that could be because you access the admin page internally, but it could also mean configuration issues. And I see it complains on HTTPS, if you did not used HTTP, that could cause issues as well, the web-vault is not designed to be access without HTTPS (unless accessed via localhost).
@stefan0xC commented on GitHub (Jul 31, 2023):
@ptzetaa I think the users don't actually exist und they'll have to create an account before you can confirm them.
@BlackDex Can you test this without SMTP enabled? I think the issue might be that the users are accepted in the
importfunction so they show up even though they shouldn't:3dbfc484a5/src/api/core/organizations.rs (L1893-L1900)I believe there is a check missing because the
User::find_by_email()function will find invited "Users" too whereuser.password_hash.is_empty()@BlackDex commented on GitHub (Jul 31, 2023):
That seems to do the trick indeed @stefan0xC.
The reason is, because there is no
publicKeydefined.That is something we need to fix i guess.
@BlackDex commented on GitHub (Jul 31, 2023):
@stefan0xC, that is actually the wrong endpoint you were looking at ;).
We need to do some chores in regards to cleanup old code I think (But that could break environments using that endpoint).
Also looking at the code above and other parts, i actually think we need to changes more stuff to consolidate this all a bit more.
Now we create users and org-users in several places in different ways which doesn't make it better and more error prone i think.
@BlackDex commented on GitHub (Jul 31, 2023):
@ptzetaa Fix created and i tested the same setup, and it seems to work now.
Thanks for the report!
@ptzetaa commented on GitHub (Aug 1, 2023):
Thanks mate! Im going to try it
How can I pull the new docker version or change that line?
@ptzetaa commented on GitHub (Aug 1, 2023):
The Bitwarden Directory Connector only sync the users (emails) to vaultwarden or also its sync the AD passwords for the users to log-in?
@BlackDex commented on GitHub (Aug 1, 2023):
There is no new image yet. There is a PR open which needs to be merged before it will build a new
testingimage.Passwords can not be synced, the format is not the same, and Bitwarden needs an actual password.
The Directory Connector only manage the users by creating or removing them, and adding them to groups (if enabled).
Users will then, if enabled, receive an invite mail and once registered they need to be confirmed, and after that they are able to access the Org vault.
@ptzetaa commented on GitHub (Aug 1, 2023):
Okay thanks