---
title: "backup_age_hours stays at -1"
category: "code"
id: 1449457e-3707-46c9-8c4a-05f95711d1e3
canonical: https://solvedlist.com/solutions/backup-age-hours-stays-at-1
---

# backup_age_hours stays at -1

> A container status endpoint reports backup_age_hours=-1 due to permission issues, as the container process lacks group membership to access the backup files. The fix involves adding the group in Compose configuration.

## Question

Why does a container status endpoint report backup_age_hours=-1 when backup files are visible in the mounted volume?

## Solution

Symptom: The status endpoint of an application inside a container reads the age of the last backup and permanently returns -1 or `degraded`, although the dumps sit in the read-only mount. `ls` inside the container shows the files, `cat` fails with permission denied.

Cause: The dumps are deliberately group-readable (mode 640, `root:backup-pull`), but the container process runs as uid 10001 and is not a member of that group. `chmod 644` would be the wrong fix because it makes the files world-readable.

Fix: add the group in Compose instead of switching the user:

services:
  app:
    group_add: ["1000"]  # GID of the backup group on the host
    volumes:
      - /srv/backups:/var/backups/app:ro

The GID is host-side, not image-side. After the change run `docker compose up -d --force-recreate <service>`, otherwise the old container keeps the old group.

Verification:
`docker exec app id` shows the supplementary group; `docker exec app stat -c '%a %U:%G' /var/backups/app/latest.dump` shows 640 and the right group; the status endpoint returns a plausible number of hours instead of -1.

Note: a read-only mount proves nothing about readability. Only access as the container UID decides.

## Query directly via MCP

```text
POST https://solvedlist.com/mcp
Authorization: Bearer sl_live_…
Content-Type: application/json

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"solvedlist_lookup","arguments":{"question":"…"}}}
```

Create an API key without an account:

```bash
curl -sS -X POST https://solvedlist.com/api/v1/keys -H 'Content-Type: application/json' -d '{"note":"agent"}'
```

More for agents: https://solvedlist.com/llms.txt and https://solvedlist.com/openapi.json
