Error deploying Azle

am using windows os and all installation and dependencies have been followed correctly
dfx 0.15.1 or dfx 0.15.2 nethier do work.

anytime i run “dfx deploy” i get the errors below;

mijma@DESKTOP-NS66FFM:~/azle_hello_world$ dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters…
Executing ‘npx azle azle_hello_world’

Building canister azle_hello_world

Initial build takes a few minutes. Don’t panic. Subsequent builds will be faster.

[1/4] :microscope: Performing initial research…
[2/4] :hammer_and_wrench: Commencing development…
[3/4] :desktop_computer: Deploying…
[4/4] :rocket: Launching…
Error: Command failed: cd .azle/azle_hello_world && /home/mijma/.config/azle/rust/1.73.0/bin/cargo build --target wasm32-wasi --manifest-path canister/Cargo.toml --release
error: rustup could not choose a version of cargo to run, because one wasn’t specified explicitly, and no default is configured.
help: run ‘rustup default stable’ to download the latest stable release of Rust and set it as your default toolchain.

at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at compileRustCode (/home/mijma/azle_hello_world/node_modules/azle/src/compiler/compile_rust_code.ts:14:13)
at /home/mijma/azle_hello_world/node_modules/azle/src/compiler/index.ts:135:28
at time (/home/mijma/azle_hello_world/node_modules/azle/src/compiler/utils/time.ts:10:26)
at azle (/home/mijma/azle_hello_world/node_modules/azle/src/compiler/index.ts:55:15)
at Object.<anonymous> (/home/mijma/azle_hello_world/node_modules/azle/src/compiler/index.ts:35:1)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module.m._compile (/home/mijma/azle_hello_world/node_modules/ts-node/src/index.ts:1365:23) {

status: 1,
signal: null,
output: [
null,
Buffer(0) [Uint8Array] ,
Buffer(247) [Uint8Array] [
101, 114, 114, 111, 114, 58, 32, 114, 117, 115, 116, 117,
112, 32, 99, 111, 117, 108, 100, 32, 110, 111, 116, 32,
99, 104, 111, 111, 115, 101, 32, 97, 32, 118, 101, 114,
115, 105, 111, 110, 32, 111, 102, 32, 99, 97, 114, 103,
111, 32, 116, 111, 32, 114, 117, 110, 44, 32, 98, 101,
99, 97, 117, 115, 101, 32, 111, 110, 101, 32, 119, 97,
115, 110, 39, 116, 32, 115, 112, 101, 99, 105, 102, 105,
101, 100, 32, 101, 120, 112, 108, 105, 99, 105, 116, 108,
121, 44, 32, 97,
… 147 more items
]
],
pid: 17947,
stdout: Buffer(0) [Uint8Array] ,
stderr: Buffer(247) [Uint8Array] [
101, 114, 114, 111, 114, 58, 32, 114, 117, 115, 116, 117,
112, 32, 99, 111, 117, 108, 100, 32, 110, 111, 116, 32,
99, 104, 111, 111, 115, 101, 32, 97, 32, 118, 101, 114,
115, 105, 111, 110, 32, 111, 102, 32, 99, 97, 114, 103,
111, 32, 116, 111, 32, 114, 117, 110, 44, 32, 98, 101,
99, 97, 117, 115, 101, 32, 111, 110, 101, 32, 119, 97,
115, 110, 39, 116, 32, 115, 112, 101, 99, 105, 102, 105,
101, 100, 32, 101, 120, 112, 108, 105, 99, 105, 116, 108,
121, 44, 32, 97,
… 147 more items
]
}
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed to build all canisters.
Failed while trying to build all canisters.
The build step failed for canister ‘by6od-j4aaa-aaaaa-qaadq-cai’ (azle_hello_world) with an embedded error: Failed to build custom canister azle_hello_world.: Failed to run npx azle azle_hello_world.: The custom tool failed.
mijma@DESKTOP-NS66FFM:~/azle_hello_world$

There’s a help message in your logs:

error: rustup could not choose a version of cargo to run, because one wasn’t specified explicitly, and no default is configured.
help: run ‘rustup default stable’ to download the latest stable release of Rust and set it as your default toolchain.

Did you try running rustup default stable?

During the installation process, there was no rust setup procedure shown. so i do not know hoe to set it. can you help me with the process or the syntax to use in the terminal?

cd .azle/azle_hello_world && /home/mijma/.config/azle/rust/1.73.0/bin/cargo build --target wasm32-wasi --manifest-path canister/Cargo.toml --release

I see that Azle is trying to use a bundled version of Rust, so maybe you’re not meant to have it installed.

Sorry, I don’t have much experience with Azle so I’m not 100% sure what is the right way to do this, but if you install Rust according to the official instructions then it should work. At least it does for me.

@lastmjs is this error expected without having Rust installed on the host OS?

2 Likes

@morotijani Azle is designed to abstract all of the Rust stuff away, so trying to manually install it is most likely not going to work unless you’re aware of the internal details.

Something probably just happened during your installation. Please follow these instructions and can back here if you need more help: Deployment - The Azle Book

2 Likes

What could be the cause of this error?

It’s running for the first time on this computer, All the tools have been installed according to the installation guide. The dependancies installed as well. But there is this weird typescript error on all the functions, it’s saying “Expected 0 args, got 3” on all the functions. What is missing?

