# `jadpo deliveries`

Retry, dismiss or cancel deliveries.

Lists the deliveries of events to subscribers, and the schedules' runs, that need an operator (area 12): those that failed, those whose outcome is unknown, and those whose action, with several changing calls, diverged from the record of its steps, newest first, 20 a page; a route's steps whose client didn't retry within a day are listed as unfinished. --state lists those pending, running, dismissed, cancelled or abandoned instead. `retry` sends a failed or diverged delivery again on the app's next tick, with a fresh retry budget, or asks the app's tick to run a schedule whose latest run failed and waits for it; with --not-done, a step in doubt or that failed goes again under a new key. `dismiss` sets a failed one aside, `cancel` stops a pending one, and `resolve` settles one whose outcome is unknown, once the provider shows whether it happened: --not-done retries it. `show` lists one's recorded steps, never a request or an answer, and `abandon` ends one with several changing calls for good, keeping that list 30 days. Each action is logged in the database with who did it, and runs none of the app's code. An id is the last 8 hex digits the list shows, or more. The databases are the ones the stores' connections' settings give, or a running jadpo dev's, or the one --url names (with --store when there are several). Times are in UTC.

Also: `jadpo delivery`.

```text
jadpo deliveries [action] [id]
```

## Arguments

- `action` (optional): What to do: list, show, retry, dismiss, cancel, resolve or abandon
- `id` (optional): The delivery's or schedule run's id, as the list shows it

## Flags

- `--state <state>`: List those in this state instead
- `--page <n>`: Which page of the list, from 1, newest first
- `--done`: Resolve as done: the outside call happened
- `--not-done`: It didn't happen: send it again
- `--url <url>`: The database the deliveries are in
- `--store <name>`: The store --url's database is

## On every command

- `--json`: Print data for tools instead of text
- `--full`: Show everything a report shortens
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo deliveries --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"deliveries"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# See what failed or is in doubt
jadpo deliveries
# Deliver a failed delivery again, once the cause is fixed
jadpo deliveries retry 4fa2c09e
# Settle one whose outside call happened
jadpo deliveries resolve 9b0d44a1 --done
# See what is waiting to run
jadpo deliveries --state pending
# List the steps of one with several changing calls
jadpo deliveries show 7c31e0b2
# Send its step in doubt again, once the provider shows it didn't happen
jadpo deliveries retry 7c31e0b2 --not-done
```

## Errors

- [`cli.deliveries_arguments`](/docs/errors/cli.deliveries_arguments.md): A `jadpo deliveries` command names an action it doesn't have, no id for one that needs it, or a state or page it doesn't list
- [`deliveries.not_found`](/docs/errors/deliveries.not_found.md): The id given to `jadpo deliveries` matches no delivery or schedule run in the database
- [`deliveries.unavailable`](/docs/errors/deliveries.unavailable.md): The app's deliveries couldn't be read from their database, because it can't be reached or has no table for them yet
- [`deliveries.wrong_state`](/docs/errors/deliveries.wrong_state.md): A delivery or schedule run was asked to do something its state rules out, such as cancelling one that has already failed
- [`schedules.lease_held`](/docs/errors/schedules.lease_held.md): A schedule was run by hand while another run of it still holds its lease, so it wasn't run again
- [`schedules.no_tick`](/docs/errors/schedules.no_tick.md): A schedule was run by hand against a deployment, and no tick of the app picked the run up in time, so nothing ran
- [`schedules.run_failed`](/docs/errors/schedules.run_failed.md): A schedule run by hand ended in a failure, or its run on the app never ended
- [`schedules.unavailable`](/docs/errors/schedules.unavailable.md): The app's schedules couldn't be read from their database, because it can't be reached or has no table for them yet
- [`toolchain.project_not_found`](/docs/errors/toolchain.project_not_found.md): You ran a command that works on a project in a folder with no `app.jadpo`, in it or in any folder above it
