Attachments not working properly #1583

Closed
opened 2025-11-07 07:10:52 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @angelbarrera92 on GitHub (May 1, 2023).

Subject of the issue

  • Attachments not working properly.

Deployment environment

Your environment (Generated via diagnostics page)

  • Vaultwarden version: v1.28.1
  • Web-vault version: v2023.3.0b
  • OS/Arch: linux/x86_64
  • Running within Docker: true (Base: Debian)
  • Environment settings overridden: true
  • Uses a reverse proxy: true
  • IP Header check: true (X-Real-IP)
  • 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: true
  • Database type: SQLite
  • Database version: 3.39.2
  • Clients used:
  • Reverse proxy and version:
  • Other relevant information:

Config (Generated via diagnostics page)

Show Running Config

Environment settings which are overridden: DOMAIN, SIGNUPS_ALLOWED, INVITATIONS_ALLOWED, SHOW_PASSWORD_HINT, ADMIN_TOKEN, SMTP_HOST, SMTP_SSL, SMTP_EXPLICIT_TLS, SMTP_PORT, SMTP_FROM, SMTP_FROM_NAME, SMTP_USERNAME, SMTP_PASSWORD, SMTP_AUTH_MECHANISM

{
  "_duo_akey": null,
  "_enable_duo": false,
  "_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": "/mnt/data/attachments",
  "authenticator_disable_time_drift": false,
  "data_folder": "/mnt/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": "/mnt/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": "Bitwarden_RS",
  "invitations_allowed": true,
  "ip_header": "X-Real-IP",
  "job_poll_interval_ms": 30000,
  "log_file": null,
  "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": 100000,
  "reload_templates": false,
  "require_device_email": false,
  "rsa_key_filename": "/mnt/data/rsa_key",
  "send_purge_schedule": "0 5 * * * *",
  "sendmail_command": null,
  "sends_allowed": true,
  "sends_folder": "/mnt/data/sends",
  "show_password_hint": true,
  "signups_allowed": false,
  "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": "Login",
  "smtp_debug": false,
  "smtp_embed_images": true,
  "smtp_explicit_tls": true,
  "smtp_from": "**************************",
  "smtp_from_name": "Vaultwarden",
  "smtp_host": "*******************",
  "smtp_password": "***",
  "smtp_port": 465,
  "smtp_security": "force_tls",
  "smtp_ssl": true,
  "smtp_timeout": 15,
  "smtp_username": "****************************",
  "templates_folder": "/mnt/data/templates",
  "tmp_folder": "/mnt/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": true,
  "websocket_port": 3012,
  "yubico_client_id": null,
  "yubico_secret_key": null,
  "yubico_server": null
}
  • Install method: docker-compose

  • Clients used: Web, extensions, android

  • Reverse proxy and version: caddy v2

  • MySQL/MariaDB or PostgreSQL version: sqlite3

  • Other relevant details: I read the GitHub issue mentioning there are unexpected errors starting from a specific version... But im not sure if this one could be related to that

Steps to reproduce

Whenever I try to download an attachment, it doesn't download it.

Expected behaviour

It downloads the attachment. :)

Actual behaviour

It fails on Android, it hangs in the Firefox and Chrome browser extensions.
Seams like creating attachments works fine, but the retrieval is not; Nor from the web UI, browser extensions, nor android app

Troubleshooting data

Im able to see the attachment (encrypted) in the filesystem:
Logs:

[2023-05-01 21:22:55.725][request][INFO] POST /identity/connect/token
[2023-05-01 21:22:55.742][response][INFO] (login) POST /identity/connect/token => 200 OK
[2023-05-01 21:22:56.064][request][INFO] GET /api/ciphers/7464bfea-49c7-4bf5-b41e-be7d92c92cdc/attachment/3415401411c8f08903a7
[2023-05-01 21:22:56.065][response][INFO] (get_attachment) GET /api/ciphers/<uuid>/attachment/<attachment_id> => 200 OK

Filesystem:

