# `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
- `--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`](../errors/cli.deliveries_arguments.md): Deliveries command has invalid arguments
- [`deliveries.not_found`](../errors/deliveries.not_found.md): No delivery or schedule run has the id given
- [`deliveries.unavailable`](../errors/deliveries.unavailable.md): Deliveries' database couldn't be read
- [`deliveries.wrong_state`](../errors/deliveries.wrong_state.md): Delivery or schedule run isn't in a state the action applies to
- [`schedules.lease_held`](../errors/schedules.lease_held.md): Schedule is already running
- [`schedules.no_tick`](../errors/schedules.no_tick.md): No tick picked up the run asked for
- [`schedules.run_failed`](../errors/schedules.run_failed.md): Schedule's run failed
- [`schedules.unavailable`](../errors/schedules.unavailable.md): Schedules' database couldn't be read
- [`toolchain.project_not_found`](../errors/toolchain.project_not_found.md): Project could not be found
