So I deleted the database and started just with a mariadb portion in the compose file. After startup of the container I confirmed by bitwarden database had no tables.
I then added in the bitwarden mysql implementation. I examined the bitwarden database after starting of the container and I didn’t see any schema being setup. It bitwarden database was still blank. (which I don’t think is right).
The logs for the bitwarden-mysql implementation shows the following (Note nothing about any mysql/mariadb connection):
[2020-10-16 15:21:56.724][bitwarden_rs][INFO] JWT keys don't exist, checking if OpenSSL is available...
[2020-10-16 15:21:56.759][bitwarden_rs][INFO] OpenSSL detected, creating keys...
[2020-10-16 15:21:56.814][bitwarden_rs][INFO] Keys created correctly.
[2020-10-16 15:22:00.576][routes][INFO] Routes loaded:
[2020-10-16 15:22:00.576][ws][INFO] Listening for new connections on 0.0.0.0:3012.
[2020-10-16 15:22:00.576][routes][INFO] GET /
[2020-10-16 15:22:00.576][routes][INFO] GET /<p..> [10]
[2020-10-16 15:22:00.577][routes][INFO] POST /admin
[2020-10-16 15:22:00.577][routes][INFO] GET /admin [1]
[2020-10-16 15:22:00.577][routes][INFO] GET /admin [2]
[2020-10-16 15:22:00.577][routes][INFO] POST /admin/config
[2020-10-16 15:22:00.577][routes][INFO] POST /admin/config/backup_db
[2020-10-16 15:22:00.577][routes][INFO] POST /admin/config/delete
[2020-10-16 15:22:00.577][routes][INFO] GET /admin/diagnostics
[2020-10-16 15:22:00.578][routes][INFO] POST /admin/invite
[2020-10-16 15:22:00.578][routes][INFO] GET /admin/logout
[2020-10-16 15:22:00.578][routes][INFO] GET /admin/organizations/overview
[2020-10-16 15:22:00.578][routes][INFO] POST /admin/test/smtp
[2020-10-16 15:22:00.578][routes][INFO] GET /admin/users
[2020-10-16 15:22:00.578][routes][INFO] POST /admin/users/<uuid>/deauth
[2020-10-16 15:22:00.579][routes][INFO] POST /admin/users/<uuid>/delete
[2020-10-16 15:22:00.579][routes][INFO] POST /admin/users/<uuid>/remove-2fa
[2020-10-16 15:22:00.579][routes][INFO] GET /admin/users/overview
[2020-10-16 15:22:00.579][routes][INFO] POST /admin/users/update_revision
[2020-10-16 15:22:00.579][routes][INFO] GET /alive
[2020-10-16 15:22:00.579][routes][INFO] DELETE /api/accounts
[2020-10-16 15:22:00.580][routes][INFO] POST /api/accounts/delete
[2020-10-16 15:22:00.580][routes][INFO] POST /api/accounts/delete-recover
[2020-10-16 15:22:00.580][routes][INFO] POST /api/accounts/delete-recover-token
[2020-10-16 15:22:00.580][routes][INFO] POST /api/accounts/email
[2020-10-16 15:22:00.580][routes][INFO] POST /api/accounts/email-token
[2020-10-16 15:22:00.581][routes][INFO] POST /api/accounts/kdf
[2020-10-16 15:22:00.581][routes][INFO] POST /api/accounts/key
[2020-10-16 15:22:00.581][routes][INFO] POST /api/accounts/keys
[2020-10-16 15:22:00.581][routes][INFO] POST /api/accounts/password
[2020-10-16 15:22:00.581][routes][INFO] POST /api/accounts/password-hint
[2020-10-16 15:22:00.582][routes][INFO] POST /api/accounts/prelogin
[2020-10-16 15:22:00.582][routes][INFO] PUT /api/accounts/profile
[2020-10-16 15:22:00.582][routes][INFO] POST /api/accounts/profile
[2020-10-16 15:22:00.582][routes][INFO] GET /api/accounts/profile
[2020-10-16 15:22:00.582][routes][INFO] POST /api/accounts/register
[2020-10-16 15:22:00.583][routes][INFO] GET /api/accounts/revision-date
[2020-10-16 15:22:00.583][routes][INFO] POST /api/accounts/security-stamp
[2020-10-16 15:22:00.583][routes][INFO] POST /api/accounts/verify-email
[2020-10-16 15:22:00.583][routes][INFO] POST /api/accounts/verify-email-token
[2020-10-16 15:22:00.583][routes][INFO] POST /api/accounts/verify-password
[2020-10-16 15:22:00.584][routes][INFO] POST /api/ciphers
[2020-10-16 15:22:00.584][routes][INFO] DELETE /api/ciphers
[2020-10-16 15:22:00.584][routes][INFO] GET /api/ciphers
[2020-10-16 15:22:00.584][routes][INFO] PUT /api/ciphers/<uuid>
[2020-10-16 15:22:00.584][routes][INFO] POST /api/ciphers/<uuid>
[2020-10-16 15:22:00.584][routes][INFO] DELETE /api/ciphers/<uuid>
[2020-10-16 15:22:00.585][routes][INFO] GET /api/ciphers/<uuid>
[2020-10-16 15:22:00.585][routes][INFO] PUT /api/ciphers/<uuid>/admin
[2020-10-16 15:22:00.585][routes][INFO] POST /api/ciphers/<uuid>/admin
[2020-10-16 15:22:00.585][routes][INFO] DELETE /api/ciphers/<uuid>/admin
[2020-10-16 15:22:00.585][routes][INFO] GET /api/ciphers/<uuid>/admin
[2020-10-16 15:22:00.585][routes][INFO] POST /api/ciphers/<uuid>/attachment
[2020-10-16 15:22:00.586][routes][INFO] POST /api/ciphers/<uuid>/attachment-admin
[2020-10-16 15:22:00.586][routes][INFO] DELETE /api/ciphers/<uuid>/attachment/<attachment_id>
[2020-10-16 15:22:00.586][routes][INFO] DELETE /api/ciphers/<uuid>/attachment/<attachment_id>/admin
[2020-10-16 15:22:00.586][routes][INFO] POST /api/ciphers/<uuid>/attachment/<attachment_id>/delete
[2020-10-16 15:22:00.586][routes][INFO] POST /api/ciphers/<uuid>/attachment/<attachment_id>/delete-admin
[2020-10-16 15:22:00.587][routes][INFO] POST /api/ciphers/<uuid>/attachment/<attachment_id>/share
[2020-10-16 15:22:00.587][routes][INFO] PUT /api/ciphers/<uuid>/collections
[2020-10-16 15:22:00.587][routes][INFO] POST /api/ciphers/<uuid>/collections
[2020-10-16 15:22:00.587][routes][INFO] PUT /api/ciphers/<uuid>/collections-admin
[2020-10-16 15:22:00.587][routes][INFO] POST /api/ciphers/<uuid>/collections-admin
[2020-10-16 15:22:00.587][routes][INFO] PUT /api/ciphers/<uuid>/delete
[2020-10-16 15:22:00.588][routes][INFO] POST /api/ciphers/<uuid>/delete
[2020-10-16 15:22:00.588][routes][INFO] PUT /api/ciphers/<uuid>/delete-admin
[2020-10-16 15:22:00.588][routes][INFO] POST /api/ciphers/<uuid>/delete-admin
[2020-10-16 15:22:00.588][routes][INFO] GET /api/ciphers/<uuid>/details
[2020-10-16 15:22:00.588][routes][INFO] PUT /api/ciphers/<uuid>/restore
[2020-10-16 15:22:00.588][routes][INFO] PUT /api/ciphers/<uuid>/restore-admin
[2020-10-16 15:22:00.589][routes][INFO] PUT /api/ciphers/<uuid>/share
[2020-10-16 15:22:00.589][routes][INFO] POST /api/ciphers/<uuid>/share
[2020-10-16 15:22:00.589][routes][INFO] POST /api/ciphers/admin
[2020-10-16 15:22:00.589][routes][INFO] POST /api/ciphers/create
[2020-10-16 15:22:00.589][routes][INFO] PUT /api/ciphers/delete
[2020-10-16 15:22:00.590][routes][INFO] POST /api/ciphers/delete
[2020-10-16 15:22:00.590][routes][INFO] POST /api/ciphers/import
[2020-10-16 15:22:00.590][routes][INFO] POST /api/ciphers/import-organization?<query..>
[2020-10-16 15:22:00.590][routes][INFO] PUT /api/ciphers/move
[2020-10-16 15:22:00.590][routes][INFO] POST /api/ciphers/move
[2020-10-16 15:22:00.591][routes][INFO] GET /api/ciphers/organization-details?<data..>
[2020-10-16 15:22:00.591][routes][INFO] POST /api/ciphers/purge?<organization..>
[2020-10-16 15:22:00.591][routes][INFO] PUT /api/ciphers/restore
[2020-10-16 15:22:00.591][routes][INFO] PUT /api/ciphers/share
[2020-10-16 15:22:00.591][routes][INFO] GET /api/collections
[2020-10-16 15:22:00.591][routes][INFO] PUT /api/devices/identifier/<uuid>/clear-token
[2020-10-16 15:22:00.592][routes][INFO] PUT /api/devices/identifier/<uuid>/token
[2020-10-16 15:22:00.592][routes][INFO] POST /api/folders
[2020-10-16 15:22:00.592][routes][INFO] GET /api/folders
[2020-10-16 15:22:00.592][routes][INFO] PUT /api/folders/<uuid>
[2020-10-16 15:22:00.592][routes][INFO] POST /api/folders/<uuid>
[2020-10-16 15:22:00.593][routes][INFO] DELETE /api/folders/<uuid>
[2020-10-16 15:22:00.593][routes][INFO] GET /api/folders/<uuid>
[2020-10-16 15:22:00.593][routes][INFO] POST /api/folders/<uuid>/delete
[2020-10-16 15:22:00.593][routes][INFO] GET /api/hibp/breach?<username>
[2020-10-16 15:22:00.593][routes][INFO] POST /api/organizations
[2020-10-16 15:22:00.593][routes][INFO] POST /api/organizations/<_org_id>/users/<_org_user_id>/accept
[2020-10-16 15:22:00.594][routes][INFO] PUT /api/organizations/<org_id>
[2020-10-16 15:22:00.594][routes][INFO] POST /api/organizations/<org_id>
[2020-10-16 15:22:00.594][routes][INFO] DELETE /api/organizations/<org_id>
[2020-10-16 15:22:00.594][routes][INFO] GET /api/organizations/<org_id>
[2020-10-16 15:22:00.594][routes][INFO] POST /api/organizations/<org_id>/collections
[2020-10-16 15:22:00.594][routes][INFO] GET /api/organizations/<org_id>/collections
[2020-10-16 15:22:00.595][routes][INFO] PUT /api/organizations/<org_id>/collections/<col_id>
[2020-10-16 15:22:00.595][routes][INFO] POST /api/organizations/<org_id>/collections/<col_id>
[2020-10-16 15:22:00.595][routes][INFO] DELETE /api/organizations/<org_id>/collections/<col_id>
[2020-10-16 15:22:00.595][routes][INFO] POST /api/organizations/<org_id>/collections/<col_id>/delete
[2020-10-16 15:22:00.595][routes][INFO] POST /api/organizations/<org_id>/collections/<col_id>/delete-user/<org_user_id>
[2020-10-16 15:22:00.595][routes][INFO] DELETE /api/organizations/<org_id>/collections/<col_id>/user/<org_user_id>
[2020-10-16 15:22:00.595][routes][INFO] GET /api/organizations/<org_id>/collections/<coll_id>/details
[2020-10-16 15:22:00.596][routes][INFO] PUT /api/organizations/<org_id>/collections/<coll_id>/users
[2020-10-16 15:22:00.596][routes][INFO] GET /api/organizations/<org_id>/collections/<coll_id>/users
[2020-10-16 15:22:00.596][routes][INFO] POST /api/organizations/<org_id>/delete
[2020-10-16 15:22:00.596][routes][INFO] POST /api/organizations/<org_id>/leave
[2020-10-16 15:22:00.596][routes][INFO] GET /api/organizations/<org_id>/policies
[2020-10-16 15:22:00.597][routes][INFO] PUT /api/organizations/<org_id>/policies/<pol_type>
[2020-10-16 15:22:00.597][routes][INFO] GET /api/organizations/<org_id>/policies/<pol_type>
[2020-10-16 15:22:00.597][routes][INFO] GET /api/organizations/<org_id>/policies/token?<token>
[2020-10-16 15:22:00.597][routes][INFO] GET /api/organizations/<org_id>/users
[2020-10-16 15:22:00.597][routes][INFO] PUT /api/organizations/<org_id>/users/<org_user_id> [1]
[2020-10-16 15:22:00.597][routes][INFO] POST /api/organizations/<org_id>/users/<org_user_id> [1]
[2020-10-16 15:22:00.598][routes][INFO] DELETE /api/organizations/<org_id>/users/<org_user_id>
[2020-10-16 15:22:00.598][routes][INFO] GET /api/organizations/<org_id>/users/<org_user_id>
[2020-10-16 15:22:00.598][routes][INFO] POST /api/organizations/<org_id>/users/<org_user_id>/confirm
[2020-10-16 15:22:00.598][routes][INFO] POST /api/organizations/<org_id>/users/<org_user_id>/delete
[2020-10-16 15:22:00.598][routes][INFO] POST /api/organizations/<org_id>/users/<user_org>/reinvite
[2020-10-16 15:22:00.599][routes][INFO] POST /api/organizations/<org_id>/users/invite
[2020-10-16 15:22:00.599][routes][INFO] GET /api/plans
[2020-10-16 15:22:00.599][routes][INFO] PUT /api/settings/domains
[2020-10-16 15:22:00.599][routes][INFO] POST /api/settings/domains
[2020-10-16 15:22:00.599][routes][INFO] GET /api/settings/domains
[2020-10-16 15:22:00.600][routes][INFO] GET /api/sync?<data..>
[2020-10-16 15:22:00.600][routes][INFO] GET /api/two-factor
[2020-10-16 15:22:00.600][routes][INFO] PUT /api/two-factor/authenticator
[2020-10-16 15:22:00.600][routes][INFO] POST /api/two-factor/authenticator
[2020-10-16 15:22:00.600][routes][INFO] PUT /api/two-factor/disable
[2020-10-16 15:22:00.600][routes][INFO] POST /api/two-factor/disable
[2020-10-16 15:22:00.601][routes][INFO] PUT /api/two-factor/duo
[2020-10-16 15:22:00.601][routes][INFO] POST /api/two-factor/duo
[2020-10-16 15:22:00.601][routes][INFO] PUT /api/two-factor/email
[2020-10-16 15:22:00.601][routes][INFO] POST /api/two-factor/get-authenticator
[2020-10-16 15:22:00.601][routes][INFO] POST /api/two-factor/get-duo
[2020-10-16 15:22:00.602][routes][INFO] POST /api/two-factor/get-email
[2020-10-16 15:22:00.602][routes][INFO] POST /api/two-factor/get-recover
[2020-10-16 15:22:00.602][routes][INFO] POST /api/two-factor/get-u2f
[2020-10-16 15:22:00.602][routes][INFO] POST /api/two-factor/get-u2f-challenge
[2020-10-16 15:22:00.602][routes][INFO] POST /api/two-factor/get-yubikey
[2020-10-16 15:22:00.602][routes][INFO] POST /api/two-factor/recover
[2020-10-16 15:22:00.603][routes][INFO] POST /api/two-factor/send-email
[2020-10-16 15:22:00.603][routes][INFO] POST /api/two-factor/send-email-login
[2020-10-16 15:22:00.603][routes][INFO] PUT /api/two-factor/u2f
[2020-10-16 15:22:00.603][routes][INFO] POST /api/two-factor/u2f
[2020-10-16 15:22:00.603][routes][INFO] DELETE /api/two-factor/u2f
[2020-10-16 15:22:00.604][routes][INFO] PUT /api/two-factor/yubikey
[2020-10-16 15:22:00.604][routes][INFO] POST /api/two-factor/yubikey
[2020-10-16 15:22:00.604][routes][INFO] GET /api/users/<uuid>/public-key
[2020-10-16 15:22:00.604][routes][INFO] GET /app-id.json
[2020-10-16 15:22:00.604][routes][INFO] GET /attachments/<uuid>/<file..>
[2020-10-16 15:22:00.605][routes][INFO] GET /bwrs_static/<filename>
[2020-10-16 15:22:00.605][routes][INFO] GET /icons/<domain>/icon.png
[2020-10-16 15:22:00.605][routes][INFO] POST /identity/connect/token
[2020-10-16 15:22:00.605][routes][INFO] GET /notifications/hub
[2020-10-16 15:22:00.605][routes][INFO] POST /notifications/hub/negotiate
[2020-10-16 15:22:00.605][start][INFO] Rocket has launched from https://0.0.0.0:80
[2020-10-16 15:22:56.731][rustls::server::hs][DEBUG] decided upon suite SupportedCipherSuite { suite: TLS13_AES_256_GCM_SHA384, kx: BulkOnly, bulk: AES_256_GCM, hash: SHA384, sign: Anonymous, enc_key_len: 32, fixed_iv_len: 12, explicit_nonce_len: 0, hkdf_algorithm: Algorithm(Algorithm(SHA384)) }
[2020-10-16 15:22:56.738][request][INFO] GET /alive
[2020-10-16 15:22:56.740][response][INFO] GET /alive (alive) => 200 OK
[2020-10-16 15:23:57.160][rustls::server::hs][DEBUG] decided upon suite SupportedCipherSuite { suite: TLS13_AES_256_GCM_SHA384, kx: BulkOnly, bulk: AES_256_GCM, hash: SHA384, sign: Anonymous, enc_key_len: 32, fixed_iv_len: 12, explicit_nonce_len: 0, hkdf_algorithm: Algorithm(Algorithm(SHA384)) }
[2020-10-16 15:23:57.163][request][INFO] GET /alive
[2020-10-16 15:23:57.163][response][INFO] GET /alive (alive) => 200 OK
[2020-10-16 15:24:57.601][rustls::server::hs][DEBUG] decided upon suite SupportedCipherSuite { suite: TLS13_AES_256_GCM_SHA384, kx: BulkOnly, bulk: AES_256_GCM, hash: SHA384, sign: Anonymous, enc_key_len: 32, fixed_iv_len: 12, explicit_nonce_len: 0, hkdf_algorithm: Algorithm(Algorithm(SHA384)) }
[2020-10-16 15:24:57.604][request][INFO] GET /alive
[2020-10-16 15:24:57.604][response][INFO] GET /alive (alive) => 200 OK
[2020-10-16 15:25:58.316][rustls::server::hs][DEBUG] decided upon suite SupportedCipherSuite { suite: TLS13_AES_256_GCM_SHA384, kx: BulkOnly, bulk: AES_256_GCM, hash: SHA384, sign: Anonymous, enc_key_len: 32, fixed_iv_len: 12, explicit_nonce_len: 0, hkdf_algorithm: Algorithm(Algorithm(SHA384)) }
[2020-10-16 15:25:58.319][request][INFO] GET /alive
[2020-10-16 15:25:58.319][response][INFO] GET /alive (alive) => 200 OK
Here is my docker-compose file (portion dealing with the bitwardenrs attempted mysql implementation):
db:
container_name: mariadb
image: linuxserver/mariadb:latest
restart: always
hostname: mariadb-bitwarden_rs
secrets:
- mysql-user_secret
- mysql-root_secret
networks:
- bitwarden_rs_net
ports:
- 3306:3306
environment:
- TZ
- PUID=0
- GUID=0
- MYSQL_DATABASE=bitwarden
- FILE__MYSQL_ROOT_PASSWORD=/run/secrets/mysql-root_secret
- MYSQL_USER=bwuser
- FILE__MYSQL_PASSWORD=/run/secrets/mysql-user_secret
volumes:
- /var/data/db:/config
bitwardenrs-mysql:
container_name: bitwardenrs-mysql
image: bitwardenrs/server-mysql:latest
image: bitwardenrs/server:latest
restart: always
hostname: bitwardenrs-mysql-docker
networks:
- bitwarden_rs_net
secrets:
- smtp_password_secret
ports:
- 444:80
- 3013:3012
depends_on:
- db
environment:
- LOG_FILE=/data/bitwarden.log
- LOG_LEVEL=debug
- EXTENDED_LOGGING=true
- SIGNUPS_ALLOWED=true
- ADMIN_TOKEN=hi
- WEBSOCKET_ENABLED=true
- DOMAIN=https://bw.<domain>.com
- SMTP_HOST=postfix.<domain>.com
- SMTP_FROM=postmaster-bitwarden-mysql@bw.<domain>.com
- SMTP_SSL=true
- SMTP_USERNAME=smtp
- SMTP_PASSWORD=/run/secrets/smtp_password_secret
- TZ
- RUST_BACKTRACE=1
- ROCKET_TLS={certs = "/ssl/fullchain.pem", key = "/ssl/privkey.pem"}
#For Port 465 Settings are as follows:
#- SMTP_PORT=465
#- SMTP_EXPLICIT_TLS=true
#For Port 587 Settings are as follows:
- SMTP_PORT=587
- SMTP_EXPLICIT_TLS=false
#MYSQL RELATED
- DATABASE_URL='mysql://bwuser:bwuserpass@mariadb/bitwarden'
- ENABLE_DB_WAL=false
volumes:
- /var/data/bw-mysql-data:/data
- /etc/letsencrypt/bwbackend.<domain>.com:/ssl:ro
So my problem is the table structure for bitwarden within the database isn’t initially being created – I’m not even sure how to debug this since in the log files of my two containers – mariadb, and bitwardenrs-mysql there is nothing which would indicated either a failed or unsuccessful connection.