FuelLabs / fuels-rs

Fuel Network Rust SDK
https://fuellabs.github.io/fuels-rs
Apache License 2.0
44.17k stars 1.34k forks source link

Cannot connect to fuel core server #1449

Closed PopcornPaws closed 3 months ago

PopcornPaws commented 3 months ago

Description

After updating fuelup and rustup to the latest version, I get this error when calling launch_custom_provider_and_get_wallets(config, None, None).await.unwrap():

---- claim::claim_successful stdout ----
found more than one `fuel-core` binary in PATH, using `/home/.../.fuelup/bin/fuel-core`
the exit status from the fuel binary was: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "Error: an error occurred while loading the chain state file: Some(\"/tmp/.tmp4LhMf1/chain_config.json\")\n\nCaused by:\n    unknown variant `V2`, expected `V1` at line 43 column 12\n" }, stdout: , stderr: Error: an error occurred while loading the chain state file: Some("/tmp/.tmp4LhMf1/chain_config.json")

Caused by:
    unknown variant `V2`, expected `V1` at line 43 column 12

thread 'claim::claim_successful' panicked at /.../lib/parameters.rs:115:14:
called `Result::unwrap()` on an `Err` value: Other("could not connect to fuel core server")

and all my tests that need a connection to the test node fail due to this error.

fuelup show output:

Default host: x86_64-unknown-linux-gnu
fuelup home: /home/.../.fuelup

installed toolchains
--------------------
latest-x86_64-unknown-linux-gnu (default)

active toolchain
----------------
latest-x86_64-unknown-linux-gnu (default)
  forc : 0.60.0
    - forc-client
      - forc-deploy : 0.60.0
      - forc-run : 0.60.0
    - forc-crypto : 0.60.0
    - forc-debug : 0.60.0
    - forc-doc : 0.60.0
    - forc-explore : 0.28.1
    - forc-fmt : 0.60.0
    - forc-lsp : 0.60.0
    - forc-tx : 0.60.0
    - forc-wallet : 0.7.1
  fuel-core : 0.26.0
  fuel-core-keygen : 0.26.0

fuels versions
--------------
forc : 0.62.0
forc-wallet : 0.62.0

rustup show output:

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/.../.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.79.0 (129f3b996 2024-06-10)

and I am using fuels v0.64.0 in my Cargo.toml.

Not sure if this belongs here because the error seems to originate from the fuels-core binary, but since the issue occurs while using the SDK, I thought I'll open it here.

MujkicA commented 3 months ago

Your toolchain is using fuel-core 0.26.0 while fuels 0.64.0 is targeting fuel-core 0.28.0. You can install the new fuel-core version manually with: fuelup component add fuel-core@0.28.0

PopcornPaws commented 3 months ago

Thanks it worked, but I had to add a custom toolchain due to this message:

Installing specific components is reserved for custom toolchains.
You are currently using 'latest-x86_64-unknown-linux-gnu'.

You may create a custom toolchain using 'fuelup toolchain new <toolchain>'.

So I ran

fuelup toolchain new custom-toolchain
fuelup component add fuel-core@0.28.0
fuelup component add forc@0.60.0

and my tests ran successfully.