Error fetching an array in a Azle canister

I am creating a project following this azle example. I was having an error in my project when calling a query call to return an array so I decided to run the example itself and I’m getting this same error when I call the readUsers function:

Call failed:
Canister: bkyz2-fmaaa-aaaaa-qaaaq-cai
Method: readUsers (query)
"Status": "rejected"
"Code": "CanisterError"
"Message": "IC0503: Canister bkyz2-fmaaa-aaaaa-qaaaq-cai trapped explicitly: Panicked at 'called `Result::unwrap()` on an `Err` value: Uncaught Error: type mismatch: type on the wire text, expect type principal\n at checkType (main.js:96798)\n at decodeValue (main.js:97671)\n at decodeValue (main.js:97408)\n at <anonymous> (main.js:98112)\n at map (native)\n at decode2 (main.js:98113)\n at decodeSingle (main.js:98621)\n at decode3 (main.js:98611)\n at <anonymous> (main.js:99571)\n at map (native)\n at values (main.js:99572)\n at <anonymous> (main.js:99611)\n at executeMethod (main.js:99382)\n at <anonymous> (main.js:99412)\n', canister/src/lib.rs:98:14"

@lastmjs

Can you paste the actual code you are running and the actual dfx command you ran? This seems suspicious

1 Like

I think it’s a problem with dfx. For some reason it’s working now. The same code that gave me the error I sent above I run it again now and the error is gone.

1 Like

Hi @lastmjs I hope you are well.

A friend of mine is also learning azle and encountering the error below, they have installed all the tools here: Installation - The Azle Book

What could be the problem? He is using ubuntu. Thank you.

megamind@Megamind:~/Desktop/internet_computer/message_board$ dfx start --background
Error: dfx is already running.
megamind@Megamind:~/Desktop/internet_computer/message_board$ dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters...
Executing 'npx azle message_board'

Building canister message_board
Error: Command failed: cd .azle/message_board && /home/megamind/.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`
   Compiling ic-cdk-macros v0.6.10
   Compiling quickjs-wasm-sys v1.0.0 (https://github.com/ulan/javy.git?branch=ulan/local-changes#5377d60e)
   Compiling ic-cdk-macros v0.7.1
   Compiling canister_methods v0.0.0 (/home/megamind/Desktop/internet_computer/message_board/.azle/message_board/canister_methods)
error: failed to run custom build command for `quickjs-wasm-sys v1.0.0 (https://github.com/ulan/javy.git?branch=ulan/local-changes#5377d60e)`

Caused by:
  process didn't exit successfully: `/home/megamind/.config/azle/rust/target/release/build/quickjs-wasm-sys-b8f2673773f468f2/build-script-build` (exit status: 1)
  --- stdout
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  cargo:rerun-if-env-changed=CC_wasm32-wasi
  CC_wasm32-wasi = None
  cargo:rerun-if-env-changed=CC_wasm32_wasi
  CC_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi
  CFLAGS_wasm32-wasi = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi
  CFLAGS_wasm32_wasi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some("--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot")
  running: "/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-wasi" "--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot" "-D_GNU_SOURCE" "-DCONFIG_VERSION=\"2021-03-27\"" "-DCONFIG_BIGNUM" "-o" "/home/megamind/.config/azle/rust/target/wasm32-wasi/release/build/quickjs-wasm-sys-7ff62d41b7fcedb2/out/quickjs/cutils.o" "-c" "quickjs/cutils.c"
  signal: 11 (SIGSEGV)

  --- stderr


  error occurred: Command "/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/bin/clang" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-wasi" "--sysroot=/home/megamind/.config/azle/rust/1.73.0/git/checkouts/javy-9eee5663e993cb2d/5377d60/crates/quickjs-wasm-sys/wasi-sdk/share/wasi-sysroot" "-D_GNU_SOURCE" "-DCONFIG_VERSION=\"2021-03-27\"" "-DCONFIG_BIGNUM" "-o" "/home/megamind/.config/azle/rust/target/wasm32-wasi/release/build/quickjs-wasm-sys-7ff62d41b7fcedb2/out/quickjs/cutils.o" "-c" "quickjs/cutils.c" with args "clang" did not execute successfully (status code signal: 11 (SIGSEGV)).


warning: build failed, waiting for other jobs to finish...

    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at compileRustCode (/home/megamind/Desktop/internet_computer/message_board/node_modules/azle/src/compiler/compile_rust_code.ts:14:13)
    at /home/megamind/Desktop/internet_computer/message_board/node_modules/azle/src/compiler/index.ts:135:28
    at time (/home/megamind/Desktop/internet_computer/message_board/node_modules/azle/src/compiler/utils/time.ts:10:26)
    at azle (/home/megamind/Desktop/internet_computer/message_board/node_modules/azle/src/compiler/index.ts:55:15)
    at Object.<anonymous> (/home/megamind/Desktop/internet_computer/message_board/node_modules/azle/src/compiler/index.ts:35:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module.m._compile (/home/megamind/Desktop/internet_computer/message_board/node_modules/ts-node/src/index.ts:1365:23) {
  status: 101,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(17052) [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,
      ... 16952 more items
    ]
  ],
  pid: 24885,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(17052) [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,
    ... 16952 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 'bkyz2-fmaaa-aaaaa-qaaaq-cai' (message_board) with an embedded error: Failed to build custom canister message_board.: Failed to run npx azle message_board.: The custom tool failed.
megamind@Megamind:~/Desktop/internet_computer/message_board$

Hello @lastmjs , I’m trying to help someone deploy an azle project for the first time, but after installing everything following the installation guide on Azle book, were are getting this error:

All the dependencies and tools installed but it’s giving this error saying “Expected 0 arguments, but got 3” . What is still missing and causing this error?

Thanks

Can you share all of the code?

Okay, here:

Still getting the same error even after creating a new hello world azle project

What version of Azle? And does the canister work when deployed despite the errors?

It’s not deploying with these errors, version is 0.18.6

What errors does it throw when it deploys?

I will send you tomorrow, it’s not my pc, but the actual error as I remember doesn’t have a lot of information, it’s just like one line error, and then the rest is just failed to deploy canister etc. Will send in the next 9 hours or so.

It seems like something is off with the version or installation, ensure that that package.json says azle 0.18.6, that in the node_modules directory the azle version is 0.18.6, and that when you hover over the import path ‘azle’ it leads to the node_modules directory with 0.18.6

1 Like

Okay thank you, will check that

I am also getting the same problem here, has your friend gotten a solution to it?, if he/she has then i will be glad if he/she shares it.

1 Like

No we couldn’t figure out what the problems was, there was many other problems as well, some related to network, with poor network connections canister weren’t deploying as well. I had to advice my friend to just go with Motoko it was an easy setup and deploy.

But if you have somewhat strong internet connection, I think if you use github codespaces locally in your vscode you will be good, codespaces have been working well for the azle canisters, you just need relatively good internet.

1 Like