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?