Quickstart guide leads to system-independent error message (DEPRECATED)

Hi guys, trying to set up our indexer but unfortunately, I cannot run the quickstart because of an error that I get regardless of whether I’m trying on an M1 or Intel Macbook.

I would follow the quickstart steps until forc index deploy and get the following output:

▸▹▹▹▹ ⏰ Building...                                                                               Compiling secp256k1-sys v0.8.1
   Compiling tracing-core v0.1.31
   Compiling num-integer v0.1.45
▹▹▹▹▸ ⏰ Building...                                                                            The following warnings were emitted during compilation:

warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: 1 error generated.
warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: 1 error generated.

error: failed to run custom build command for `secp256k1-sys v0.8.1`

Caused by:
  process didn't exit successfully: `/Users/Mau/Code/hello-indexer/target/release/build/secp256k1-sys-b8fbeb017cf898d2/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("wasm32-unknown-unknown")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-apple-darwin")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/Mau/Code/hello-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-42a240e0af90dcc4/out/wasm/wasm.o" "-c" "wasm/wasm.c"
  cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  cargo:warning=1 error generated.
  exit status: 1
  running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/Mau/Code/hello-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-42a240e0af90dcc4/out/wasm/wasm.o" "-c" "wasm/wasm.c"
  cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  cargo:warning=1 error generated.
  exit status: 1

  --- stderr


  error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm/wasm-sysroot" "-I" "wasm/wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_API=" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DENABLE_MODULE_RECOVERY=1" "-o" "/Users/Mau/Code/hello-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-42a240e0af90dcc4/out/wasm/wasm.o" "-c" "wasm/wasm.c" with args "clang" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
▹▹▹▹▹ ⏰ Building...                                                                            ▹▹▹▹▸ ⏰ Building...                                                                            ▪▪▪▪▪ ❌ Build failed.                                                                          Error: ❌ Failed to build index.

It seems to be related to clang execution, so could this be a problem for Apple devices in general? I tried following the brew install llvm guideline but that didn’t change the error ouput.

Any help would be much appreciated @kern @rashad :slight_smile:

2 Likes

Hey @maurice did you export all 5 environment variables as well after installing llvm? For example.

$ export AR=/opt/homebrew/opt/llvm/bin/llvm-ar

Thanks for reporting this by the way I was able to replicate the issue above from the quickstart but fixed mine by doing this. Note that I am also on an apple silicon macbook pro running forc-index v0.17.3

https://fuellabs.github.io/fuel-indexer/master/getting-started/dependencies.html#wasm32-target

2 Likes

I tried that but will retry!! If you have the same setup, it’s gotta work :slight_smile: Thank you for the reply!

I now tried following the README.md from here but I receive the following by just executing the docker compose up --build.

#0 943.7 error[E0433]: failed to resolve: could not find `accounts` in `fuels`
#0 943.7  --> packages/fuel-indexer-tests/components/fuel-node/src/main.rs:6:1
#0 943.7   |
#0 943.7 6 | / abigen!(Contract(
#0 943.7 7 | |     name = "FuelIndexerTest",
#0 943.7 8 | |     abi = "packages/fuel-indexer-tests/contracts/fuel-indexer-test/out/debug/fuel-indexer-test-abi.json"
#0 943.7 9 | | ));
#0 943.7   | |__^ could not find `accounts` in `fuels`
#0 943.7   |
#0 943.7   = note: this error originates in the macro `abigen` (in Nightly builds, run with -Z macro-backtrace for more info)
#0 943.7
#0 943.7 error[E0433]: failed to resolve: could not find `programs` in `fuels`
#0 943.7  --> packages/fuel-indexer-tests/components/fuel-node/src/main.rs:6:1
#0 943.7   |
#0 943.7 6 | / abigen!(Contract(
#0 943.7 7 | |     name = "FuelIndexerTest",
#0 943.7 8 | |     abi = "packages/fuel-indexer-tests/contracts/fuel-indexer-test/out/debug/fuel-indexer-test-abi.json"
#0 943.7 9 | | ));
#0 943.7   | |__^ could not find `programs` in `fuels`
#0 943.7   |
#0 943.7   = note: this error originates in the macro `abigen` (in Nightly builds, run with -Z macro-backtrace for more info)
#0 943.7
#0 943.8 For more information about this error, try `rustc --explain E0433`.
#0 943.8 error: could not compile `fuel-node` due to 2 previous errors
#0 943.9 warning: build failed, waiting for other jobs to finish...
------
failed to solve: executor failed running [/bin/sh -c cargo build --release -p fuel-node --all-targets]: exit code: 101

@calldelegation Which versions are you running on? Could you fuelup show for me? I’m running into another new error that might be version related. Thanks!! :slight_smile:

Got it running now with a docker file that makes use of the fuel-indexer script suggestion (here). What got it to deploy eventually was running the docker container and then exporting all flags, so you were right!

When running the docker compose up, I constantly get the following:

scripts-fuel-indexer-1  | 2023-07-05T13:30:50.416714Z ERROR fuel_indexer::ffi: 108: Bincode serde error Custom("premature end of input")

Do you get the same by any chance?

When running trying to query data, I now get:

curl -X POST http://localhost:29987/api/graph/my_project/hello_indexer \
   -H 'Content-Type: application/graphql' \
   -d '{"query": "query { transaction { id, hash, block } }" }' \
| json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    66  100    11  100    55    427   2135 --:--:-- --:--:-- --:--:--  3000
{
   "data" : []
}

I don’t think it’s completely right yet but happy that it deployed at least.

1 Like

Here is my fuelup show I’m asking the internal team about your query issue! I will update you soon.

Default host: aarch64-apple-darwin
fuelup home: /Users/calldelegation/.fuelup

installed toolchains
--------------------
beta-3-aarch64-apple-darwin (default)
latest-aarch64-apple-darwin
latest-2023-02-18-aarch64-apple-darwin
latest-2023-04-12-aarch64-apple-darwin

active toolchain
-----------------
beta-3-aarch64-apple-darwin (default)
  forc : 0.37.3
    - forc-client
      - forc-deploy : 0.37.3
      - forc-run : 0.37.3
    - forc-doc : 0.37.3
    - forc-explore : 0.28.1
    - forc-fmt : 0.37.3
    - forc-index : 0.15.0
    - forc-lsp : 0.37.3
    - forc-tx : 0.37.3
    - forc-wallet : 0.2.2
  fuel-core : 0.17.11
  fuel-indexer : 0.15.0

fuels versions
---------------
forc : 0.39```
2 Likes

Hey @maurice apologies for the delays but the indexer team would love for you to create an issue on their github so that they can properly address and track your problems above. I appreciate your patience as the indexer team consists of just two people at the moment. I have also opened up a PR to fix the quickstart issues you have been experiencing!

1 Like