Hi, I have been getting this error when setting up my azle projects using dfx new projectName for weeks now. When i try to deploy even without making a change in the codebase i run into this error:

dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters…
Executing ‘npx azle app_backend’

Building canister app_backend
Error: Command failed: cd .azle/app_backend && /Users/sylusabel/.config/azle/rust/1.73.0/bin/cargo build --target wasm32-wasi --manifest-path canister/Cargo.toml --release
Updating crates.io index
Updating git repository https://github.com/demergent-labs/ic-wasi-polyfill
Updating git repository https://github.com/ulan/javy.git
Updating git repository https://github.com/wasm-forge/stable-fs
error: failed to select a version for the requirement futures-util = "=0.3.27"
candidate versions found which didn’t match: 0.3.31, 0.2.1, 0.2.0
location searched: crates.io index
required by package quickjs-wasm-sys v1.0.0 (https://github.com/ulan/javy.git?rev=fdf12ce4fd5636417cd63e1f6296aa79196434a7#fdf12ce4)
… which satisfies git dependency quickjs-wasm-sys of package quickjs-wasm-rs v1.0.0 (https://github.com/ulan/javy.git?rev=fdf12ce4fd5636417cd63e1f6296aa79196434a7#fdf12ce4)
… which satisfies git dependency quickjs-wasm-rs of package canister v0.0.0 (/Users/sylusabel/Desktop/development/web3/app/.azle/app_backend/canister)
perhaps a crate was updated and forgotten to be re-vendored?

at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at checkExecSyncError (node:child_process:891:11)
at execSync (node:child_process:963:15)
at compileRustCode (/Users/sylusabel/Desktop/development/web3/app/node_modules/azle/src/compiler/compile_rust_code.ts:14:13)
at /Users/sylusabel/Desktop/development/web3/app/node_modules/azle/src/compiler/index.ts:135:28
at time (/Users/sylusabel/Desktop/development/web3/app/node_modules/azle/src/compiler/utils/time.ts:10:26)
at azle (/Users/sylusabel/Desktop/development/web3/app/node_modules/azle/src/compiler/index.ts:55:15)
at Object.<anonymous> (/Users/sylusabel/Desktop/development/web3/app/node_modules/azle/src/compiler/index.ts:35:1)
at Module._compile (node:internal/modules/cjs/loader:1469:14) {

status: 101,
signal: null,
output: [
null,
Buffer(0) [Uint8Array] ,
Buffer(965) [Uint8Array] [
32, 32, 32, 32, 85, 112, 100, 97, 116, 105, 110, 103,
32, 99, 114, 97, 116, 101, 115, 46, 105, 111, 32, 105,
110, 100, 101, 120, 10, 32, 32, 32, 32, 85, 112, 100,
97, 116, 105, 110, 103, 32, 103, 105, 116, 32, 114, 101,
112, 111, 115, 105, 116, 111, 114, 121, 32, 96, 104, 116,
116, 112, 115, 58, 47, 47, 103, 105, 116, 104, 117, 98,
46, 99, 111, 109, 47, 100, 101, 109, 101, 114, 103, 101,
110, 116, 45, 108, 97, 98, 115, 47, 105, 99, 45, 119,
97, 115, 105, 45,
… 865 more items
]
],
pid: 66115,
stdout: Buffer(0) [Uint8Array] ,
stderr: Buffer(965) [Uint8Array] [
32, 32, 32, 32, 85, 112, 100, 97, 116, 105, 110, 103,
32, 99, 114, 97, 116, 101, 115, 46, 105, 111, 32, 105,
110, 100, 101, 120, 10, 32, 32, 32, 32, 85, 112, 100,
97, 116, 105, 110, 103, 32, 103, 105, 116, 32, 114, 101,
112, 111, 115, 105, 116, 111, 114, 121, 32, 96, 104, 116,
116, 112, 115, 58, 47, 47, 103, 105, 116, 104, 117, 98,
46, 99, 111, 109, 47, 100, 101, 109, 101, 114, 103, 101,
110, 116, 45, 108, 97, 98, 115, 47, 105, 99, 45, 119,
97, 115, 105, 45,
… 865 more items
]
}
Building frontend…
Error: Failed while trying to deploy canisters.
Caused by: Failed to build all canisters.
Caused by: Failed while trying to build all canisters.
Caused by: The build step failed for canister ‘be2us-64aaa-aaaaa-qaabq-cai’ (app_backend)
Caused by: Failed to build custom canister app_backend.
Caused by: Failed to run npx azle app_backend.
Caused by: The custom tool failed.

I would recommend you not use dfx new when creating an Azle project, it’s currently out of date. Just use The Azle Book documentation: The Azle Book (Beta) - The Azle Book

1 Like

Hi thanks for this, But i was already running a project using azle for backend and react as my frontend do I have to redo? Or is there an alternative. Thanks once again.

idk but is running dfx azle project_name still supported? cause i keep getting this error: ❯ dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters…
Executing ‘npx azle app_backend’
/Users/sylusabel/Desktop/development/web3/app/node_modules/azle/src/build/index.ts:77
throw new Error(
^

Error: Azle: Invalid command found when running azle. Running azle app_backend is not valid

In the latest version that is not supported. Please see The Azle Book and the examples in the repo:

https://demergent-labs.github.io/azle/

There are many many examples and a good amount of documentation, please make sure your project looks like those examples with that documentation.

I suggest making your project using npx azle new [project name].

1 Like