Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: UnknownError: Command failed with ENOENT #222

Open
ltfschoen opened this issue Apr 18, 2024 · 3 comments
Open

[BUG]: UnknownError: Command failed with ENOENT #222

ltfschoen opened this issue Apr 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ltfschoen
Copy link

ltfschoen commented Apr 18, 2024

What happened?

When create a new flipper template using https://github.com/ltfschoen/XCMTemplate by following these steps in the README after following the steps to run it in Docker https://github.com/ltfschoen/XCMTemplate?tab=readme-ov-file#build--upload-ink-rust-flipper-smart-contract-to-local-testnet-using-swanky-cli-, when I run yarn && yarn run run-node or swanky node start it outputs

error:   UnknownError: Command failed with ENOENT: --finalize-delay-sec 0 --rpc-cors http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org,https://contracts-ui.substrate.io/
spawn --finalize-delay-sec ENOENT

Or if i run swanky node start --tmp --verbose it outputs

error:   UnknownError: Command failed with ENOENT: --finalize-delay-sec 0 --dev
spawn --finalize-delay-sec ENOENT

Steps to reproduce

  1. create a new flipper template using https://github.com/ltfschoen/XCMTemplate by following these steps in the README after following the steps to run it in Docker https://github.com/ltfschoen/XCMTemplate?tab=readme-ov-file#build--upload-ink-rust-flipper-smart-contract-to-local-testnet-using-swanky-cli-
  2. run yarn && yarn run run-node or swanky node start
  3. view error
error:   UnknownError: Command failed with ENOENT: --finalize-delay-sec 0 --rpc-cors http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org,https://contracts-ui.substrate.io/
spawn --finalize-delay-sec ENOENT

Expected behavior

it should start the swanky node instead of generating that error

Actual behavior

it generates error:

error:   UnknownError: Command failed with ENOENT: --finalize-delay-sec 0 --rpc-cors http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org,https://contracts-ui.substrate.io/
spawn --finalize-delay-sec ENOENT

Environment

  • Operating System macOS 14.1.1
  • Project version/tag: (run 'swanky version') 3.1
  • Rust version (run rustup show)
active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.77.2 (25ef9e3d8 2024-04-09)
  • Node version (run node --version)
v20.12.2

Note: I get the same error even if i switch to Node.js v18.20.2

Logs, Errors, Screenshots

Screenshot 2024-04-18 at 11 39 48 am

Additional information

No response

@ltfschoen ltfschoen added the bug Something isn't working label Apr 18, 2024
@ltfschoen
Copy link
Author

ltfschoen commented Apr 18, 2024

upon initial inspection of the https://docs.astar.network/docs/build/wasm/swanky-suite/cli/, it says that "swanky-cli, as well as environment in the swanky-base image, and supported tools target ink! v4, and use cargo contract v2".

it also says here https://docs.astar.network/docs/build/wasm/swanky-suite/node#compatible-ink-version that only ink! 4.0.0 is supported.

it also says here https://docs.astar.network/docs/build/environment/ink_environment/#rust-and-cargo that due to a bug in cargo-contract, building contracts with rust nightly 1.70.0 or higher will fail. It is advised to use rustc v1.69.0 or older until the issue is resolved from cargo-contract side

currently i'm running

  • ink v4.2.1 (even though they're up to ink v5)
  • cargo-contract v4.1.0
  • rustc 1.77.2 (25ef9e3d8 2024-04-09) nightly-2023-03-21

so to be able to use swanky-cli (instead of cargo contracts node and the latest versions shown above), it's necessary to downgrade to:

@ltfschoen
Copy link
Author

ltfschoen commented Apr 18, 2024

so i reverted to the older versions by running the following

# 1.69.0 is nightly-2023-02-09
export RUST_NIGHTLY=2023-02-09
export CARGO_CONTRACT_VERSION=2.1.0

rustup toolchain install nightly-${RUST_NIGHTLY} --target wasm32-unknown-unknown --profile minimal --component rustfmt clippy rust-src
ln -s "/usr/local/rustup/toolchains/nightly-${RUST_NIGHTLY}-x86_64-unknown-linux-gnu" \
                /usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu
rustup default nightly-${RUST_NIGHTLY}-x86_64-unknown-linux-gnu
cargo install cargo-dylint dylint-link
cargo install cargo-contract --version ${CARGO_CONTRACT_VERSION} --locked

note: it was necessary to use --locked otherwise it gave errors

i then modified the wasm-flipper Cargo.toml file to use ink! 4.0.0 as shown below

[dependencies]

ink = { version = "4.0.0", default-features = false }
...

[dev-dependencies]
ink_e2e = "4.0.0"

then ran

cd dapps/ink-rust
nvm install
nvm use
yarn global add @astar-network/[email protected]

cd ./wasm-flipper/contract/flipper
swanky node start

but i still got the error

error:   UnknownError: Command failed with ENOENT: --finalize-delay-sec 0 --rpc-cors http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org,https://contracts-ui.substrate.io/
spawn --finalize-delay-sec ENOENT

@ltfschoen
Copy link
Author

if i run

swanky node install
swanky node start

it shows better errors including:

bin/swanky-node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by bin/swanky-node)
bin/swanky-node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by bin/swanky-node)
bin/swanky-node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by bin/swanky-node)
bin/swanky-node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/swanky-node)
bin/swanky-node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by bin/swanky-node)
error:   UnknownError: Command failed with exit code 1: bin/swanky-node --finalize-delay-sec 0 --rpc-cors http://localhost:*,http://127.0.0.1:*,https://localhost:*,https://127.0.0.1:*,https://polkadot.js.org,https://contracts-ui.substrate.io/
Please report this bug at: https://github.com/swankyhub/swanky-cli/issues
    at makeError (file:///usr/local/share/.config/yarn/global/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///usr/local/share/.config/yarn/global/node_modules/execa/index.js:124:26)
    at async StartNode.run (file:///usr/local/share/.config/yarn/global/node_modules/@astar-network/swanky-cli/dist/commands/node/start.js:9:9)
    at async StartNode._run (/usr/local/share/.config/yarn/global/node_modules/@astar-network/swanky-cli/node_modules/@oclif/core/lib/command.js:117:22)
    at async Config.runCommand (/usr/local/share/.config/yarn/global/node_modules/@astar-network/swanky-cli/node_modules/@oclif/core/lib/config/config.js:329:25)
    at async run (/usr/local/share/.config/yarn/global/node_modules/@astar-network/swanky-cli/node_modules/@oclif/core/lib/main.js:89:16)
    at async Module.execute (/usr/local/share/.config/yarn/global/node_modules/@astar-network/swanky-cli/node_modules/@oclif/core/lib/main.js:154:5)
    at async file:///usr/local/share/.config/yarn/global/node_modules/@astar-network/swanky-cli/bin/run.js:4:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant