Debugging Live Services
Async processor API
TBC
Main application (digital-land.info)
TBC
Planning data design
TBC
Check and Provide service
For what the service does and how it is put together, see the Check and Provide section. Two pages are particularly useful when something is wrong in a live environment:
- Smoke testing — how to confirm whether an environment is actually broken, starting with the
/healthendpoint - Check data — the URL failure modes, which explain most reported “the check is broken” cases
Before you dig in
Request /health on the environment first — for example https://provide.planning.data.gov.uk/health. It reports the status of the async request backend, Datasette, S3 and Redis individually, so it will tell you immediately whether the problem is Check and Provide or something it depends on.
Check service error
When the check service is returning an error, the best way to debug it is to use the async processor API to check the data.
To do this, follow the steps below:
-
Get a check request ID from the check service.
This can be found in the URL of the check tool. It will be a long string of characters, for example:https://provide.planning.data.gov.uk/check/results/bJKVgr5DmDCwXYgCLX4umk/28the ID would bebJKVgr5DmDCwXYgCLX4umk. -
Use the async processor API to check the data, at
{async-api}/requests/{check_request_id}.
Use the same host the service itself uses for that environment:Environment Async request API Production https://pub-async.planning.data.gov.ukStaging https://pub-async.staging.planning.data.gov.ukDevelopment https://pub-async.development.planning.data.gov.ukThis will return the check request status and the results.
The results will be a JSON object with the following fields:status: The status of the check request.response.data: The results of the check request.response.error: The errors of the check request.
-
The status can be
COMPLETE, but may still haveresponse.error. Note that bothCOMPLETEandFAILEDmean processing has stopped — the service treats either as finished, so a failed request must be identified by its status rather than by whether it has completed. -
If the status is
COMPLETEand there is noresponse.error, then the data is valid.
The check reports something the user disagrees with
Issue types, severities, conversion and field mapping are produced by the pipeline code inside the async request backend, not by Check and Provide. The service only renders what it is given, so a result that looks wrong is usually explained in the backend rather than in the frontend application.