> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# blobhub installer install

> Install an app version under an alias, or upgrade an installation, and follow its log

`install` installs a committed version of an app into an installer blob under an alias. Naming an alias that already
exists upgrades that installation, forward only: to a newer version, or to the same one again. Naming an `uninstalled`
or `failed` one installs it again. It prints the plan, the lines the platform would act on and the limits the version
needs, refuses unless `--yes` confirms them, and then follows the log until the installation settles.

## Synopsis

```bash theme={null}
blobhub installer install <org>/<app> --installer <org>/<blob> --alias <alias> [--version <v>]
                          [--input <name=value>] [--yes]
```

| Argument or flag | Default | Description |
| - | - | - |
| `<org>/<app>` | required | The app blob, as `<org>/<blob>`. |
| `--installer` | required | The installer blob, as `<org>/<blob>`. A missing one is created, private. |
| `--alias` | required | The installation's alias. A new alias installs; an existing one upgrades. |
| `--version` | newest committed | A committed version of the app, such as `0.2.0`, or `draft`. Left out, the newest committed version, as this run's plan printed it: the install sends that plan's digest, so a version committed between the print and the install is refused with `PLAN_CHANGED`, never installed unconfirmed. |
| `--input` | none | An input's value: `name=value`, `name=@path` or `name=env:VAR`. Repeatable. |
| `--yes` | off | Confirms the plan printed, by sending its digest. Without it the command refuses. |

## What it does

