bitwarden / bitwarden/server

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

Open
#7,640 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
20.1k
Forks
1.8k
Avg merge
4d 8h
Merged PRs (30d)
75

Description

### Steps To Reproduce

1. Run official Bitwarden self-hosted update commands:

```bash id="zjlwm7"
./bitwarden.sh updateself
./bitwarden.sh update
./bitwarden.sh rebuild
./bitwarden.sh restart
```

2. Verify containers report healthy.
3. Attempt login and/or vault operations.
4. 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:

```txt id="jlwmqr"
Procedure or function CipherDetails_Create has too many arguments specified.
```

```txt id="12r4m4"
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:

```sql id="22ffzr"
EXEC sp_recompile 'User_ReadKdfByEmail';
EXEC sp_recompile 'CipherDetails_Create';

EXEC sp_updatestats;

EXEC sp_MSforeachtable 'EXEC sp_recompile ''?'''
```

followed by:

```bash id="4vh8z5"
./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

- Operating system: Arch Linux
- Environment: Docker
- Hardware: https://pcpartpicker.com/user/scottmangiapane/saved/#view=cVbbwP

### Issue Tracking Info

- [x] 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.