Cyphrme / Cyphrme/Cyphr

Losing the server principal sidecar bricks a keyed server

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
bug correctness
Dominant language
Rust
Stars
3
Forks
0
Avg merge
1d 42m
Merged PRs (30d)
11

Description

A keyed server writes `data/server-principal.json`, holding its Principal Genesis and genesis key record. Delete that file while leaving the blob store intact and the server refuses to start:

```
ERROR cyphr_server: server exited with error
error=server principal storage: protocol: state mismatch
```

Two problems, and the second is the one that costs an operator their identity.

**The message names neither the missing file nor the fact that this is recoverable.** "State mismatch" against a "storage" subsystem reads as a corrupt store. An operator following that reading restores from backup or rebuilds — when what they have is an intact store missing one sidecar.

**Nothing documents that this file must be backed up.** It sits beside three directories that look like the entirety of the server's state, and no document named what lives in the data directory or which parts are rebuildable until now.

## It is recoverable, and the recipe should not have to be reverse-engineered

The file can be reconstructed from the signing key: `pg` is `SHA-512:` followed by the genesis key thumbprint, which for a server that has never rotated equals `payload.tmb` from `GET /server`. Doing that lets the server start again under its original Principal Genesis — which matters, because clients pin that value and a new one breaks every pin.

## What would fix it

Name the file in the error and say it is reconstructible. Better, reconstruct it: the server holds the signing key it would need, so a missing sidecar beside an intact store is a recoverable condition rather than a fatal one.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the server-principal storage error involving data/server-principal.json and the keyed server startup path. Check GET /server and the payload.tmb value against the documented reconstruction recipe. Done means the missing sidecar is clearly identified as recoverable, the original Principal Genesis is preserved, and the data directory documents what must be backed up.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.