"t is null error" Vaultwarden + AD #1652

Closed
opened 2026-02-05 01:25:07 +03:00 by OVERLORD · 14 comments
Owner

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)

  • Vaultwarden version: v1.29.1
  • Web-vault version: v2023.5.0
  • OS/Arch: linux/x86_64
  • Running within Docker: true (Base: Debian)
  • Environment settings overridden: true
  • Uses a reverse proxy: false
  • Internet access: true
  • Internet access via a proxy: false
  • DNS Check: true
  • Browser/Server Time Check: true
  • Server/NTP Time Check: true
  • Domain Configuration Check: false
  • HTTPS Check: false
  • Database type: SQLite
  • Database version: 3.41.2
  • Clients used:
  • Reverse proxy and version:
  • Other relevant information:

Config (Generated via diagnostics page)

Show Running Config

Environment settings which are overridden: ADMIN_TOKEN

{
  "_duo_akey": null,
  "_enable_duo": true,
  "_enable_email_2fa": false,
  "_enable_smtp": true,
  "_enable_yubico": true,
  "_icon_service_csp": "",
  "_icon_service_url": "",
  "_ip_header_enabled": true,
  "_smtp_img_src": "cid:",
  "admin_ratelimit_max_burst": 3,
  "admin_ratelimit_seconds": 300,
  "admin_session_lifetime": 20,
  "admin_token": "***",
  "allowed_iframe_ancestors": "",
  "attachments_folder": "data/attachments",
  "authenticator_disable_time_drift": false,
  "data_folder": "data",
  "database_conn_init": "",
  "database_max_conns": 10,
  "database_timeout": 30,
  "database_url": "***************",
  "db_connection_retries": 15,
  "disable_2fa_remember": false,
  "disable_admin_token": false,
  "disable_icon_download": false,
  "domain": "****://************************",
  "domain_origin": "****://************************",
  "domain_path": "",
  "domain_set": true,
  "duo_host": null,
  "duo_ikey": null,
  "duo_skey": null,
  "email_attempts_limit": 3,
  "email_expiration_time": 600,
  "email_token_size": 6,
  "emergency_access_allowed": true,
  "emergency_notification_reminder_schedule": "0 3 * * * *",
  "emergency_request_timeout_schedule": "0 7 * * * *",
  "enable_db_wal": true,
  "event_cleanup_schedule": "0 10 0 * * *",
  "events_days_retain": null,
  "extended_logging": true,
  "helo_name": null,
  "hibp_api_key": null,
  "icon_blacklist_non_global_ips": true,
  "icon_blacklist_regex": null,
  "icon_cache_folder": "data/icon_cache",
  "icon_cache_negttl": 259200,
  "icon_cache_ttl": 2592000,
  "icon_download_timeout": 10,
  "icon_redirect_code": 302,
  "icon_service": "internal",
  "incomplete_2fa_schedule": "30 * * * * *",
  "incomplete_2fa_time_limit": 3,
  "invitation_expiration_hours": 120,
  "invitation_org_name": "Vaultwarden",
  "invitations_allowed": true,
  "ip_header": "X-Real-IP",
  "job_poll_interval_ms": 30000,
  "log_file": "/data/vaultwarden.log",
  "log_level": "Info",
  "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f",
  "login_ratelimit_max_burst": 10,
  "login_ratelimit_seconds": 60,
  "org_attachment_limit": null,
  "org_creation_users": "",
  "org_events_enabled": false,
  "org_groups_enabled": false,
  "password_hints_allowed": true,
  "password_iterations": 600000,
  "push_enabled": false,
  "push_installation_id": "***",
  "push_installation_key": "***",
  "push_relay_uri": "https://push.bitwarden.com",
  "reload_templates": false,
  "require_device_email": false,
  "rsa_key_filename": "data/rsa_key",
  "send_purge_schedule": "0 5 * * * *",
  "sendmail_command": null,
  "sends_allowed": true,
  "sends_folder": "data/sends",
  "show_password_hint": false,
  "signups_allowed": true,
  "signups_domains_whitelist": "",
  "signups_verify": false,
  "signups_verify_resend_limit": 6,
  "signups_verify_resend_time": 3600,
  "smtp_accept_invalid_certs": false,
  "smtp_accept_invalid_hostnames": false,
  "smtp_auth_mechanism": null,
  "smtp_debug": false,
  "smtp_embed_images": true,
  "smtp_explicit_tls": null,
  "smtp_from": "",
  "smtp_from_name": "Vaultwarden",
  "smtp_host": null,
  "smtp_password": null,
  "smtp_port": 587,
  "smtp_security": "starttls",
  "smtp_ssl": null,
  "smtp_timeout": 15,
  "smtp_username": null,
  "templates_folder": "data/templates",
  "tmp_folder": "data/tmp",
  "trash_auto_delete_days": null,
  "trash_purge_schedule": "0 5 0 * * *",
  "use_sendmail": false,
  "use_syslog": false,
  "user_attachment_limit": null,
  "web_vault_enabled": true,
  "web_vault_folder": "web-vault/",
  "websocket_address": "0.0.0.0",
  "websocket_enabled": false,
  "websocket_port": 3012,
  "yubico_client_id": null,
  "yubico_secret_key": null,
  "yubico_server": null
}
  • vaultwarden version: latest
  • 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 user