angel@home:~$ cd /etc/vault/bw-data/attachments/
angel@home:/etc/vault/bw-data/attachments$ cd 7464bfea-49c7-4bf5-b41e-be7d92c92cdc/
angel@home:/etc/vault/bw-data/attachments/7464bfea-49c7-4bf5-b41e-be7d92c92cdc$ ls 3415401411c8f08903a7 
3415401411c8f08903a7
angel@home:/etc/vault/bw-data/attachments/7464bfea-49c7-4bf5-b41e-be7d92c92cdc$ du -h 3415401411c8f08903a7 
4.0K	3415401411c8f08903a7
Originally created by @angelbarrera92 on GitHub (May 1, 2023). ### Subject of the issue - Attachments not working properly. ### Deployment environment ### Your environment (Generated via diagnostics page) * Vaultwarden version: v1.28.1 * Web-vault version: v2023.3.0b * OS/Arch: linux/x86_64 * Running within Docker: true (Base: Debian) * Environment settings overridden: true * Uses a reverse proxy: true * IP Header check: true (X-Real-IP) * 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: true * Database type: SQLite * Database version: 3.39.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:** DOMAIN, SIGNUPS_ALLOWED, INVITATIONS_ALLOWED, SHOW_PASSWORD_HINT, ADMIN_TOKEN, SMTP_HOST, SMTP_SSL, SMTP_EXPLICIT_TLS, SMTP_PORT, SMTP_FROM, SMTP_FROM_NAME, SMTP_USERNAME, SMTP_PASSWORD, SMTP_AUTH_MECHANISM ```json { "_duo_akey": null, "_enable_duo": false, "_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": "/mnt/data/attachments", "authenticator_disable_time_drift": false, "data_folder": "/mnt/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": "/mnt/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": "Bitwarden_RS", "invitations_allowed": true, "ip_header": "X-Real-IP", "job_poll_interval_ms": 30000, "log_file": null, "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": 100000, "reload_templates": false, "require_device_email": false, "rsa_key_filename": "/mnt/data/rsa_key", "send_purge_schedule": "0 5 * * * *", "sendmail_command": null, "sends_allowed": true, "sends_folder": "/mnt/data/sends", "show_password_hint": true, "signups_allowed": false, "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": "Login", "smtp_debug": false, "smtp_embed_images": true, "smtp_explicit_tls": true, "smtp_from": "**************************", "smtp_from_name": "Vaultwarden", "smtp_host": "*******************", "smtp_password": "***", "smtp_port": 465, "smtp_security": "force_tls", "smtp_ssl": true, "smtp_timeout": 15, "smtp_username": "****************************", "templates_folder": "/mnt/data/templates", "tmp_folder": "/mnt/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": true, "websocket_port": 3012, "yubico_client_id": null, "yubico_secret_key": null, "yubico_server": null } ``` </details> * Install method: docker-compose * Clients used: Web, extensions, android * Reverse proxy and version: caddy v2 * MySQL/MariaDB or PostgreSQL version: sqlite3 * Other relevant details: I read the GitHub issue mentioning there are unexpected errors starting from a specific version... But im not sure if this one could be related to [that](https://github.com/dani-garcia/vaultwarden/issues/3082) ### Steps to reproduce Whenever I try to download an attachment, it doesn't download it. ### Expected behaviour It downloads the attachment. :) ### Actual behaviour It fails on Android, it hangs in the Firefox and Chrome browser extensions. Seams like creating attachments works fine, but the retrieval is not; Nor from the web UI, browser extensions, nor android app ### Troubleshooting data Im able to see the attachment (encrypted) in the filesystem: Logs: ```bash [2023-05-01 21:22:55.725][request][INFO] POST /identity/connect/token [2023-05-01 21:22:55.742][response][INFO] (login) POST /identity/connect/token => 200 OK [2023-05-01 21:22:56.064][request][INFO] GET /api/ciphers/7464bfea-49c7-4bf5-b41e-be7d92c92cdc/attachment/3415401411c8f08903a7 [2023-05-01 21:22:56.065][response][INFO] (get_attachment) GET /api/ciphers/<uuid>/attachment/<attachment_id> => 200 OK ``` Filesystem: ```bash angel@home:~$ cd /etc/vault/bw-data/attachments/ angel@home:/etc/vault/bw-data/attachments$ cd 7464bfea-49c7-4bf5-b41e-be7d92c92cdc/ angel@home:/etc/vault/bw-data/attachments/7464bfea-49c7-4bf5-b41e-be7d92c92cdc$ ls 3415401411c8f08903a7 3415401411c8f08903a7 angel@home:/etc/vault/bw-data/attachments/7464bfea-49c7-4bf5-b41e-be7d92c92cdc$ du -h 3415401411c8f08903a7 4.0K 3415401411c8f08903a7 ```
Author
Owner

@BlackDex commented on GitHub (May 1, 2023):

Your domain is not configured correctly.

Domain Configuration Check: false

Check that setting and try again.

@BlackDex commented on GitHub (May 1, 2023): Your domain is not configured correctly. > Domain Configuration Check: false Check that setting and try again.
Author
Owner

@angelbarrera92 commented on GitHub (May 2, 2023):

@BlackDex! Thank you very much!

Seems like the DOMAIN env (that was properly configured) does not override what is set in the config.json (what was wrong); in the domain key.

Modifying the config.json file solved the issue 🎆 . But... Is it a bug? AFAIK, what is set as environment variables must override what is set in the config.json file... Am I right?

@angelbarrera92 commented on GitHub (May 2, 2023): @BlackDex! Thank you very much! Seems like the `DOMAIN` env (that was properly configured) does not override what is set in the `config.json` *(what was wrong)*; in the `domain` key. Modifying the `config.json` file solved the issue 🎆 . But... Is it a bug? AFAIK, what is set as environment variables must override what is set in the `config.json` file... Am I right?
Author
Owner

@BlackDex commented on GitHub (May 2, 2023):

Not sure where you did get that from. But for Vaultwarden it's the other way around.
Also, it's not something we can simply adjust, because that would break a lot of environments.

With Vaultwarden we started with just ENV variables, nothing else.
Then people wanted to have an interface to edit the settings, that is something we need to store somewhere.
This was done in the config.json file. So the logic dictates that everything saved via the admin interface, and stored in the config.json should override the ENV variables.

Some people think the config.json is a valid configuration file for Vaultwarden, but it actually isn't.
I'm also tempted to convert that file to a binary json file, so people will not edit it directly anymore, but that again will break stuff currently.

@BlackDex commented on GitHub (May 2, 2023): Not sure where you did get that from. But for Vaultwarden it's the other way around. Also, it's not something we can simply adjust, because that would break a lot of environments. With Vaultwarden we started with just ENV variables, nothing else. Then people wanted to have an interface to edit the settings, that is something we need to store somewhere. This was done in the `config.json` file. So the logic dictates that everything saved via the admin interface, and stored in the `config.json` should override the ENV variables. Some people think the `config.json` is a valid configuration file for Vaultwarden, but it actually isn't. I'm also tempted to convert that file to a binary json file, so people will not edit it directly anymore, but that again will break stuff currently.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#1583