Troubleshoot Azion CLI
Fix Azion CLI commands that stop at a question, refuse a path or a flag, fail to build, or deploy a URL that does not answer yet.
This page lists the symptoms you can meet with the Azion 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:
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
--urlonazion warmupor--application-idonazion list cache-setting. - Add
-yfor yes/no questions:-yanswers 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. - Run pickers in a terminal:
azion initalways asks for the preset and the template in pickers, and no flag sets them. For every question it asks, refer to Azion CLI init. - Save a token instead of logging in: without a terminal,
azion loginfails withError: 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:
--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 takesdefaultas 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:
The command prints the account of the active profile in that folder:
For more information, refer to Config.
A command fails with You must be logged in
A command fails and asks you to log in:
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 loginand choose a login method. For the methods, refer to Azion CLI login. - Save a personal token: pass
--tokenwith any command. The CLI saves the token in thesettings.tomlof the profile, and every later command uses it. For an example, refer to Azion CLI global options. - Check the configuration path: point
--configat the top of the configuration folder, as 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:
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.githubfolders and a.gitignorefile in the project folder. Delete them before you link again. - Use the html preset: the
htmlpreset serves the files in thewwwfolder of the project. Files at the root of the project are not uploaded, so move them intowww. - Check the preset names:
azion list presetsprints the presets thatazion linkandazion buildtake. For the list, refer to Azion CLI presets.
This command links the current folder as an HTML site, without the questions:
The command configures the project and reminds you to build it:
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 devtogether with its child process. Stopping the process group frees the port. - Serve on another port:
azion dev --port 4444serves the project on port 4444. For the output, refer to 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:
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 initinstalls its dependencies. - Install the dependencies yourself: install the project dependencies with pnpm, as the message asks, then run
azion buildagain.
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:
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 buildasksMissing 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 initasksAre you interested in participating?about Nuxt usage data. Runazion initin 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
200while another still answers404. - 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.
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:
The command names each resource it deletes:
Outside a project folder, the same line is followed by Error: Failed to open the azion.json file, and the command keeps the application.
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.
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:
azion describe dns-zone --zone-id <zone-id> --format json then reports "active": false. For more information, refer to Boolean flags.
A help example fails with unknown flag
An example copied from --help fails before it runs:
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.
- Update from a JSON file with --file: pass the file with
--fileand the ID with its flag. Some updates do not read the ID from the file. For the file shape, refer to Azion CLI function.
This command updates the function with ID 12370 from a JSON file:
The command prints Updated function with ID 12370, and the function keeps the fields the file leaves out.