Expected behaviour

confirm users

Actual behaviour

"t is null" error displayed

Troubleshooting data

no error logs
Originally created by @ptzetaa on GitHub (Jul 31, 2023). <!-- # ### NOTE: Please update to the latest version of vaultwarden before reporting an issue! This saves you and us a lot of time and troubleshooting. See: * https://github.com/dani-garcia/vaultwarden/issues/1180 * https://github.com/dani-garcia/vaultwarden/wiki/Updating-the-vaultwarden-image # ### --> <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unnecessary for your issue, feel free to remove them. Remember to hide/redact personal or confidential information, such as passwords, IP addresses, and DNS names as appropriate. --> ### 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) * Vaultwarden version: v1.29.1 * Web-vault version: v2023.5.0 * OS/Arch: linux/x86_64 * Running within Docker: true (Base: Debian) * Environment settings overridden: true * Uses a reverse proxy: false * Internet access: true * Internet access via a proxy: false * DNS Check: true * Browser/Server Time Check: true * Server/NTP Time Check: true * Domain Configuration Check: false * HTTPS Check: false * Database type: SQLite * Database version: 3.41.2 * Clients used: * Reverse proxy and version: * Other relevant information: ### Config (Generated via diagnostics page) <details><summary>Show Running Config</summary> **Environment settings which are overridden:** ADMIN_TOKEN ```json { "_duo_akey": null, "_enable_duo": true, "_enable_email_2fa": false, "_enable_smtp": true, "_enable_yubico": true, "_icon_service_csp": "", "_icon_service_url": "", "_ip_header_enabled": true, "_smtp_img_src": "cid:", "admin_ratelimit_max_burst": 3, "admin_ratelimit_seconds": 300, "admin_session_lifetime": 20, "admin_token": "***", "allowed_iframe_ancestors": "", "attachments_folder": "data/attachments", "authenticator_disable_time_drift": false, "data_folder": "data", "database_conn_init": "", "database_max_conns": 10, "database_timeout": 30, "database_url": "***************", "db_connection_retries": 15, "disable_2fa_remember": false, "disable_admin_token": false, "disable_icon_download": false, "domain": "****://************************", "domain_origin": "****://************************", "domain_path": "", "domain_set": true, "duo_host": null, "duo_ikey": null, "duo_skey": null, "email_attempts_limit": 3, "email_expiration_time": 600, "email_token_size": 6, "emergency_access_allowed": true, "emergency_notification_reminder_schedule": "0 3 * * * *", "emergency_request_timeout_schedule": "0 7 * * * *", "enable_db_wal": true, "event_cleanup_schedule": "0 10 0 * * *", "events_days_retain": null, "extended_logging": true, "helo_name": null, "hibp_api_key": null, "icon_blacklist_non_global_ips": true, "icon_blacklist_regex": null, "icon_cache_folder": "data/icon_cache", "icon_cache_negttl": 259200, "icon_cache_ttl": 2592000, "icon_download_timeout": 10, "icon_redirect_code": 302, "icon_service": "internal", "incomplete_2fa_schedule": "30 * * * * *", "incomplete_2fa_time_limit": 3, "invitation_expiration_hours": 120, "invitation_org_name": "Vaultwarden", "invitations_allowed": true, "ip_header": "X-Real-IP", "job_poll_interval_ms": 30000, "log_file": "/data/vaultwarden.log", "log_level": "Info", "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f", "login_ratelimit_max_burst": 10, "login_ratelimit_seconds": 60, "org_attachment_limit": null, "org_creation_users": "", "org_events_enabled": false, "org_groups_enabled": false, "password_hints_allowed": true, "password_iterations": 600000, "push_enabled": false, "push_installation_id": "***", "push_installation_key": "***", "push_relay_uri": "https://push.bitwarden.com", "reload_templates": false, "require_device_email": false, "rsa_key_filename": "data/rsa_key", "send_purge_schedule": "0 5 * * * *", "sendmail_command": null, "sends_allowed": true, "sends_folder": "data/sends", "show_password_hint": false, "signups_allowed": true, "signups_domains_whitelist": "", "signups_verify": false, "signups_verify_resend_limit": 6, "signups_verify_resend_time": 3600, "smtp_accept_invalid_certs": false, "smtp_accept_invalid_hostnames": false, "smtp_auth_mechanism": null, "smtp_debug": false, "smtp_embed_images": true, "smtp_explicit_tls": null, "smtp_from": "", "smtp_from_name": "Vaultwarden", "smtp_host": null, "smtp_password": null, "smtp_port": 587, "smtp_security": "starttls", "smtp_ssl": null, "smtp_timeout": 15, "smtp_username": null, "templates_folder": "data/templates", "tmp_folder": "data/tmp", "trash_auto_delete_days": null, "trash_purge_schedule": "0 5 0 * * *", "use_sendmail": false, "use_syslog": false, "user_attachment_limit": null, "web_vault_enabled": true, "web_vault_folder": "web-vault/", "websocket_address": "0.0.0.0", "websocket_enabled": false, "websocket_port": 3012, "yubico_client_id": null, "yubico_secret_key": null, "yubico_server": null } ``` </details> <!-- The version number, obtained from the logs (at startup) or the admin diagnostics page --> <!-- This is NOT the version number shown on the web vault, which is versioned separately from vaultwarden --> <!-- Remember to check if your issue exists on the latest version first! --> * vaultwarden version: latest <!-- How the server was installed: Docker image, OS package, built from source, etc. --> * Install method: docker image * Clients used: <!-- web vault, desktop, Android, iOS, etc. (if applicable) --> web vault * Reverse proxy and version: <!-- if applicable --> * MySQL/MariaDB or PostgreSQL version: <!-- if applicable --> * Other relevant details: ### Steps to reproduce <!-- Tell us how to reproduce this issue. What parameters did you set (differently from the defaults) and how did you start vaultwarden? --> Sync AD with vaultwarden, go to the org, try to confirm an user ### Expected behaviour <!-- Tell us what you expected to happen --> confirm users ### Actual behaviour <!-- Tell us what actually happened --> "t is null" error displayed ### Troubleshooting data <!-- Share any log files, screenshots, or other relevant troubleshooting data --> no error logs
Author
Owner

