Troubleshooting

403 Accès interdit: domaine invalide

The request used APP_TOKEN but did not come from one of config.APP_ORIGINS: its Origin or Referer must be exactly https://app.rewake.fr, https://sav.rewake.fr or https://info.rewake.fr. Server-side callers set the Origin header themselves. Scripts and tools use ADMIN_TOKEN instead.

403 Accès interdit: token invalide

The token is missing, wrong, or not allowed on this route (see Architecture › Access). An empty setting on the server matches nothing.

A script stays “queued” or never runs

  • Is the worker running? docker compose ps, then docker compose logs -f worker.

  • Does the worker reach Redis? Same REDIS_URL for the API and the worker.

  • A run reported skipped: the script is not configured (missing settings), or another run for the same record was already in progress.

  • Scheduled scripts need the beat service.

Airtable: 422 UNKNOWN_FIELD_NAME or INVALID_MULTIPLE_CHOICE_OPTIONS

A field or an option was renamed in Airtable. Regenerate the schema from the production base (make airtable-schema) and run make typecheck: it lists the code using names that no longer exist. Development and production bases may differ: check the base the API points to (AIRTABLE_BASE_ID).

Airtable: 429 (rate limit)

Airtable allows 5 requests per second per base. pyAirtable waits and retries a request refused for the rate limit; a lot of them means a loop of single calls that should be one batch (create_records, update_records) or one filtered read (list_records with a formula).

Shopify: authentication errors

The API exchanges SHOPIFY_CLIENT_ID / SHOPIFY_CLIENT_SECRET for a token itself. Check them and the app’s scopes with make shopify-check.

Where are the logs?

docker compose logs <service>, and LOG_DIR/api.log (JSON). Every request has an X-Request-ID header; search the logs for it. LOG_FORMAT=console makes them readable while developing.

Tests fail with “network call during a test”

A test reached an outside service. Fake it, or, if it truly needs the development base, mark it @pytest.mark.live and run it with make test-live.