The sequence is the one in the [installer overview](https://docs.blobhub.io/cli/installer/overview.md#plan-first-then-confirm):

1. Reads the installer blob. If it is absent, creates it, private, and prints `created installer blob
   acme-corp/installed-apps`. This is the only write without `--yes`.
2. Asks the platform for the [plan](https://docs.blobhub.io/blob-types/installer/operations/plan.md) of the install and prints a header, its
   lines and its [limits block](#limits-and-problems).
3. Checks the plan's problems before `--yes`. A plan that has problems is never acted on, with or without `--yes`: the
   command prints each as `problem: <text>`, ends with `refused: N problems; nothing was installed` and exits `1` with
   `INSTALL_HAS_PROBLEMS`. Otherwise, without `--yes`, it ends with `refused: pass --yes to install` and exit `1`.
4. With `--yes`, notes the log's last entry and calls [`install`](https://docs.blobhub.io/blob-types/installer/operations/install) with
   `confirmed` set to the plan's [digest](https://docs.blobhub.io/blob-types/installer/operations/plan.md#digest). It follows the log once a
   second until the installation leaves `installing`, then drains it once more. When the plan has changed by then,
   nothing is installed ([When the plan changes](#when-the-plan-changes)).

The dry run of the first Field Reports install:

```console theme={null}
blobhub installer install acme-corp/field-reports --installer acme-corp/installed-apps --alias reports \
  --version 0.2.0 --input config=@envs/acme.yaml --input weather_key=env:WEATHER_API_KEY
```

```text theme={null}
created installer blob acme-corp/installed-apps
Field Reports 0.2.0 from acme-corp/field-reports, as reports in acme-corp/installed-apps
  creates blob reports-flows (blobhub.compute.workflow)
  creates blob reports-schedules (blobhub.compute.scheduler)
  creates service account reports-runner, a member of both blobs with WRITE
  stores credentials weather, blobhub and sync_token on reports-runner
  widget report-viewer asks to: read session objects, read threads
  runs reports-migrate in session reports
# … the limits block: rows at acme-corp, acme-corp/installed-apps and both blobs, every one ok
refused: pass --yes to install
```

The first line appears only on the run that creates the installer blob. The limits block is cut here; the
[upgrade](#upgrading) shows a whole one. The same command with `--yes` prints the plan again, installs, and prints the
log as it is written:

```console theme={null}
blobhub installer install acme-corp/field-reports --installer acme-corp/installed-apps --alias reports \
  --version 0.2.0 --input config=@envs/acme.yaml --input weather_key=env:WEATHER_API_KEY --yes
```

```text theme={null}
# … the header, the lines and the limits block, as above
14:20:03  install 0.2.0 requested by Ana Ruiz
14:20:03  creates blob reports-flows (blobhub.compute.workflow)
14:20:03  creates blob reports-schedules (blobhub.compute.scheduler)
14:20:03  creates service account reports-runner, a member of both blobs with WRITE
14:20:03  stores credentials weather, blobhub and sync_token on reports-runner
14:20:03  widget report-viewer asks to: read session objects, read threads
14:20:03  runs reports-migrate in session reports
14:20:04  created service account reports-runner
14:20:04  stored 3 credentials on reports-runner
14:20:05  created blob reports-flows; applied 4 definitions, 1 session, 2 objects
14:20:06  created blob reports-schedules; applied 1 schedule
14:20:06  running reports-migrate in session reports
14:20:10  reports-migrate completed in 4.1 s
14:20:10  ready at 0.2.0
```

## Upgrading

The same command with a newer version upgrades the installation `reports`. Its inputs carry only what changes: the
installation remembers its documents, and the `weather` credential exists, so `weather_key` counts as given.

```console theme={null}
blobhub installer install acme-corp/field-reports --installer acme-corp/installed-apps --alias reports \
  --version 0.3.0 --input config=@envs/acme.yaml
```

```text theme={null}
Field Reports 0.3.0 from acme-corp/field-reports, as reports in acme-corp/installed-apps (from 0.2.0)
  updates blob reports-flows
  updates blob reports-schedules
  widget report-viewer asks to: read session objects, read threads
  runs reports-migrate in session reports, from 0.2.0 to 0.3.0
limits at acme-corp/reports-flows
  ok     blobhub.compute.workflow.definitions_per_revision       at least 2       10 (default)
  ok     blobhub.compute.workflow.executions_per_session         at least 400     27000 (org)
  ok     blobhub.compute.workflow.playgrounds_per_revision       at least 1       10 (default)
  ok     blobhub.compute.workflow.session_objects_per_session    at least 2       1000 (default)
  ok     blobhub.compute.workflow.widgets_per_revision           at least 1       10 (default)
limits at acme-corp/reports-schedules
  ok     blobhub.compute.scheduler.min_interval_seconds          at most 86400    60 (default)
  ok     blobhub.compute.scheduler.schedules_per_revision        at least 1       10 (default)
refused: pass --yes to install
```

Both blobs, the session and the record exist by then, so only the rows at the two blobs remain. The one row `flows`
declares, `blobhub.compute.workflow.executions_per_session` at least 400, reads `27000 (org)`, the value `acme-corp`
sets for its organization. The others are what the platform derives from the content
([Derived requirements](https://docs.blobhub.io/blob-types/installer/overview.md#derived-requirements)).

An installation moves forward only. A committed version older than the one it last asked for, such as `0.2.0` after
`0.3.0`, is the problem `version_downgrade`. A version whose [`upgrade.from`](https://docs.blobhub.io/blob-types/app/app-yaml#upgrade) is
newer than the version the installation was last ready at is `upgrade_unsupported`: install a version in between
first. The same version again is allowed, and is how a failed upgrade is retried.

A `ready` or `failed` installation keeps its kind. `reports` installs committed versions, so `--version draft` over it
is the problem `development_mismatch`; the draft is tried as a
[development installation](https://docs.blobhub.io/blob-types/installer/overview.md#development-installations) under another alias, such as
`reports-dev`, which in turn takes only the draft.

An upgrade that adds no account and no credential can run in CI under a service account's key; see
[who installs](https://docs.blobhub.io/cli/installer/overview.md#who-installs).

## Limits and problems

After its lines, a plan prints its limits block: every
[requirement](https://docs.blobhub.io/blob-types/installer/overview.md#requirements) of the version, declared or derived, grouped under
`limits at <where>`, the organization or a blob as the install will leave it. Each row is `ok` or `unmet`, then the
limit's id, what the version needs, and what the place has with the level the value comes from: `default`, `platform`,
or the `user`, `org` or `blob` override. The rows are printed as the plan answers them, unmet first, and nothing in
them is shortened. The block prints no row's `fix`, which only `--json` carries ([Output](#output)). A plan with no
requirement prints no block.

An unmet row is also one of the plan's problems, `limit_unmet`, which names what the version needs and ends
`Ask support@blobhub.io to set it`, or, past the limit's most permissive value, `<id> cannot be set above <bound>`
(`below` for a minimum), which for `room` goes on `, so only removing what is held makes room`
([When a requirement is not met](https://docs.blobhub.io/blob-types/installer/overview.md#when-a-requirement-is-not-met)). Each problem prints
as `problem: <text>`, wrapped at 110 columns with a two-space indent and never inside a word, and a plan with problems
ends with `refused: N problems; nothing was installed`, with or without `--yes`. The same upgrade, had
`blobhub.compute.workflow.executions_per_session` been lowered to 300 for `acme-corp` since the first install:

```console theme={null}
blobhub installer install acme-corp/field-reports --installer acme-corp/installed-apps --alias reports \
  --version 0.3.0 --input config=@envs/acme.yaml --yes
```

```text theme={null}
Field Reports 0.3.0 from acme-corp/field-reports, as reports in acme-corp/installed-apps (from 0.2.0)
  updates blob reports-flows
  updates blob reports-schedules
  widget report-viewer asks to: read session objects, read threads
  runs reports-migrate in session reports, from 0.2.0 to 0.3.0
limits at acme-corp/reports-flows
  unmet  blobhub.compute.workflow.executions_per_session         at least 400     300 (org)
  ok     blobhub.compute.workflow.definitions_per_revision       at least 2       10 (default)
  ok     blobhub.compute.workflow.playgrounds_per_revision       at least 1       10 (default)
  ok     blobhub.compute.workflow.session_objects_per_session    at least 2       1000 (default)
  ok     blobhub.compute.workflow.widgets_per_revision           at least 1       10 (default)
limits at acme-corp/reports-schedules
  ok     blobhub.compute.scheduler.min_interval_seconds          at most 86400    60 (default)
  ok     blobhub.compute.scheduler.schedules_per_revision        at least 1       10 (default)
problem: limit_unmet: acme-corp/reports-flows needs blobhub.compute.workflow.executions_per_session at least
  400; it would be 300 (org). Ask support@blobhub.io to set it
refused: 1 problem; nothing was installed
```

The sentence is the platform's, word for word
([When a requirement is not met](https://docs.blobhub.io/blob-types/installer/overview.md#when-a-requirement-is-not-met)). `--yes` overrides
nothing: a plan with a problem has no [digest](https://docs.blobhub.io/blob-types/installer/operations/plan.md#digest), so there is nothing to
confirm. Send the problem to [support@blobhub.io](mailto:support@blobhub.io); once the limit is set, the next plan finds the row met. Every problem a
plan can answer, in the order it checks them, is under
[The checks, in order](https://docs.blobhub.io/blob-types/installer/overview.md#the-checks-in-order).

## When the plan changes

A `--yes` run asks for its own plan, prints it and sends its digest, all in the same run. A dry run before it confirms
nothing: with `--version` left out, a version committed since the dry run is the one the `--yes` run prints and
installs, so name `--version` where the version must not move. The digest covers the gap between this run's print and
its call. The platform plans again before it acts, and when that plan's digest differs, because a version was
committed, the draft pushed, an input or a limit's value changed, or another operation ran on the installation, nothing
is installed: the platform answers `plan_changed` with the new plan.
The command prints it under a header naming the version planned now, with its lines, its limits block and any problem,
and ends with `refused: the plan changed while it was confirmed; nothing was installed` and exit `1` (`PLAN_CHANGED`).
Read the new plan, then run the command again.

A problem that is new when the platform plans again, such as a limit lowered below what the version needs, is refused
with its own code instead, such as `LIMIT_UNMET`, after the problem is printed.

## Output

The header, the lines, the limits block and the `refused:` line go to stderr, so `-q` does not quiet them; each
`problem:` line and each log line go to stdout. The log lines are `HH:MM:SS  message`, one per entry, printed as they
are written.

Under `--json` nothing else is printed. The result with `--yes` is one JSON document on stdout: `installer`, `created`
(whether this run created the installer blob), `plan`, `installation` (its final record) and `entries` (the log entries
the operation wrote). A refusal leaves stdout empty and writes one JSON document to stderr, the
[error envelope](https://docs.blobhub.io/cli/configuration.md#output-streams). A refusal of the plan carries `confirm`, one entry with
`installation`, the plan's `lines` and `limits`, and `created`: `APP_NOT_CONFIRMED` adds the plan's `digest` when it
has one, and `INSTALL_HAS_PROBLEMS` carries the problems as `problems`. `PLAN_CHANGED` carries the new plan's
`problems`, and `confirm` with its `installation`, `lines` and `limits`, and its `digest` when it has one: a plan with
problems has none, and a `confirm` entry never carries a null one.

Each row of `limits` is the plan's [row](https://docs.blobhub.io/blob-types/installer/operations/plan.md#limits) as the platform answers it. An
unmet row's `fix` is the value to ask [support@blobhub.io](mailto:support@blobhub.io) to set and where,
`{"target": "org:<org>" | "blob:<org>/<blob>", "value": <JSON>}`, or `null` when no value can meet it: past the
limit's most permissive value, where for `room` only removing what is held helps. A plan whose `fix` has any other
shape is one the CLI cannot read, `API_TRANSIENT_ERROR`; a `PLAN_CHANGED` refusal carrying one prints no limits
block, and its `confirm` has empty `limits` and no `digest`. A script reads each `fix` from the refusal on stderr:

```console theme={null}
blobhub --json installer install acme-corp/field-reports --installer acme-corp/installed-apps --alias reports \
  --version 0.3.0 --input config=@envs/acme.yaml 2>&1 >/dev/null \
  | jq -r '.confirm[].limits[] | select(.met == false and .fix != null) | .fix'
```

For the refused upgrade [above](#limits-and-problems), it prints the `fix` of its one unmet row:

```json theme={null}
{
  "target": "blob:acme-corp/reports-flows",
  "value": 400
}
```

When the installation fails, the error carries `problems`: the log's error entries, or its last five entries when none
is an error; a timeout carries the last five. A refusal at write time, after the plan was confirmed, keeps the
refusal's `problems` in `--json` too. A limit reached since the plan is `LIMIT_EXCEEDED`, whose human output prints
only the message. A blob not ready is `BLOB_NOT_READY`, in the platform's words. An installer blob a delete has
claimed is refused before the install as `blob acme-corp/installed-apps is deleting`; one a delete claims while the
install call runs prints the platform's problem first,
`problem: blob_not_ready: blob installed-apps is being deleted`. No input value is ever printed.

## Errors

| Code | When |
| - | - |
| `APP_NOT_CONFIRMED` | `--yes` was not given. The plan is printed, then `refused: pass --yes to install`, and the exit code is `1`. With `--yes`, a plan with no problems and still no digest ends with `refused: the plan has no digest to confirm; nothing was installed`, and no install is sent: the platform's answer and this CLI disagree, so update blobhub-cli. |
| `INSTALL_HAS_PROBLEMS` | The plan reports problems, with or without `--yes`; each is printed as `problem: <text>`, then `refused: N problems; nothing was installed`. |
| `PLAN_CHANGED` | The plan the platform made when `--yes` sent the install is not the one printed. The new plan is printed, and nothing is installed. |
| `MIGRATION_RUNNING`, `DEVELOPMENT_MISMATCH`, `VERSION_DOWNGRADE`, `UPGRADE_UNSUPPORTED`, `LIMIT_UNMET`, `PERSON_REQUIRED`, `APP_BUSY` | The install call itself was refused with that check: the plan printed had passed it, and the platform's plan made before it acted did not. The problem is printed as `problem: <text>` before the error, and nothing is installed. |
| `APP_VERSION_NOT_FOUND` | The version the plan answered is gone by the time the install is sent. A version the app does not have when it plans, or `draft` for an app in another organization, is a problem of the plan instead. |
| `INPUT_MISSING`, `INPUT_INVALID` | A required input was not given, or a document fails its schema. |
| `ALIAS_IN_USE` | A blob the install would create exists and is not this installation's. |
| `INSTALLATION_BUSY` | An operation on the alias is running. |
| `INSTALLATION_FAILED` | The installation ended `failed`; the reason is in the log. Run the command again. |
| `INSTALLATION_FOLLOW_TIMEOUT` | The installation did not settle in 30 minutes; it carries on, and `log --follow` resumes. |
| `ENV_VAR_NOT_SET`, `INPUT_ARGUMENT_INVALID` | An `--input` form names an unset or empty variable, is malformed, or is a file that does not parse. See [`--input`](https://docs.blobhub.io/cli/installer/overview#--input). |
| `VALUE_NOT_JSON` | An `--input` holds a value JSON cannot carry, refused before any request, the installer blob's creation included. The installation alias and the app, its `org`, `blob` and `version`, are checked the same way, before the installer blob or anything else is created: `installation: <reason>` or `app.<key>: <reason>`. A YAML document that holds itself is refused as it is read: `--input <name>: <file>: <path>: holds itself`. A string or key holding a lone surrogate is refused in the platform's words, `inputs.<name>.<path>: a lone surrogate is not valid UTF-8`, with a YAML `!!omap` or `!!pairs` entry as an array in that path, as JSON sends it. So are NaN or an infinity, a non-string key, a value of no JSON type, such as a YAML `!!set`, and an integer too large to write, each named by its path. See [`--input`](https://docs.blobhub.io/cli/installer/overview#--input). |
| `APP_HAS_PROBLEMS` | The platform refused the app as `invalid_app`: its definition has problems. Any problems the refusal carries print first as `problem: <text>`, wrapped like the plan's, and `--json` lists them in `problems`; the error is the platform's message. |
| `BLOB_NOT_ACCESSIBLE` | The app blob is absent, or either blob is not reachable with this key. A call the platform refuses reads `cannot install <org>/<app> into <org>/<blob>: ` and the platform's own message. |
| `BLOB_NOT_READY` | The installer blob is not `ready`; one being deleted or failed is refused with the platform's `blob <org>/<blob> is <status>`, with no hint. Or the platform refused a call `blob_not_ready`, such as the install when a blob of the installation is still being deleted. A delete that claims the installer blob while the install call runs refuses it with a problem, which is printed first. Nothing is installed. |
| `BLOB_TYPE_MISMATCH` | `--installer` names a blob that is not an installer. |
| `CREDENTIALS_NOT_FOUND`, `PROFILE_NOT_FOUND`, `INSECURE_CREDENTIALS_PERMISSIONS` | No usable credential, a credentials file the CLI refuses to read, or an API URL or key no request can carry ([Error codes](https://docs.blobhub.io/cli/error-codes.md#credentials-and-authentication)). |
| `API_RATE_LIMITED`, `API_TRANSIENT_ERROR`, `API_NETWORK_ERROR` | A call failed after its retries. `API_TRANSIENT_ERROR` is also a plan the CLI cannot read, a field missing or of another shape: `cannot read the platform's answer: ...; nothing was installed`, before any of it prints. |

The platform's own refusals, such as `limit_exceeded`, are listed under
[Refusals](https://docs.blobhub.io/blob-types/installer/overview.md#refusals). Every code above, with its remediation, is in
[Error codes](https://docs.blobhub.io/cli/error-codes.md).

## See also

* [Installer overview](https://docs.blobhub.io/cli/installer/overview.md) — the plan, the refusal, following the log and `--input`.
* [`plan`](https://docs.blobhub.io/blob-types/installer/operations/plan) and [`install`](https://docs.blobhub.io/blob-types/installer/operations/install) — the
  operations behind the command.
* [Requirements](https://docs.blobhub.io/blob-types/installer/overview.md#requirements) — the limits a version needs, and what an unmet one
  says.
* [`app.yaml` inputs](https://docs.blobhub.io/blob-types/app/app-yaml#inputs) — what an input is.
* [`blobhub installer log`](https://docs.blobhub.io/cli/installer/commands/log) — read or follow the log later.
* [`blobhub app push`](https://docs.blobhub.io/cli/app/commands/push) — installs the draft over a development installation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.