@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.

@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.
Author
Owner

@ptzetaa commented on GitHub (Jul 31, 2023):

How can i set the log level?

@ptzetaa commented on GitHub (Jul 31, 2023): How can i set the log level?
Author
Owner

@BlackDex commented on GitHub (Jul 31, 2023):

Configure the env variable LOG_LEVEL=debug

@BlackDex commented on GitHub (Jul 31, 2023): Configure the env variable `LOG_LEVEL=debug`
Author
Owner

@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

@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/<uuid>/public-key => 200 OK
Author
Owner

@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): 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.
Author
Owner

@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).

@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).
Author
Owner

@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 import function 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 where user.password_hash.is_empty()

@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 `import` function so they show up even though they shouldn't: https://github.com/dani-garcia/vaultwarden/blob/3dbfc484a54c41d1759646444b439da06445060b/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 where `user.password_hash.is_empty()`
Author
Owner

@BlackDex commented on GitHub (Jul 31, 2023):

That seems to do the trick indeed @stefan0xC.
The reason is, because there is no publicKey defined.

That is something we need to fix i guess.

@BlackDex commented on GitHub (Jul 31, 2023): That seems to do the trick indeed @stefan0xC. The reason is, because there is no `publicKey` defined. That is something we need to fix i guess.
Author
Owner

@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): @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.
Author
Owner

@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!

@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!
Author
Owner

@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): Thanks mate! Im going to try it How can I pull the new docker version or change that line?
Author
Owner

@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?

@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?
Author
Owner

@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 testing image.

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.

@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 `testing` image. 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.
Author
Owner

@ptzetaa commented on GitHub (Aug 1, 2023):

Okay thanks

@ptzetaa commented on GitHub (Aug 1, 2023): Okay thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1652