Downloading attachments does not work #1247

Closed
opened 2025-11-07 07:01:38 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @fabsau on GitHub (Apr 12, 2022).

Your environment (Generated via diagnostics page)

  • Vaultwarden version: v1.24.0
  • Web-vault version: v2.25.1
  • 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
  • Time Check: true
  • Domain Configuration Check: false
  • HTTPS Check: false
  • Database type: MySQL
  • Database version: 10.5.15-MariaDB-log
  • Clients used: Firefox, Chrome and Android
  • Reverse proxy and version: Traefik 1.28.0
  • Other relevant information:

Config (Generated via diagnostics page)

Show Running Config

Environment settings which are overridden: ADMIN_TOKEN

{
  "_duo_akey": null,
  "_enable_duo": false,
  "_enable_email_2fa": false,
  "_enable_smtp": true,
  "_enable_yubico": true,
  "_ip_header_enabled": true,
  "admin_ratelimit_max_burst": 3,
  "admin_ratelimit_seconds": 300,
  "admin_token": "***",
  "allowed_iframe_ancestors": "",
  "attachments_folder": "data/attachments",
  "authenticator_disable_time_drift": false,
  "data_folder": "data",
  "database_max_conns": 10,
  "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 5 * * * *",
  "emergency_request_timeout_schedule": "0 5 * * * *",
  "enable_db_wal": true,
  "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_org_name": "Vaultwarden",
  "invitations_allowed": true,
  "ip_header": "X-Real-IP",
  "job_poll_interval_ms": 30000,
  "log_file": "/data/bitwarden.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": "",
  "password_iterations": 100000,
  "reload_templates": false,
  "require_device_email": false,
  "rsa_key_filename": "data/rsa_key",
  "send_purge_schedule": "0 5 * * * *",
  "sends_allowed": true,
  "sends_folder": "data/sends",
  "show_password_hint": false,
  "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": null,
  "smtp_debug": false,
  "smtp_explicit_tls": false,
  "smtp_from": "",
  "smtp_from_name": "Vaultwarden",
  "smtp_host": null,
  "smtp_password": null,
  "smtp_port": 587,
  "smtp_ssl": true,
  "smtp_timeout": 15,
  "smtp_username": null,
  "templates_folder": "data/templates",
  "trash_auto_delete_days": null,
  "trash_purge_schedule": "0 5 0 * * *",
  "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
}

##Traefik Labels (for testing this issue, not for production!):
labels:
- traefik.enable=true
- traefik.http.routers.vaultwarden.entrypoints=https
- traefik.http.routers.vaultwarden.rule=Host(contoso.com)
- traefik.http.routers.vaultwarden.tls.certresolver=microsoft
- traefik.http.routers.vaultwarden.service=vaultwarden
- traefik.http.services.vaultwarden.loadbalancer.server.port=80
- com.centurylinklabs.watchtower.enable=true

Steps to reproduce

Upload an attachment via the android-app or browser to an item. Trying to download it afterwards either via browser or android does not work. Files are being created on the docker-volume.
Also tested: purged the whole attachments folder and reproducing did not fix. Attachments would be deleted inside the volume if attachments has been removed from the item.
Also tested: using sqlite and with earlier vaultwarden version 1.23.1

Actual behaviour

Can not download attachments

Expected behaviour

Downloading attachments

Troubleshooting data

