Skip to content

Troubleshooting

Common issues and how to resolve them. Check the backend logs first:

docker compose logs -f backend --tail=100

Startup issues

Backend fails to start — JWT_SECRET_KEY missing

Symptom: With ENV=production, the container exits immediately with:

RuntimeError: ERREUR CRITIQUE : JWT_SECRET_KEY n'est pas défini ou utilise la valeur par défaut.
Without ENV=production, the backend starts anyway and only logs a warning ([security] JWT_SECRET_KEY utilise la valeur par défaut): do not rely on that outside a test.

Cause: The JWT_SECRET_KEY variable is empty, missing from backend.env, or still change-me-in-production.

Fix:

# Generate a strong key
openssl rand -hex 32
# Add to backend.env:
JWT_SECRET_KEY=<generated-value>
docker compose up -d backend


ClamAV takes 60+ seconds to start

Symptom: The health endpoint returns "clamav": {"ok": false} for up to 2 minutes after startup.

Cause: ClamAV loads ~800 MB of signatures into memory on first start. This is normal behavior.

Fix: Wait. Subsequent starts are faster because the database is cached in the repos/clamav-db/ volume. If the problem persists after 5 minutes, check:

docker compose logs backend | grep -i clamav

Database error: connection refused / password authentication failed

Symptom:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "db" ... refused
or
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user "repod"

Cause: backend-api started before PostgreSQL finished initializing, or DATABASE_URL (in backend.env) does not match POSTGRES_PASSWORD (in .env) used to initialize the db container.

Fix:

# Check the db container is healthy
docker compose ps db
docker compose logs db --tail=50

# Verify DATABASE_URL matches the credentials the db volume was initialized with
docker exec backend-api env | grep DATABASE_URL
docker exec repod-db env | grep POSTGRES_PASSWORD

# Restart backend-api once db is healthy
docker compose restart backend

Changing POSTGRES_PASSWORD after first start has no effect

PostgreSQL only applies POSTGRES_PASSWORD when initializing an empty postgres_data volume. If you change it afterwards, update the password inside PostgreSQL too (ALTER USER repod WITH PASSWORD '...') or the DATABASE_URL in backend.env will stop matching.


Upload failures

"Erreur serveur" on package upload

Symptom: The web interface shows "Erreur serveur" after selecting a file.

Cause: Nginx's client_max_body_size is set below the file size. The default in some configurations is 1 MB, which blocks any real package upload.

Diagnosis:

docker compose logs frontend-ui | grep 413
# Or check in the browser Network tab — look for HTTP 413 on the upload request
# If a reverse proxy sits in front of Repod, look in ITS logs too

Fix: The frontend's nginx configuration, frontend/nginx.conf.template, already sets client_max_body_size 512m; (in the server block and in location /api/). If you changed it, or if a reverse proxy in front of Repod has a lower limit (nginx defaults to 1 MB), raise that limit, then rebuild the frontend image:

docker compose build frontend-ui
docker compose up -d frontend-ui


Upload rejected — "Erreur réseau: NetworkError"

Symptom: Upload fails with a network error, before the server even receives the file.

