# Troubleshoot Azion CLI

This page lists the symptoms you can meet with the [Azion CLI](/en/documentation/devtools/cli/), each with its cause and its fix. Questions, configuration paths, and login come first. Local development, builds, and deploys follow, then the resource commands.

---

## A command stops with EOF or Failed to parse your response

In a script or a CI job, a command stops at a question and fails with a line such as one of these:

```text
? Enter the base URL to warm cache (e.g., https://example.com): Error: EOF
```

```text
? Enter the ID of the Application the Cache Setting is linked to: Error: Failed to parse your response. Check your response and try again. If the error persists, contact Azion support
```

The command asks for a value you did not pass, and the question needs a terminal. With standard input closed, nothing answers it.

- **Pass the value with its flag**: the question names the value. Pass it with the flag of the command, such as `--url` on `azion warmup` or `--application-id` on `azion list cache-setting`.
- **Add `-y` for yes/no questions**: `-y` answers yes to every question that ends in `(Y/n)` or `(y/N)`. Without a terminal, a `(Y/n)` question takes yes even without `-y`. For the effect on profiles, refer to [Questions and confirmations](/en/documentation/devtools/cli/globals/#questions-and-confirmations).
- **Run pickers in a terminal**: `azion init` always asks for the preset and the template in pickers, and no flag sets them. For every question it asks, refer to [Azion CLI init](/en/documentation/devtools/cli/init/#prompts).
- **Save a token instead of logging in**: without a terminal, `azion login` fails with `Error: Failed to get profile name`. In automation, pass a personal token with the global option `--token`.

With every value passed as a flag, the command runs to its result without a question.

---

## A command refuses the configuration path

A command with `-c` or `--config` fails before it runs:

```text
Error: Provide the correct path of the configuration file. Make sure the file is in .toml format, access the document for more information https://www.azion.com/en/documentation/devtools/cli/globals/#config
```

`--config` takes a path that ends in `.toml`, not a folder. The CLI uses the folder that holds that path as the configuration folder.

- **Point at a .toml path at the top of the folder**: pass `<config-folder>/settings.toml`. The file does not need to exist.
- **Leave the profile folders out of the path**: with `<config-folder>/default/settings.toml`, the CLI takes `default` as the configuration folder. It creates an empty profile there and reports that you are not logged in.

This command reads the account from another configuration folder:

```bash
azion whoami -c <config-folder>/settings.toml
```

The command prints the account of the active profile in that folder:

```text
 Client ID: 1234u
 Email: you@example.com
 Active Profile: default
```

For more information, refer to [Config](/en/documentation/devtools/cli/globals/#config).

---

## A command fails with You must be logged in

A command fails and asks you to log in:

```text
🤔 To better understand user needs and enhance our application, we gather anonymous data. Do you agree to participate? (Y/n) Error: You must be logged in to use the 'whoami' command
```

The configuration the command reads holds no account. `azion reset` clears the token, the client ID, and the email. A `--config` path that ends in the `settings.toml` of a profile also creates an empty profile. On a cleared configuration, the anonymous-data question comes before the error.

- **Log in**: run `azion login` and choose a login method. For the methods, refer to [Azion CLI login](/en/documentation/devtools/cli/login/).
- **Save a personal token**: pass `--token` with any command. The CLI saves the token in the `settings.toml` of the profile, and every later command uses it. For an example, refer to [Azion CLI global options](/en/documentation/devtools/cli/globals/#examples).
- **Check the configuration path**: point `--config` at the top of the configuration folder, as [A command refuses the configuration path](#a-command-refuses-the-configuration-path) explains.

`azion whoami` then prints the client ID, the email, and the active profile of your account.

---

## azion link fails with Invalid build preset name

`azion link --preset static` writes the project files, then fails with `Error: exit status 1`. With `--debug`, the output names the cause:

```text
Build process failed: Error: Invalid build preset name: 'static'
```

`static` is not a preset name. The preset for a site of plain HTML files is `html`.

- **Remove what the failed command wrote**: it leaves the `azion`, `.edge`, and `.github` folders and a `.gitignore` file in the project folder. Delete them before you link again.
- **Use the html preset**: the `html` preset serves the files in the `www` folder of the project. Files at the root of the project are not uploaded, so move them into `www`.
- **Check the preset names**: `azion list presets` prints the presets that `azion link` and `azion build` take. For the list, refer to [Azion CLI presets](/en/documentation/devtools/cli/resources/presets/).

This command links the current folder as an HTML site, without the questions:

```bash
azion link --name my-site --preset html --auto
```

The command configures the project and reminds you to build it:

```text
Project successfully configured
Sucessfully written to your .gitignore file
Successfully created GitHub Actions workflow file at .github/workflows/azion-deploy.yml
…
Please, remember to run azion build --preset [preset-name], in order to generate the necessary configuration files
```

The project is linked with the `html` preset, and `azion build` and `azion deploy` read it.

---

## azion dev fails because port 3333 is in use

`azion dev` fails with `Port 3333 is in use`, after an earlier `azion dev` on the same machine was stopped.

`azion dev` runs the development server in a child process, `node .../azbundler dev`. Stopping only the `azion` process leaves that child listening on port 3333.

- **Stop the whole process group**: stop the earlier `azion dev` together with its child process. Stopping the process group frees the port.
- **Serve on another port**: `azion dev --port 4444` serves the project on port 4444. For the output, refer to [Serve a static site on another port](/en/documentation/devtools/cli/dev-command/#serve-a-static-site-on-another-port).

The new server prints `Function running on port 0.0.0.0:3333, url: http://localhost:3333`, with the port you passed in place of `3333`.

---

## azion build asks you to install dependencies using pnpm

`azion build` on a framework project fails at its first step:

```text
[Azion] [Build] › ✖  error     Please install dependencies using pnpm
```

The project dependencies are not installed. This happens when `azion init` stops before its dependency question, as with a template that first asks for a credential of another service. For example, the *Cosmic - Agency Website* template of the *Next* preset asks for a Cosmic bucket slug.

- **Pick a boilerplate template**: in the template picker of `azion init`, select a boilerplate, such as *Next JS Static Boilerplate (14.1.4)*. With `-y`, `azion init` installs its dependencies.
- **Install the dependencies yourself**: install the project dependencies with pnpm, as the message asks, then run `azion build` again.

The build ends with `Your Application was built successfully`.

---

## A framework build stops at its own question

A command of a framework project waits at a question from the framework tools, or fails without a terminal:

```text
[Azion] [Build] › ✖  error     Command 'npm exec opennextjs-azion build -- ' failed with code 13
```

Some framework tools ask their own questions during the build or the dependency install. Without a terminal, nothing answers them, and `-y` does not answer the Nuxt question.

- **Answer the open-next.config.ts question in a terminal**: with the *OpenNextJS* preset, `azion build` asks `Missing required open-next.config.ts file, do you want to create one? (Y/n)`. Run the build in a terminal and answer yes. The build creates the file and completes.
- **Answer the Nuxt telemetry question in a terminal**: with the *Nuxt* preset, the dependency install of `azion init` asks `Are you interested in participating?` about Nuxt usage data. Run `azion init` in a terminal and answer it.

The command continues past the question, and the build ends with `Your Application was built successfully`.

---

## The deployed URL answers There's nothing here yet

After `azion deploy`, the domain the command prints answers `404` with a page titled `There's nothing here yet`.

The deploy has not reached every location yet. The first deploy can take several minutes to answer from every location; later deploys take about two minutes.

- **Wait and retry**: request the domain again after a few minutes, before you diagnose the deploy. One location can answer `200` while another still answers `404`.
- **Follow the deploy in Azion Console**: a remote deploy prints a line that starts with `Please visit https://console.azion.com/create/deploy/`. When the browser does not open, open that link to follow the deploy.

The domain answers `200` with your content. For the deploy output, refer to [Azion CLI deploy](/en/documentation/devtools/cli/deploy/).

---

## A delete removes more than the application

`azion delete application` prints `Cascade deleting resources` and deletes other resources of the project with the application.

Any `--cascade` flag turns the cascade on, `--cascade=false` included. The cascade deletes the resources that `azion/azion.json` of the current directory lists.

In a project folder, this command deletes the workload, the application, and the function that `azion/azion.json` lists:

```bash
azion delete application --cascade
```

The command names each resource it deletes:

```text
Cascade deleting resources
Deleting workload with ID 1234567903
Deleting application with ID 1234567893
Deleting function with ID 12360
Remote resources deleted successfully
```

Outside a project folder, the same line is followed by `Error: Failed to open the azion.json file`, and the command keeps the application.

> **Caution**
>
> Resource deletes ask no question, with or without `-y`. Check the current directory before you pass `--cascade`.

To delete only the application, run `azion delete application --application-id <application-id>` with no `--cascade` flag. For the flags, refer to [Azion CLI application](/en/documentation/devtools/cli/resources/application/#delete).

The command prints `Application <application-id> was successfully deleted`, and the connector and the bucket of the project stay.

---

## An update reports success and the value does not change

`azion update dns-zone --active false` prints `DNS zone <zone-id> was updated`, but the zone stays active.

`--active` on `dns-zone` and `--enabled` on `dnssec` are booleans: `--help` prints them without a type. A boolean takes its value after an equals sign. With a space, the command leaves the value unchanged.

To turn off the DNS zone, write the value after an equals sign:

```bash
azion update dns-zone --zone-id <zone-id> --active=false
```

```text
DNS zone <zone-id> was updated
```

`azion describe dns-zone --zone-id <zone-id> --format json` then reports `"active": false`. For more information, refer to [Boolean flags](/en/documentation/devtools/cli/globals/#boolean-flags).

---

## A help example fails with unknown flag

An example copied from `--help` fails before it runs:

```text
Error: unknown flag: --in
```

The example uses a flag that the command does not accept. `--help` lists the flags of the command under `LOCAL OPTIONS`.

- **Use the flags of the command table**: each resource page lists the flags of every command. For the pages, refer to [Resource commands](/en/documentation/devtools/cli/resources/).
- **Update from a JSON file with --file**: pass the file with `--file` and the ID with its flag. Some updates do not read the ID from the file. For the file shape, refer to [Azion CLI function](/en/documentation/devtools/cli/resources/function/#use-a-json-file).

This command updates the function with ID `12370` from a JSON file:

```bash
azion update function --function-id 12370 --file fn-update.json
```

The command prints `Updated function with ID 12370`, and the function keeps the fields the file leaves out.

---

## Related resources

- [Global options](/en/documentation/devtools/cli/globals.md): The configuration folder, the token, the boolean flags, and the yes/no answers that several fixes rely on.
- [Azion CLI quickstart](/en/documentation/devtools/cli/quickstart.md): Every prompt of a first project, from login to a deployed function.
- [Azion CLI deploy](/en/documentation/devtools/cli/deploy.md): What a remote and a local deploy print, and how long a deploy takes to answer.
- [Resource commands](/en/documentation/devtools/cli/resources.md): The flags of every create, list, describe, update, and delete command.
