Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Vaultwarden
  3. Vaultwarden fails to start after update – DB migration error (SSO)

Vaultwarden fails to start after update – DB migration error (SSO)

Scheduled Pinned Locked Moved Solved Vaultwarden
26 Posts 14 Posters 339 Views 14 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • fbartelsF Offline
    fbartelsF Offline
    fbartels
    App Dev
    wrote last edited by
    #17

    This has been reported along with a potential fix in https://forum.cloudron.io/topic/14812/vaultwarden-fails-to-start-after-update-db-migration-error-sso

    1 Reply Last reply
    2
    • fbartelsF fbartels referenced this topic
    • jadudmJ Offline
      jadudmJ Offline
      jadudm
      wrote last edited by
      #18

      The fix that @inibudi posted worked for me.

      I use Cloudron on a DXP2800 NAS w/ 8TB in ZFS RAID1

      1 Reply Last reply
      3
      • archosA archos

        After updating the Vaultwarden app on Cloudron, the application never reaches the Running state and gets stuck in a start / restart loop.

        The app logs show the following error:

        Dec 29 18:21:11 9: vaultwarden::main
        Dec 29 18:21:11 [2025-12-29 17:21:11.256][panic][ERROR] thread 'main' panicked at 'Error running migrations: QueryError(DieselMigrationName { name: "2024-03-06-170000_add_sso_users", version: MigrationVersion("20240306170000") }, DatabaseError(Unknown, "Referencing column 'user_uuid' and referenced column 'uuid' in foreign key constraint 'sso_users_ibfk_1' are incompatible."))': src/db/mod.rs:505
        Dec 29 18:21:11 [INFO] Using saved config from `/app/data/config.json` for configuration.
        Dec 29 18:21:11 [WARNING] Please use the admin panel to make changes to them:
        Dec 29 18:21:11 [WARNING] SIGNUPS_ALLOWED, INVITATIONS_ALLOWED, YUBICO_CLIENT_ID, YUBICO_SECRET_KEY
        Dec 29 18:21:11 [WARNING] The following environment variables are being overridden by the config.json file.
        Dec 29 18:21:14 2025-12-29T18:21:14+01:00
        Dec 29 18:21:14 2025-12-29T18:21:14+01:00
        Dec 29 18:21:14 2025-12-29T18:21:14+01:00
        Dec 29 18:21:14 2025-12-29T18:21:14+01:00
        Dec 29 18:21:14 /--------------------------------------------------------------------\
        Dec 29 18:21:14 0: vaultwarden::init_logging::{{closure}}
        Dec 29 18:21:14 10: std::sys::backtrace::__rust_begin_short_backtrace
        Dec 29 18:21:14 11: main
        Dec 29 18:21:14 12: <unknown>
        Dec 29 18:21:14 13: __libc_start_main
        Dec 29 18:21:14 14: _start
        Dec 29 18:21:14 1: std::panicking::panic_with_hook
        Dec 29 18:21:14 2: std::panicking::panic_handler::{{closure}}
        Dec 29 18:21:14 3: std::sys::backtrace::__rust_end_short_backtrace
        

        It looks like the migration related to SSO fails, but I’m not sure what the correct or recommended way to handle this situation is.

        Has anyone encountered this issue?
        Is there a supported way to fix this without manually modifying the database?

        Thanks for any pointers.

        jdaviescoatesJ Online
        jdaviescoatesJ Online
        jdaviescoates
        wrote last edited by
        #19

        @archos said in Vaultwarden fails to start after update – DB migration error (SSO):

        After updating the Vaultwarden app on Cloudron

        From/ to which version?

        I use Cloudron with Gandi & Hetzner

        jamesJ 1 Reply Last reply
        0
        • jdaviescoatesJ jdaviescoates

          @archos said in Vaultwarden fails to start after update – DB migration error (SSO):

          After updating the Vaultwarden app on Cloudron

          From/ to which version?

          jamesJ Offline
          jamesJ Offline
          james
          Staff
          wrote last edited by
          #20

          Hello @jdaviescoates
          From version Cloudron package version 1.22.2 => Vaultwarden Version 1.34.3 to Cloudron package version 1.23.0 => Vaultwarden Version 1.35.0

          jdaviescoatesJ 1 Reply Last reply
          1
          • jamesJ james has marked this topic as solved
          • jamesJ james

            Hello @jdaviescoates
            From version Cloudron package version 1.22.2 => Vaultwarden Version 1.34.3 to Cloudron package version 1.23.0 => Vaultwarden Version 1.35.0

            jdaviescoatesJ Online
            jdaviescoatesJ Online
            jdaviescoates
            wrote last edited by
            #21

            @james OK, thanks. Looks like that is the pending update I have. Is there anyway to avoid having to do the fix above post update? Might another Cloudron package be released that has the fix?

            I use Cloudron with Gandi & Hetzner

            jamesJ 1 Reply Last reply
            0
            • M Offline
              M Offline
              mazarian
              wrote last edited by
              #22

              Thank you! This saved me a lot of time and fixed the issue. I followed your steps and appreciated the ChatGPT workaround. 🙂

              1 Reply Last reply
              2
              • jdaviescoatesJ jdaviescoates

                @james OK, thanks. Looks like that is the pending update I have. Is there anyway to avoid having to do the fix above post update? Might another Cloudron package be released that has the fix?

                jamesJ Offline
                jamesJ Offline
                james
                Staff
                wrote last edited by
                #23

                Hello @jdaviescoates

                @jdaviescoates said in Vaultwarden fails to start after update – DB migration error (SSO):

                Might another Cloudron package be released that has the fix?

                A fresh Vaultwarden installation will not have this issue.
                About including a fix within the package.
                We will have to look into it.

                1 Reply Last reply
                0
                • jamesJ Offline
                  jamesJ Offline
                  james
                  Staff
                  wrote last edited by
                  #24

                  Hello @vaultwarden users

                  Since users have voiced their concerns about manually editing the database I have created a bash script that does it for you.
                  Please follow these steps if you have this issue:

                  1. create an app backup of your @vaultwarden Cloudron app
                  2. put the erroring @vaultwarden app in recovery mode
                  3. open the File Manager of your @vaultwarden app and create a fix_db.sh file
                  4. copy and paste the following script into the just created fix_db.sh file:
                    #!/bin/bash
                    
                    echo "=> Checking if DEFAULT_CHARACTER_SET_NAME and DEFAULT_COLLATION_NAME are set to utf8mb4 and utf8mb4_unicode_ci"
                    
                    CURRENT_DEFAULT_CHARACTER_SET_NAME=$(mysql --silent --skip-column-names --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SELECT DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '${CLOUDRON_MYSQL_DATABASE}';" 2>/dev/null)
                    CURRENT_DEFAULT_COLLATION_NAME=$(mysql --silent --skip-column-names --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '${CLOUDRON_MYSQL_DATABASE}';" 2>/dev/null)
                    FIX_NEEDED=0
                    
                    if [ "${CURRENT_DEFAULT_CHARACTER_SET_NAME}" != "utf8mb4" ] || [ "${CURRENT_DEFAULT_COLLATION_NAME}" != "utf8mb4_unicode_ci" ]; then
                        echo "=> DEFAULT_CHARACTER_SET_NAME or DEFAULT_COLLATION_NAME is not set to utf8mb4 or utf8mb4_unicode_ci."
                        echo "==> Current values are: DEFAULT_CHARACTER_SET_NAME=${CURRENT_DEFAULT_CHARACTER_SET_NAME}, DEFAULT_COLLATION_NAME=${CURRENT_DEFAULT_COLLATION_NAME}"
                        FIX_NEEDED=1
                    else
                        echo "=> DEFAULT_CHARACTER_SET_NAME is ${CURRENT_DEFAULT_CHARACTER_SET_NAME} and DEFAULT_COLLATION_NAME is ${CURRENT_DEFAULT_COLLATION_NAME}"
                        echo "=> Nothing to do - quitting."
                        FIX_NEEDED=0
                        exit 0
                    fi
                    
                    if [ ${FIX_NEEDED} -eq 1 ]; then
                        read -p "Have you created a backup of your Cloudron Vaultwarden app? (y/N): " yn
                        case $yn in
                            [Yy]* )
                                echo "=> Setting database character set and collation to utf8mb4 and utf8mb4_unicode_ci."
                                mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "ALTER DATABASE \`${CLOUDRON_MYSQL_DATABASE}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" 2>/dev/null
                                echo "=> Converting all tables to character set utf8mb4 and collation utf8mb4_unicode_ci."
                                mysql --silent --skip-column-names \
                      --user="${CLOUDRON_MYSQL_USERNAME}" \
                      --password="${CLOUDRON_MYSQL_PASSWORD}" \
                      --host="${CLOUDRON_MYSQL_HOST}" \
                      "${CLOUDRON_MYSQL_DATABASE}" \
                      -e "SELECT CONCAT('ALTER TABLE \`', TABLE_NAME,'\` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') AS CharSetConvert FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='${CLOUDRON_MYSQL_DATABASE}' AND TABLE_TYPE=\"BASE TABLE\";" 2>/dev/null | while read -r sql_command; do
                                    echo "==> Executing: ${sql_command}"
                                    mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SET foreign_key_checks=0; ${sql_command} SET foreign_key_checks=1;" 2>/dev/null
                                done
                                ;;
                            [Nn]* )
                                echo "=> Please create a backup of your database before proceeding with the fix. Exiting."
                                exit 1
                                ;;
                            * )
                                echo "=> Invalid response. Please answer with y or n. Exiting."
                                exit 1
                                ;;
                        esac
                    fi
                    
                  5. open the Web Terminal of your @vaultwarden Cloudron app
                  6. execute the following command:
                    bash /app/data/fix_db.sh
                    
                  7. Execute the following command to start @vaultwarden:
                    /app/pkg/start.sh
                    
                  8. Validate if your @vaultwarden is now working correctly
                  9. If validated working, you can delete the fix_db.sh file and disable the recovery mode of your @vaultwarden Cloudron app

                  If you run into any issues, copy the output of the terminal, post it here and restore your app from the backup created.

                  andreasduerenA 1 Reply Last reply
                  4
                  • E Offline
                    E Offline
                    ekevu123
                    wrote last edited by
                    #25

                    I confirm this works!

                    1 Reply Last reply
                    2
                    • jamesJ james

                      Hello @vaultwarden users

                      Since users have voiced their concerns about manually editing the database I have created a bash script that does it for you.
                      Please follow these steps if you have this issue:

                      1. create an app backup of your @vaultwarden Cloudron app
                      2. put the erroring @vaultwarden app in recovery mode
                      3. open the File Manager of your @vaultwarden app and create a fix_db.sh file
                      4. copy and paste the following script into the just created fix_db.sh file:
                        #!/bin/bash
                        
                        echo "=> Checking if DEFAULT_CHARACTER_SET_NAME and DEFAULT_COLLATION_NAME are set to utf8mb4 and utf8mb4_unicode_ci"
                        
                        CURRENT_DEFAULT_CHARACTER_SET_NAME=$(mysql --silent --skip-column-names --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SELECT DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '${CLOUDRON_MYSQL_DATABASE}';" 2>/dev/null)
                        CURRENT_DEFAULT_COLLATION_NAME=$(mysql --silent --skip-column-names --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '${CLOUDRON_MYSQL_DATABASE}';" 2>/dev/null)
                        FIX_NEEDED=0
                        
                        if [ "${CURRENT_DEFAULT_CHARACTER_SET_NAME}" != "utf8mb4" ] || [ "${CURRENT_DEFAULT_COLLATION_NAME}" != "utf8mb4_unicode_ci" ]; then
                            echo "=> DEFAULT_CHARACTER_SET_NAME or DEFAULT_COLLATION_NAME is not set to utf8mb4 or utf8mb4_unicode_ci."
                            echo "==> Current values are: DEFAULT_CHARACTER_SET_NAME=${CURRENT_DEFAULT_CHARACTER_SET_NAME}, DEFAULT_COLLATION_NAME=${CURRENT_DEFAULT_COLLATION_NAME}"
                            FIX_NEEDED=1
                        else
                            echo "=> DEFAULT_CHARACTER_SET_NAME is ${CURRENT_DEFAULT_CHARACTER_SET_NAME} and DEFAULT_COLLATION_NAME is ${CURRENT_DEFAULT_COLLATION_NAME}"
                            echo "=> Nothing to do - quitting."
                            FIX_NEEDED=0
                            exit 0
                        fi
                        
                        if [ ${FIX_NEEDED} -eq 1 ]; then
                            read -p "Have you created a backup of your Cloudron Vaultwarden app? (y/N): " yn
                            case $yn in
                                [Yy]* )
                                    echo "=> Setting database character set and collation to utf8mb4 and utf8mb4_unicode_ci."
                                    mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "ALTER DATABASE \`${CLOUDRON_MYSQL_DATABASE}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" 2>/dev/null
                                    echo "=> Converting all tables to character set utf8mb4 and collation utf8mb4_unicode_ci."
                                    mysql --silent --skip-column-names \
                          --user="${CLOUDRON_MYSQL_USERNAME}" \
                          --password="${CLOUDRON_MYSQL_PASSWORD}" \
                          --host="${CLOUDRON_MYSQL_HOST}" \
                          "${CLOUDRON_MYSQL_DATABASE}" \
                          -e "SELECT CONCAT('ALTER TABLE \`', TABLE_NAME,'\` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') AS CharSetConvert FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='${CLOUDRON_MYSQL_DATABASE}' AND TABLE_TYPE=\"BASE TABLE\";" 2>/dev/null | while read -r sql_command; do
                                        echo "==> Executing: ${sql_command}"
                                        mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} -e "SET foreign_key_checks=0; ${sql_command} SET foreign_key_checks=1;" 2>/dev/null
                                    done
                                    ;;
                                [Nn]* )
                                    echo "=> Please create a backup of your database before proceeding with the fix. Exiting."
                                    exit 1
                                    ;;
                                * )
                                    echo "=> Invalid response. Please answer with y or n. Exiting."
                                    exit 1
                                    ;;
                            esac
                        fi
                        
                      5. open the Web Terminal of your @vaultwarden Cloudron app
                      6. execute the following command:
                        bash /app/data/fix_db.sh
                        
                      7. Execute the following command to start @vaultwarden:
                        /app/pkg/start.sh
                        
                      8. Validate if your @vaultwarden is now working correctly
                      9. If validated working, you can delete the fix_db.sh file and disable the recovery mode of your @vaultwarden Cloudron app

                      If you run into any issues, copy the output of the terminal, post it here and restore your app from the backup created.

                      andreasduerenA Offline
                      andreasduerenA Offline
                      andreasdueren
                      wrote last edited by andreasdueren
                      #26

                      @james this won’t fix the issue of logging everyone out though I assume?

                      Edit: just saw the newest update.

                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search