demergent-labs / azle

A WebAssembly runtime for TypeScript and JavaScript on ICP
MIT License
204 stars 37 forks source link

Please help: `dfx deploy` failed with errors #1809

Closed johnnynanjiang closed 2 months ago

johnnynanjiang commented 4 months ago
Last login: Thu Jun  6 19:45:24 on ttys001

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
...:azle_hell_world ???$ pwd
../azle_hell_world
...:azle_hell_world ???$ 
...:azle_hell_world ???$ 
...:azle_hell_world ???$ rm -rf node_modules
npm install
npx azle clean
AZLE_VERBOSE=true dfx deploy
...:azle_hell_world ???$ npm install
npx azle clean
AZLE_VERBOSE=true dfx deploy
npm WARN deprecated text-encoding@0.7.0: no longer maintained

added 239 packages, and audited 240 packages in 19s

28 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
...:azle_hell_world ???$ npx azle clean
AZLE_VERBOSE=true dfx deploy
~/.config/azle directory deleted
.azle directory deleted
azle containers stopped
azle containers removed
azle images removed
...:azle_hell_world ???$ AZLE_VERBOSE=true dfx deploy
Deploying all canisters.
Creating canisters...
Creating canister backend...
Creating a wallet canister on the local network.
The wallet canister on the "local" network for user "default" is "bnz7o-iuaaa-aaaaa-qaaaa-cai"
backend canister created with canister id: bkyz2-fmaaa-aaaaa-qaaaq-cai
Building canisters...
Executing 'npx azle backend'

Building canister backend
Looking up Podman Machine image at quay.io/podman/machine-os:5.1 to create VM
Getting image source signatures
Copying blob 2c2a685e4baa done   | 
Copying config 44136fa355 done   | 
Writing manifest to image destination
2c2a685e4baa3c60d2a6a6f7008f327cda3032bd63f2c7a1c170d409ea821f2e
Extracting compressed file: podman-machine-default-arm64.raw: done  
Machine init complete
To start your machine run:

  podman machine start

Starting machine "podman-machine-default"

This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:

  podman machine set --rootful

API forwarding listening on: /var/folders/b2/5qd9q0xs4ld5dvtrqw8rhtyc0000gn/T/podman/podman-machine-default-api.sock

The system helper service is not installed; the default Docker API socket
address can't be used by podman. If you would like to install it, run the following commands:

        sudo /opt/homebrew/Cellar/podman/5.1.1/bin/podman-mac-helper install
        podman machine stop; podman machine start

You can still connect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:

        export DOCKER_HOST='unix:///var/folders/b2/5qd9q0xs4ld5dvtrqw8rhtyc0000gn/T/podman/podman-machine-default-api.sock'

Machine "podman-machine-default" started successfully
[]
Error: unable to inspect "azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3": failed to find image azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3: azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3: image not known

Downloading image...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 40 1077M   40  437M    0     0   892k      0  0:20:35  0:08:21  0:12:14  399k
curl: (18) HTTP/2 stream 1 was reset
Error: Command failed: curl -L -f https://github.com/demergent-labs/azle/releases/download/0.21.1/azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3.tar.gz -o /Users/???/.config/azle/azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3.tar.gz
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at downloadAndLoadRemoteImage (../azle_hell_world/node_modules/azle/src/compiler/prepare_docker_image.ts:167:13)
    at loadImage (../azle_hell_world/node_modules/azle/src/compiler/prepare_docker_image.ts:84:9)
    at prepareDockerImage (../azle_hell_world/node_modules/azle/src/compiler/prepare_docker_image.ts:17:5)
    at ../azle_hell_world/node_modules/azle/src/compiler/index.ts:73:35
    at time (../azle_hell_world/node_modules/azle/src/compiler/utils/time.ts:10:26)
    at azle (../azle_hell_world/node_modules/azle/src/compiler/index.ts:66:15) {
  status: 18,
  signal: null,
  output: [ null, null, null ],
  pid: 2834,
  stdout: null,
  stderr: null
}
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' (backend) with an embedded error: Failed to build custom canister backend.: Failed to run npx azle backend.: The custom tool failed.
...:azle_hell_world ???$ AZLE_VERBOSE=true dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters...
Executing 'npx azle backend'