Cause (most common): The frontend was built with an absolute REACT_APP_API_URL (for example http://localhost:8000), so the browser tries to reach localhost:8000 on the client machine rather than the server.

Diagnosis: REACT_APP_* variables are baked into the JavaScript at build time: they are not in the running container's environment (docker exec frontend-ui env shows nothing). Look inside the built files instead:

docker exec frontend-ui sh -c 'grep -rlE "https?://[0-9a-zA-Z.]+:8000" /usr/share/nginx/html'
# no output = the frontend uses relative URLs (the expected, correct state)

Fix: Leave REACT_APP_API_URL empty in .env: the browser then calls /api/v1/... on the address it was served from, and the frontend's nginx forwards it to the backend. Setting it to the server's address would break access from any other host name. Then rebuild:

# .env
REACT_APP_API_URL=
docker compose build frontend-ui
docker compose up -d frontend-ui


Package stuck in pending_review

Symptom: A package was uploaded successfully but does not appear in the APT/RPM repository. The web interface shows Status: pending_review.

Cause: The CVE scan found vulnerabilities matching the configured review policy. The package is stored but not published until approved.

Fix: see Decide what happens to a package that failed a CVE check. In short: 1. Open Sécurité → Décisions CVE in the web interface 2. Review the CVE findings for the package 3. Record a decision: accept the risk, grant an exception, require an update, or reject

Alternatively via API (action is one of accept_risk, exception, reject, upgrade_required; justification is mandatory):

curl -X POST http://localhost:8000/api/v1/security/packages/mypackage/1.0.0/decide \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"accept_risk","justification":"Vulnerability does not apply to our use case","expires_in_days":30}'


APT client issues

apt update fails — NO_PUBKEY

Symptom:

W: GPG error: http://repod.example.com:80 jammy InRelease: The following signatures
   couldn't be verified because the public key is not available: NO_PUBKEY ABCD1234...

Cause: The repository's GPG public key is not trusted by the client machine.

Fix:

# Re-import the key from the repository
curl -fsSL http://repod.example.com:80/repos/dists/depot.gpg \
  | gpg --dearmor \
  | sudo tee /etc/apt/trusted.gpg.d/repod.gpg > /dev/null

sudo apt update


apt update fails — 404 Not Found

Symptom:

E: Failed to fetch http://repod.example.com:80/repos/dists/jammy/InRelease
   404 Not Found

Cause: The codename in sources.list does not exist in Repod (a typo is the usual reason), or the distribution trees were never written.

Fix:

# 1. Check the codename against the ones Repod serves
curl -s -H "Authorization: Bearer $TOKEN" http://localhost:8000/api/v1/distributions/ | jq .
docker exec backend-api ls /repos/dists/

# 2. Only if /repos/dists/ is empty: write the configuration and export the trees
curl -X POST http://localhost:8000/api/v1/distributions/init \
  -H "Authorization: Bearer $TOKEN"
init does not add packages back: it only writes conf/distributions and exports repositories. A codename that exists but holds no package answers 200 with an empty index, not 404.


RPM client issues

dnf install fails — signature NOKEY

Symptom:

warning: /var/cache/dnf/repod/packages/mypackage-1.0.0.rpm: Header V4 RSA/SHA256
Signature, key ID ABCD1234: NOKEY

Cause: With gpgcheck=1, dnf checks each .rpm against its publisher's key (AlmaLinux, Fedora, Docker...), which the machine does not hold. Repod's key (depot.gpg) signs the repository metadata, not the packages, so importing it does not fix this (tested: with only Repod's keys, rpmkeys -K answers SIGNATURES NOT OK).

Fix: import the key whose ID the message shows, from its publisher:

sudo rpm --import <URL-of-the-publisher-key>
sudo dnf clean all
sudo dnf install mypackage
or list that key in the gpgkey= line of the .repo file, next to Repod's, as shown in Client setup.


createrepo_c errors in backend logs

Symptom:

createrepo_c failed (code 1): error: cannot open ...

Cause: The RPM distribution directory does not exist or has wrong permissions.

Fix:

# Re-initialize RPM distributions
curl -X POST http://localhost:8000/api/v1/distributions/init \
  -H "Authorization: Bearer $TOKEN"

# Check the tree and its permissions (RPM trees live under /repos/rpm/)
docker exec backend-api ls -la /repos/rpm/almalinux9/


Sync / import issues

"Erreur inconnue" during sync (ImportPage)

Symptom: The sync stream shows "Erreur inconnue" immediately when started.

Cause (common): The frontend was built with an older bundle that used incorrect API URLs (missing /api/v1 prefix). The browser is cached on the old build.

Fix: Hard-refresh the browser (Ctrl+Shift+R / Cmd+Shift+R). If the problem persists, clear the browser cache or rebuild the frontend:

docker compose build frontend-ui
docker compose up -d frontend-ui


Index sync returns 0 packages

Symptom: The sync completes without errors but no packages appear in the catalog.

Cause (APT): The external source's Release file cannot be fetched (network restriction, wrong URL, or missing GPG key for the source).

Cause (RPM): The source's repodata/repomd.xml is unreachable, or the PostgreSQL package index (the packages and sync_status tables) is empty or out of sync for that source.

Diagnosis:

docker compose logs backend | grep -i "sync\|error"

Fix (re-run sync):

TOKEN=$(curl -s -X POST http://localhost:8000/api/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"YourPassword"}' | jq -r .access_token)

curl -X POST http://localhost:8000/api/v1/import/sync/start \
  -H "Authorization: Bearer $TOKEN"


Authentication issues

Login fails with valid credentials

Symptom: The login page returns "Identifiants incorrects" despite using the correct username and password.

Possible causes: 1. The ADMIN_PASSWORD_HASH in backend.env contains unescaped $ signs (only applies if pre-provisioning an admin — most deployments instead create the first admin via the setup wizard, POST /api/v1/setup) 2. The users table is empty (PostgreSQL not yet initialized, or DATABASE_URL points at the wrong database) 3. The account is disabled (active = false) 4. No admin account exists yet — check GET /api/v1/setup/status; if admin_exists: false, create one via POST /api/v1/setup

Diagnosis:

# Check the users table directly in PostgreSQL
docker exec repod-db psql -U repod -d repod -c \
  "SELECT username, role, active, auth_source FROM users;"

Fix for hash escaping:

# In backend.env: replace every $ with $$
# Wrong:  ADMIN_PASSWORD_HASH=$2b$12$...
# Correct: ADMIN_PASSWORD_HASH=$$2b$$12$$...


MFA code rejected

Symptom: The TOTP code entered during MFA authentication is rejected despite being generated by the correct authenticator app.

Cause: The server's system clock differs from the client's by more than 30 seconds. TOTP codes are time-based and fail if clocks are not synchronized.

Fix:

# Check server time
docker exec backend-api date

# Sync the host clock (if using NTP)
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd


Performance issues

Backend is slow or unresponsive

Symptom: API requests take more than 10 seconds, or the health endpoint times out.

Cause (most common): ClamAV or Grype is performing a database update. This is CPU-intensive and can saturate the container's CPU allocation.

Diagnosis:

docker stats backend-api
docker compose logs backend | grep -i "freshclam\|grype\|update"

Fix: The default resource limits of the backend in docker-compose.yaml are 1.5 CPUs and 4 GB of RAM (clamd alone holds about 800 MB, and a catalogue of more than 500 000 packages needs about 2 GB). Raise them if your hardware allows:

docker-compose.override.yml
services:
  backend:
    deploy:
      resources:
        limits:
          memory: 6g
          cpus: "3.0"


Viewing logs

# All containers
docker compose logs -f

# Backend only, last 200 lines
docker compose logs backend --tail=200

# Filter for errors
docker compose logs backend 2>&1 | grep -i "error\|exception\|traceback"

# Audit log (last 50 entries)
# The file is JSON Lines (one object per line): format it line by line, not as one document
docker exec backend-api sh -c 'tail -n 50 /repos/audit/$(date +%Y-%m-%d).jsonl' | jq -c .