# `data.erasure_log_reader_invalid`

The erasure log's `reader:` reads something other than a `SigningKey` setting of its own.

Area 15, [Personal data](/docs/personal-data.md); not declinable; the next step is usually the agent's.

## Why Jadpo refuses it

`reader:` is the key a backup service outside your app reads the erasure log
with, and the service holds it. So it has to be a secret that never appears in
your source, strong enough to be a credential, and one that opens the log and
nothing else. A key that also signed sessions, tokens or a `crypto` call would
let the service do those too.

## What it looks like

The same setting read by an action's `crypto` call as well:






domains/club/actions/sign_body.jadpo:

```jadpo
use club/types { BodySignature, SignedBody }

/// The signature on what the club sends.
action sign_body(body: SignedBody) -> BodySignature {
    return BodySignature(crypto.hmac(body, key: config.erasure_log_reader))
}
```

```text
error: `erasure_log_reader` is the erasure log's reader key, and is read somewhere else too
 --> app.jadpo:13:21
   |
13 |             reader: config.erasure_log_reader
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ the backup service's key
  reason: The backup service holds this key, so whatever else reads `erasure_log_reader` it could do too: sign sessions or tokens, or make the signatures a `crypto` call makes. Its key reads the erasure log and nothing else.
  next: Declare a `SigningKey` setting of its own for `reader:`, and leave `erasure_log_reader` to the other (agent)
  rule: data.erasure_log_reader_invalid
  help: https://jadpo.dev/docs/errors/data.erasure_log_reader_invalid

check failed: 1 error, 6 files
```

`(agent)` at the end of the `next:` line means your coding agent can make the fix itself.

## How to fix it

**If the setting is read somewhere else too,** give the backup service a key
of its own, and leave the other setting to what else reads it:


```jadpo
config {
    erasure_log_reader: SigningKey
    signing_secret: SigningKey
}
```




```jadpo
use club/types { BodySignature, SignedBody }

/// The signature on what the club sends.
action sign_body(body: SignedBody) -> BodySignature {
    return BodySignature(crypto.hmac(body, key: config.signing_secret))
}
```

The backup service's key now reads the erasure log and nothing else, and
`signing_secret` signs what the club sends. A `reader:` written in the source,
or reading a setting of another type, is fixed the same way, with a
`SigningKey` setting of its own.

## Related

- [What a backup service reads](/docs/erasure-after-the-commit.md#what-a-backup-service-reads)
- [Signing keys](/docs/signing-keys.md)
- [`data.erasure_log_store`](/docs/errors/data.erasure_log_store.md)
