bitwarden / bitwarden/clients

Always error "Logout before server config update" when CLI run in systemd service

Open
#10,109 14 comments 1 reaction 0 assignees View on GitHub
bug cli
Dominant language
TypeScript
Stars
13.8k
Forks
2k
Avg merge
3d 9h
Merged PRs (30d)
397

Description

### Steps To Reproduce

I'm running the bitwarden CLI client in a script started by systemd to do a restore test of a backup.

Now every time I run `bw config server http://127.0.0.1:55555` I get
`Logout required before server config update.` even when running `bw logout` right before the command (it says `You are not logged in.`).
When running the same commands in a normal user shell things work as expexted.

`bw` is installed via Snap on Ubuntu 24.04.

Reverting back to the previous version fixed the issue:
```
$ snap list bw --all
Name Version Rev Tracking Publisher Notes
bw 2024.6.0 64 latest/stable bitwarden✓ disabled
bw 2024.6.1 65 latest/stable bitwarden✓ -
$ sudo snap revert bw
bw reverted to 2024.6.0
```

### Expected Result

It should just work like in version 2024.6.0.

### Actual Result

Error `Logout required before server config update.`

### Screenshots or Videos

_No response_

### Additional Context

I think the problem was introduced by https://github.com/bitwarden/clients/pull/9347

### Operating System

Linux

### Operating System Version

Ubuntu 24.04

### Shell

Bash

### Build Version

2024.6.1

### 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

Research direction

Reproduce the failure with the systemd-style commands described in the issue and compare it with a normal user shell and version 2024.6.0. Start by reviewing pull request 9347 and the CLI server-config and logout entry points it changed. Done means `bw config server http://127.0.0.1:55555` succeeds after logout in the affected environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.