Skip to content

Self-hosted update to 2026.4.1 caused SQL stored procedure/schema inconsistencies until manual recompilation #7640

@scottmangiapane

Description

@scottmangiapane

Steps To Reproduce

  1. Run official Bitwarden self-hosted update commands:
./bitwarden.sh updateself
./bitwarden.sh update
./bitwarden.sh rebuild
./bitwarden.sh restart
  1. Verify containers report healthy.
  2. Attempt login and/or vault operations.
  3. Observe failures in bitwarden-api and bitwarden-identity logs.

Expected Result

After updating, all Bitwarden services should function normally without requiring manual SQL Server intervention.

Database schema migrations and stored procedure recompilation should complete automatically during upgrade.

Actual Result

Bitwarden became partially unusable after update.

Observed errors included:

Procedure or function CipherDetails_Create has too many arguments specified.
The definition of object 'User_ReadKdfByEmail' has changed since it was compiled.

Additional deadlock errors also appeared in bitwarden-api logs afterward.

Login and vault operations failed until manual SQL Server recompilation steps were performed.

Issue was resolved only after manually running:

EXEC sp_recompile 'User_ReadKdfByEmail';
EXEC sp_recompile 'CipherDetails_Create';

EXEC sp_updatestats;

EXEC sp_MSforeachtable 'EXEC sp_recompile ''?'''

followed by:

./bitwarden.sh restart

Screenshots or Videos

No response

Additional Context

  • All containers reported healthy despite the issue.
  • Backend containers were on 2026.4.1.
  • web container updated to 2026.4.2.
  • This appears related to stale SQL Server procedure metadata or incomplete recompilation after schema migration.
  • No manual database modifications were made before the issue occurred.
  • Problem appeared immediately after running the official update workflow.

Build Version

2026.4.1

Environment

Self-Hosted

Environment Details

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions