Unable to confirm email addresses on new install #751

Closed
opened 2026-02-04 22:26:03 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @ChrisWiegman on GitHub (Jul 22, 2020).

Subject of the issue

On a new setup, I am unable to configure any email addresses. The log displays the following:

bitwarden_1    | [CAUSE] DatabaseError(
bitwarden_1    |     ForeignKeyViolation,
bitwarden_1    |     "Cannot delete or update a parent row: a foreign key constraint fails (`bitwarden`.`devices`, CONSTRAINT `devices_ibfk_1` FOREIGN KEY (`user_uuid`) REFERENCES `users` (`uuid`))",
bitwarden_1    | )

Your environment

  • Bitwarden_rs version: 1.16.0
  • Install method: Docker
  • Clients used:
  • Reverse proxy and version: Traefik 2.2
  • Version of mysql/postgresql: MariaDB 10.5.4
  • Other relevant information:

Steps to reproduce

  1. Bring up Bitwarden
  2. Register a new user
  3. Click email verification link
  4. See "Verify your email address" still visible in account

Expected behaviour

Clicking the verification link should verify the email address

Actual behaviour

Email address is not verified

Relevant logs

bitwarden_1    | [2020-07-21 22:50:18][bitwarden_rs::api::core::accounts][ERROR] Error saving email verification: Error saving user.
bitwarden_1    | [CAUSE] DatabaseError(
bitwarden_1    |     ForeignKeyViolation,
bitwarden_1    |     "Cannot delete or update a parent row: a foreign key constraint fails (`bitwarden`.`devices`, CONSTRAINT `devices_ibfk_1` FOREIGN KEY (`user_uuid`) REFERENCES `users` (`uuid`))",
bitwarden_1    | )
bitwarden_1    | [2020-07-21 22:50:18][response][INFO] POST /api/accounts/verify-email-token (post_verify_email_token) => 200 OK```
Originally created by @ChrisWiegman on GitHub (Jul 22, 2020). <!-- 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 unneccessary for your issue, feel free to remove them. Remember to hide/obfuscate personal and confidential information, such as names, global IP/DNS adresses and especially passwords, if neccessary. --> ### Subject of the issue On a new setup, I am unable to configure any email addresses. The log displays the following: ```bitwarden_1 | [2020-07-21 22:41:52][bitwarden_rs::api::core::accounts][ERROR] Error saving email verification: Error saving user. bitwarden_1 | [CAUSE] DatabaseError( bitwarden_1 | ForeignKeyViolation, bitwarden_1 | "Cannot delete or update a parent row: a foreign key constraint fails (`bitwarden`.`devices`, CONSTRAINT `devices_ibfk_1` FOREIGN KEY (`user_uuid`) REFERENCES `users` (`uuid`))", bitwarden_1 | ) ``` ### Your environment <!-- The version number, obtained from the logs or the admin page --> * Bitwarden_rs version: 1.16.0 <!-- How the server was installed: Docker image / package / built from source --> * Install method: Docker * Clients used: <!-- if applicable --> * Reverse proxy and version: Traefik 2.2 * Version of mysql/postgresql: MariaDB 10.5.4 * Other relevant information: ### Steps to reproduce 1. Bring up Bitwarden 2. Register a new user 3. Click email verification link 4. See "Verify your email address" still visible in account ### Expected behaviour Clicking the verification link should verify the email address ### Actual behaviour Email address is not verified ### Relevant logs <!-- Share some logfiles, screenshots or output of relevant programs with us. --> ```bitwarden_1 | [2020-07-21 22:50:18][request][INFO] POST /api/accounts/verify-email-token bitwarden_1 | [2020-07-21 22:50:18][bitwarden_rs::api::core::accounts][ERROR] Error saving email verification: Error saving user. bitwarden_1 | [CAUSE] DatabaseError( bitwarden_1 | ForeignKeyViolation, bitwarden_1 | "Cannot delete or update a parent row: a foreign key constraint fails (`bitwarden`.`devices`, CONSTRAINT `devices_ibfk_1` FOREIGN KEY (`user_uuid`) REFERENCES `users` (`uuid`))", bitwarden_1 | ) bitwarden_1 | [2020-07-21 22:50:18][response][INFO] POST /api/accounts/verify-email-token (post_verify_email_token) => 200 OK```
Author
Owner

@skywiley commented on GitHub (Aug 8, 2020):

I am running into this same issue using almost exactly the same setup.

I switched from MariaDB 10.5.4 to MySQL 5.7 (mysql:5.7 docker image) and everything worked as intended. Although personally would like to stick with MariaDB.

If I had to guess, maybe related to #1081?

@skywiley commented on GitHub (Aug 8, 2020): I am running into this same issue using almost exactly the same setup. I switched from MariaDB 10.5.4 to MySQL 5.7 (mysql:5.7 docker image) and everything worked as intended. Although personally would like to stick with MariaDB. If I had to guess, maybe related to #1081?
Author
Owner

@jobec commented on GitHub (Aug 9, 2020):

I had the same issue.
You can stick with MariaDB, just set the database image to mariadb:10.3
It seems that's the version compatible with MySQL 5.7.

@jobec commented on GitHub (Aug 9, 2020): I had the same issue. You can stick with MariaDB, just set the database image to `mariadb:10.3` It seems that's the version compatible with MySQL 5.7.
Author
Owner

@ChrisWiegman commented on GitHub (Aug 11, 2020):

I'm afraid downgrading to an older version of the DB is not a solution in this instance. Hopefully it can be fixed with current versions of MariaDB

@ChrisWiegman commented on GitHub (Aug 11, 2020): I'm afraid downgrading to an older version of the DB is not a solution in this instance. Hopefully it can be fixed with current versions of MariaDB
Author
Owner

@smerschjohann commented on GitHub (Aug 26, 2020):

The current workaround for me is to disable the constraint checks.

@smerschjohann commented on GitHub (Aug 26, 2020): The current workaround for me is to disable the constraint checks.
Author
Owner

@peterneutron commented on GitHub (Sep 20, 2020):

Same issue when adding an attachment,

Sep 20 20:26:08 s01 bitwarden_rs[166828]: [CAUSE] DatabaseError(
Sep 20 20:26:08 s01 bitwarden_rs[166828]:     ForeignKeyViolation,
Sep 20 20:26:08 s01 bitwarden_rs[166828]:     "Cannot delete or update a parent row: a foreign key constraint fails (`bitwarden_rs`.`attachments`, CONSTRAINT `attachments_ibfk_1` FOREIGN KEY (`cipher_uuid`) REFERENCES `ciph>
Sep 20 20:26:08 s01 bitwarden_rs[166828]: )
Sep 20 20:26:08 s01 bitwarden_rs[166828]: [2020-09-20 20:26:08.470][response][INFO] PUT /api/ciphers/<uuid> (put_cipher) => 400 Bad Request```
@peterneutron commented on GitHub (Sep 20, 2020): Same issue when adding an attachment, ```Sep 20 20:26:08 s01 bitwarden_rs[166828]: [2020-09-20 20:26:08.469][error][ERROR] Error saving cipher. Sep 20 20:26:08 s01 bitwarden_rs[166828]: [CAUSE] DatabaseError( Sep 20 20:26:08 s01 bitwarden_rs[166828]: ForeignKeyViolation, Sep 20 20:26:08 s01 bitwarden_rs[166828]: "Cannot delete or update a parent row: a foreign key constraint fails (`bitwarden_rs`.`attachments`, CONSTRAINT `attachments_ibfk_1` FOREIGN KEY (`cipher_uuid`) REFERENCES `ciph> Sep 20 20:26:08 s01 bitwarden_rs[166828]: ) Sep 20 20:26:08 s01 bitwarden_rs[166828]: [2020-09-20 20:26:08.470][response][INFO] PUT /api/ciphers/<uuid> (put_cipher) => 400 Bad Request```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#751