Building canister backend
Error: podman-machine-default: VM already exists
Starting machine "podman-machine-default"
Error: unable to start "podman-machine-default": machine podman-machine-default: VM already running or starting
[]
Error: unable to inspect "azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3": failed to find image azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3: azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3: image not known

Loading image...

gzip: /Users/???/.config/azle/azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3.tar.gz: unexpected end of file
gzip: /Users/???/.config/azle/azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3.tar.gz: uncompress failed
Error: Command failed: gzip -d /Users/???/.config/azle/azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3.tar.gz
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at loadExistingLocalImage (../azle_hell_world/node_modules/azle/src/compiler/prepare_docker_image.ts:124:17)
    at loadImage (../azle_hell_world/node_modules/azle/src/compiler/prepare_docker_image.ts:72:38)
    at prepareDockerImage (../azle_hell_world/node_modules/azle/src/compiler/prepare_docker_image.ts:17:5)
    at ../azle_hell_world/node_modules/azle/src/compiler/index.ts:73:35
    at time (../azle_hell_world/node_modules/azle/src/compiler/utils/time.ts:10:26)
    at azle (../azle_hell_world/node_modules/azle/src/compiler/index.ts:66:15) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 3200,
  stdout: null,
  stderr: null
}
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' (backend) with an embedded error: Failed to build custom canister backend.: Failed to run npx azle backend.: The custom tool failed.
...:azle_hell_world ???$ 
...:azle_hell_world ???$ 
...:azle_hell_world ???$ 
...:azle_hell_world ???$ rm -rf node_modules
npm install
npx azle clean
AZLE_VERBOSE=true dfx deploy
...:azle_hell_world ???$ npm install
npx azle clean
AZLE_VERBOSE=true dfx deploy
npm WARN deprecated text-encoding@0.7.0: no longer maintained

added 239 packages, and audited 240 packages in 7s

28 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
...:azle_hell_world ???$ npx azle clean
AZLE_VERBOSE=true dfx deploy
~/.config/azle directory deleted
.azle directory deleted
azle containers stopped
azle containers removed
azle images removed
...:azle_hell_world ???$ AZLE_VERBOSE=true dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters...
Executing 'npx azle backend'

Building canister backend
Error: podman-machine-default: VM already exists
Starting machine "podman-machine-default"
Error: unable to start "podman-machine-default": machine podman-machine-default: VM already running or starting
[]
Error: unable to inspect "azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3": failed to find image azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3: azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3: image not known

Downloading image...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1077M  100 1077M    0     0  2684k      0  0:06:50  0:06:50 --:--:-- 2717k

Loading image...

Loaded image: localhost/azle__image__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3:latest

Compiling...
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
113a280c1f9aca85a33e4c9368238a9b483714b8e7e524c0c55141bf2c68d36e
azle__container__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3
Error: can only create exec sessions on running containers: container state improper
Error: Command failed: podman exec azle__container__5fd100a48e4fdf8a61db8e78ab48f8c270807d89dd337b81fba5315ea333baf3 rm -rf /.azle/backend
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at compileRustCodeWithPodman (../azle_hell_world/node_modules/azle/src/compiler/compile_rust_code.ts:21:13)
    at compileRustCode (../azle_hell_world/node_modules/azle/src/compiler/compile_rust_code.ts:12:9)
    at compileRustCodeWithCandidAndCompilerInfo (../azle_hell_world/node_modules/azle/src/compiler/compile_rust_code_with_candid_and_compiler_info.ts:23:20)
    at ../azle_hell_world/node_modules/azle/src/compiler/index.ts:117:53
    at time (../azle_hell_world/node_modules/azle/src/compiler/utils/time.ts:10:26)
    at azle (../azle_hell_world/node_modules/azle/src/compiler/index.ts:66:15) {
  status: 125,
  signal: null,
  output: [ null, null, null ],
  pid: 4343,
  stdout: null,
  stderr: null
}
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' (backend) with an embedded error: Failed to build custom canister backend.: Failed to run npx azle backend.: The custom tool failed.
...:azle_hell_world ???$ 
lastmjs commented 2 months ago

I apologize for the slow response, I did not see this issue. The dependency on Podman has been removed. Please try again with Azle 0.23.0