2022-04-11T21:26:26.592955460Z [2022-04-11 23:26:26.592][request][INFO] POST /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f/attachment/v2
2022-04-11T21:26:26.595040738Z [2022-04-11 23:26:26.594][response][INFO] POST /api/ciphers//attachment/v2 (post_attachment_v2) => 200 OK
2022-04-11T21:26:26.681630789Z [2022-04-11 23:26:26.681][request][INFO] POST /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f/attachment/53b941f83c0
2022-04-11T21:26:26.682256520Z [2022-04-11 23:26:26.682][multipart::server][INFO] Multipart::with_boundary(_, "----WebKitFormBoundaryaSToTAPjuA2rgP1s
2022-04-11T21:26:26.872725019Z [2022-04-11 23:26:26.872][response][INFO] POST /api/ciphers//attachment/<attachment_id> multipart/form-data (pos
2022-04-11T21:26:27.148444088Z [2022-04-11 23:26:27.148][request][INFO] GET /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f
2022-04-11T21:26:27.148936508Z [2022-04-11 23:26:27.148][response][INFO] GET /api/ciphers/ (get_cipher) => 200 OK
2022-04-11T21:26:34.865964461Z [2022-04-11 23:26:34.865][request][INFO] GET /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f/attachment/53b941f83c01
2022-04-11T21:26:34.866642231Z [2022-04-11 23:26:34.866][response][INFO] GET /api/ciphers//attachment/<attachment_id> (get_attachment) => 200 O
2022-04-11T21:34:05.685089216Z [2022-04-11 23:34:05.684][parity_ws::io][INFO] Accepted a new tcp connection from 172.31.18.4:38552.
2022-04-11T21:34:05.787886303Z [2022-04-11 23:34:05.787][request][INFO] GET /api/accounts/revision-date
2022-04-11T21:34:05.788437373Z [2022-04-11 23:34:05.788][response][INFO] GET /api/accounts/revision-date (revision_date) => 200 OK
2022-04-11T21:34:05.818686406Z [2022-04-11 23:34:05.817][request][INFO] POST /identity/connect/token
2022-04-11T21:34:05.821498437Z [2022-04-11 23:34:05.821][response][INFO] POST /identity/connect/token (login) => 200 OK
2022-04-11T21:34:06.206025081Z [2022-04-11 23:34:06.205][request][INFO] GET /api/sync
2022-04-11T21:34:06.253642975Z [2022-04-11 23:34:06.253][response][INFO] GET /api/sync?<data..> (sync) => 200 OK

On Android:
"Unable to download file"

Originally created by @fabsau on GitHub (Apr 12, 2022). ### Your environment (Generated via diagnostics page) * Vaultwarden version: v1.24.0 * Web-vault version: v2.25.1 * 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 * Time Check: true * Domain Configuration Check: false * HTTPS Check: false * Database type: MySQL * Database version: 10.5.15-MariaDB-log * Clients used: Firefox, Chrome and Android * Reverse proxy and version: Traefik 1.28.0 * 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": false, "_enable_email_2fa": false, "_enable_smtp": true, "_enable_yubico": true, "_ip_header_enabled": true, "admin_ratelimit_max_burst": 3, "admin_ratelimit_seconds": 300, "admin_token": "***", "allowed_iframe_ancestors": "", "attachments_folder": "data/attachments", "authenticator_disable_time_drift": false, "data_folder": "data", "database_max_conns": 10, "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 5 * * * *", "emergency_request_timeout_schedule": "0 5 * * * *", "enable_db_wal": true, "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_org_name": "Vaultwarden", "invitations_allowed": true, "ip_header": "X-Real-IP", "job_poll_interval_ms": 30000, "log_file": "/data/bitwarden.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": "", "password_iterations": 100000, "reload_templates": false, "require_device_email": false, "rsa_key_filename": "data/rsa_key", "send_purge_schedule": "0 5 * * * *", "sends_allowed": true, "sends_folder": "data/sends", "show_password_hint": false, "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": null, "smtp_debug": false, "smtp_explicit_tls": false, "smtp_from": "", "smtp_from_name": "Vaultwarden", "smtp_host": null, "smtp_password": null, "smtp_port": 587, "smtp_ssl": true, "smtp_timeout": 15, "smtp_username": null, "templates_folder": "data/templates", "trash_auto_delete_days": null, "trash_purge_schedule": "0 5 0 * * *", "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 } ``` ##Traefik Labels (for testing this issue, not for production!): labels: - traefik.enable=true - traefik.http.routers.vaultwarden.entrypoints=https - traefik.http.routers.vaultwarden.rule=Host(`contoso.com`) - traefik.http.routers.vaultwarden.tls.certresolver=microsoft - traefik.http.routers.vaultwarden.service=vaultwarden - traefik.http.services.vaultwarden.loadbalancer.server.port=80 - com.centurylinklabs.watchtower.enable=true </details> ### Steps to reproduce Upload an attachment via the android-app or browser to an item. Trying to download it afterwards either via browser or android does not work. Files are being created on the docker-volume. Also tested: purged the whole attachments folder and reproducing did not fix. Attachments would be deleted inside the volume if attachments has been removed from the item. Also tested: using sqlite and with earlier vaultwarden version 1.23.1 ### Actual behaviour Can not download attachments ### Expected behaviour Downloading attachments ### Troubleshooting data 2022-04-11T21:26:26.592955460Z [2022-04-11 23:26:26.592][request][INFO] POST /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f/attachment/v2 2022-04-11T21:26:26.595040738Z [2022-04-11 23:26:26.594][response][INFO] POST /api/ciphers/<uuid>/attachment/v2 (post_attachment_v2) => 200 OK 2022-04-11T21:26:26.681630789Z [2022-04-11 23:26:26.681][request][INFO] POST /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f/attachment/53b941f83c0 2022-04-11T21:26:26.682256520Z [2022-04-11 23:26:26.682][multipart::server][INFO] Multipart::with_boundary(_, "----WebKitFormBoundaryaSToTAPjuA2rgP1s 2022-04-11T21:26:26.872725019Z [2022-04-11 23:26:26.872][response][INFO] POST /api/ciphers/<uuid>/attachment/<attachment_id> multipart/form-data (pos 2022-04-11T21:26:27.148444088Z [2022-04-11 23:26:27.148][request][INFO] GET /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f 2022-04-11T21:26:27.148936508Z [2022-04-11 23:26:27.148][response][INFO] GET /api/ciphers/<uuid> (get_cipher) => 200 OK 2022-04-11T21:26:34.865964461Z [2022-04-11 23:26:34.865][request][INFO] GET /api/ciphers/64d5f3ae-c167-4e5c-8bd7-5e229f0e281f/attachment/53b941f83c01 2022-04-11T21:26:34.866642231Z [2022-04-11 23:26:34.866][response][INFO] GET /api/ciphers/<uuid>/attachment/<attachment_id> (get_attachment) => 200 O 2022-04-11T21:34:05.685089216Z [2022-04-11 23:34:05.684][parity_ws::io][INFO] Accepted a new tcp connection from 172.31.18.4:38552. 2022-04-11T21:34:05.787886303Z [2022-04-11 23:34:05.787][request][INFO] GET /api/accounts/revision-date 2022-04-11T21:34:05.788437373Z [2022-04-11 23:34:05.788][response][INFO] GET /api/accounts/revision-date (revision_date) => 200 OK 2022-04-11T21:34:05.818686406Z [2022-04-11 23:34:05.817][request][INFO] POST /identity/connect/token 2022-04-11T21:34:05.821498437Z [2022-04-11 23:34:05.821][response][INFO] POST /identity/connect/token (login) => 200 OK 2022-04-11T21:34:06.206025081Z [2022-04-11 23:34:06.205][request][INFO] GET /api/sync 2022-04-11T21:34:06.253642975Z [2022-04-11 23:34:06.253][response][INFO] GET /api/sync?<data..> (sync) => 200 OK On Android: "Unable to download file"
Author
Owner

@BlackDex commented on GitHub (Apr 12, 2022):

Your domain configuration is wrong:

Domain Configuration Check: false

Check the DOMAIN configuration to match the actual domain you use, else downloading attachments will not work.

@BlackDex commented on GitHub (Apr 12, 2022): Your domain configuration is wrong: > Domain Configuration Check: false Check the `DOMAIN` configuration to match the actual domain you use, else downloading attachments will not work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#1247