FuelLabs/fuel-indexer

Fail indexer deploy | thread 'main' panicked at plugins/forc-index/src/utils.rs:104:1

PaulZhemanov opened this issue · 8 comments

hello guys, im trying deploy indexer from project https://github.com/compolabs/spark-perps inside /spark-perps/indexer/account-balance-indexer using command forc index deploy --url http://13.37.143.43 and i got misstake like this
Screenshot 2023-12-12 at 17 18 20
My current toolchain:
Default host: aarch64-apple-darwin
fuelup home: /Users/master/.fuelup

installed toolchains
beta-3-aarch64-apple-darwin
latest-aarch64-apple-darwin
beta-4-aarch64-apple-darwin (default)
latest-2023-01-18-aarch64-apple-darwin
new-creation

active toolchain
beta-4-aarch64-apple-darwin (default)
forc : 0.46.1

  • forc-client
  • forc-deploy : 0.46.1
  • forc-run : 0.46.1
  • forc-doc : 0.46.1
  • forc-explore : 0.28.1
  • forc-fmt : 0.46.1
  • forc-index : 0.24.3
  • forc-lsp : 0.46.1
  • forc-tx : 0.46.1
  • forc-wallet : 0.3.0
    fuel-core : 0.20.5
    fuel-core-keygen : Error getting version string
    fuel-indexer : 0.24.3

fuels versions
forc : 0.45
forc-wallet : 0.45.

Mistake the same on latest toolchain. Can you help me?

ra0x3 commented

@PaulZhemanov

  • Can you paste the output of tree . -I target when running this command at the root of your indexer project?
  • Looks like some file is out of place but I agree the error isn't helpful
ra0x3 commented

@PaulZhemanov

  • If you could also paste the contents of your indexer manifest file that would also be helpful

├── Cargo.lock
├── Cargo.toml
├── abi
│   ├── account_balance_abi
│   │   ├── Forc.lock
│   │   ├── Forc.toml
│   │   └── src
│   │   ├── data_structures.sw
│   │   ├── errors.sw
│   │   └── interface.sw
│   ├── clearing_house_abi
│   │   ├── Forc.lock
│   │   ├── Forc.toml
│   │   └── src
│   │   ├── data_structures.sw
│   │   ├── errors.sw
│   │   └── interface.sw
│   ├── insurance_fund_abi
│   │   ├── Forc.toml
│   │   └── src
│   │   ├── errors.sw
│   │   └── interface.sw
│   ├── perp_market_abi
│   │   ├── Forc.lock
│   │   ├── Forc.toml
│   │   └── src
│   │   ├── data_structures.sw
│   │   ├── errors.sw
│   │   └── interface.sw
│   ├── proxy_abi
│   │   ├── Forc.lock
│   │   ├── Forc.toml
│   │   └── src
│   │   ├── data_structures.sw
│   │   ├── errors.sw
│   │   └── interface.sw
│   └── vault_abi
│   ├── Forc.toml
│   └── src
│   ├── errors.sw
│   └── interface.sw
├── account-balance
│   ├── AccountBalanceSpark.sol
│   ├── AccountBalanceSparkCamel.sol
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── out
│   │   └── debug
│   │   ├── account-balance-abi.json
│   │   ├── account-balance-storage_slots.json
│   │   └── account-balance.bin
│   └── src
│   ├── events.sw
│   └── main.sw
├── clearing-house
│   ├── ClearingHouseSparkCamel.sol
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── out
│   │   └── debug
│   │   ├── clearing-house-abi.json
│   │   ├── clearing-house-storage_slots.json
│   │   └── clearing-house.bin
│   └── src
│   ├── events.sw
│   └── main.sw
├── indexer
│   ├── account-balance-indexer
│   │   ├── Cargo.lock
│   │   ├── Cargo.toml
│   │   ├── account-balance-abi.json
│   │   ├── account_balance_indexer.manifest.yaml
│   │   ├── schema
│   │   │   └── account_balance_indexer.schema.graphql
│   │   └── src
│   │   └── lib.rs
│   ├── clearing-house-indexer
│   │   ├── Cargo.lock
│   │   ├── Cargo.toml
│   │   ├── clearing-house-abi.json
│   │   ├── clearing_house_indexer.manifest.yaml
│   │   ├── schema
│   │   │   └── clearing_house_indexer.schema.graphql
│   │   └── src
│   │   └── lib.rs
│   ├── docker-compose.yaml
│   └── perp-market-indexer
│   ├── Cargo.lock
│   ├── Cargo.toml
│   ├── perp-market-abi.json
│   ├── perp_market_indexer.manifest.yaml
│   ├── schema
│   │   └── perp_market_indexer.schema.graphql
│   └── src
│   └── lib.rs
├── insurance-fund
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── insuranceFundSparkCamel.sol
│   ├── out
│   │   └── debug
│   │   ├── insurance-fund-abi.json
│   │   ├── insurance-fund-storage_slots.json
│   │   └── insurance-fund.bin
│   └── src
│   └── main.sw
├── libs
│   └── i64
│   ├── Forc.lock
│   ├── Forc.toml
│   └── src
│   └── main.sw
├── perp-market
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── orderBookSpark.sol
│   ├── out
│   │   └── debug
│   │   ├── perp-market-abi.json
│   │   ├── perp-market-storage_slots.json
│   │   └── perp-market.bin
│   └── src
│   ├── events.sw
│   ├── main.sw
│   └── utils.sw
├── proxy
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── out
│   │   └── debug
│   │   ├── proxy-abi.json
│   │   ├── proxy-storage_slots.json
│   │   └── proxy.bin
│   └── src
│   └── main.sw
├── scrips
│   └── get_account_state
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── out
│   │   └── debug
│   │   ├── get_account_state-abi.json
│   │   ├── get_account_state-bin-hash
│   │   └── get_account_state.bin
│   └── src
│   └── main.sw
├── spot-market
│   ├── Cargo.lock
│   ├── Cargo.toml
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── src
│   │   ├── events.sw
│   │   ├── main.sw
│   │   ├── structs.sw
│   │   └── utils.sw
│   └── tests
│   ├── artefacts
│   │   ├── token
│   │   │   ├── FRC20-abi.json
│   │   │   └── FRC20.bin
│   │   └── tokens.json
│   ├── harness.rs
│   └── testnet_tests
│   ├── cancel_order_test.rs
│   ├── create_order_test.rs
│   ├── deploy.rs
│   ├── match_orders_test.rs
│   └── mod.rs
├── tests
│   ├── artefacts
│   │   └── pyth
│   │   ├── pyth-contract-abi.json
│   │   ├── pyth-contract-storage_slots.json
│   │   └── pyth-contract.bin
│   ├── harness.rs
│   ├── local_tests
│   │   ├── get_free_collateral.rs
│   │   ├── liquidate_test.rs
│   │   ├── main_test.rs
│   │   ├── match_orders_test.rs
│   │   ├── mod.rs
│   │   └── spark_sdk_test.rs
│   ├── testnet_actions
│   │   ├── deploy_pyth.rs
│   │   ├── deploy_spark.rs
│   │   ├── deploy_tokens.rs
│   │   ├── get_free_collateral.rs
│   │   ├── match_orders.rs
│   │   ├── mod.rs
│   │   └── withdraw_collateral.rs
│   └── utils
│   ├── contracts_utils
│   │   ├── account_balance_utils.rs
│   │   ├── clearing_house_utils.rs
│   │   ├── insurance_fund_utils.rs
│   │   ├── mod.rs
│   │   ├── perp_market_utils.rs
│   │   ├── proxy_utils.rs
│   │   ├── pyth_utils.rs
│   │   ├── spark_utils.rs
│   │   ├── token_utils.rs
│   │   └── vault_utils.rs
│   └── mod.rs
├── token
│   ├── Forc.lock
│   ├── Forc.toml
│   ├── out
│   │   └── debug
│   │   ├── token-abi.json
│   │   ├── token-storage_slots.json
│   │   └── token.bin
│   └── src
│   └── main.sw
├── tokens.json
├── ts-tests
│   ├── contracts
│   │   ├── AccountBalanceAbi.d.ts
│   │   ├── ClearingHouseAbi.d.ts
│   │   ├── InsuranceFundAbi.d.ts
│   │   ├── OracleAbi.d.ts
│   │   ├── PerpMarketAbi.d.ts
│   │   ├── ProxyAbi.d.ts
│   │   ├── PythContractAbi.d.ts
│   │   ├── ReferalContractAbi.d.ts
│   │   ├── ReferalContractAbi.hex.ts
│   │   ├── SpotMarketAbi.d.ts
│   │   ├── TokenAbi.d.ts
│   │   ├── TokenFactoryAbi.d.ts
│   │   ├── VaultAbi.d.ts
│   │   ├── common.d.ts
│   │   ├── factories
│   │   │   ├── AccountBalanceAbi__factory.ts
│   │   │   ├── ClearingHouseAbi__factory.ts
│   │   │   ├── InsuranceFundAbi__factory.ts
│   │   │   ├── OracleAbi__factory.ts
│   │   │   ├── PerpMarketAbi__factory.ts
│   │   │   ├── ProxyAbi__factory.ts
│   │   │   ├── PythContractAbi__factory.ts
│   │   │   ├── ReferalContractAbi__factory.ts
│   │   │   ├── SpotMarketAbi__factory.ts
│   │   │   ├── TokenAbi__factory.ts
│   │   │   ├── TokenFactoryAbi__factory.ts
│   │   │   └── VaultAbi__factory.ts
│   │   └── index.ts
│   ├── jest.config.js
│   ├── services
│   │   └── account.ts
│   ├── test-cases
│   │   └── deposit.test.ts
│   └── utils
│   ├── BN.ts
│   └── tokens.json
└── vault
├── Forc.lock
├── Forc.toml
├── out
│   └── debug
│   ├── vault-abi.json
│   ├── vault-storage_slots.json
│   └── vault.bin
├── src
│   └── main.sw
└── vaultSparkCamel.sol

namespace: composabilitylabs
identifier: account_balance_indexer
abi: "./account-balance-abi.json"
fuel_client: ~
graphql_schema: schema/account_balance_indexer.schema.graphql
module:
wasm: target/wasm32-unknown-unknown/release/account_balance_indexer.wasm
metrics: ~
contract_id: fuel1pkd2xgt4hrt507llyd9m93xk6mam6pcqzh4g534lq3k9mw2mjjnswsl2r3
start_block: 10004910
end_block: ~
resumable: true

ra0x3 commented

Thanks @PaulZhemanov

  • After looking over your project structure I see it's a bit off from what we recommend
  • You can see the ideal/target project structure here
  • You've included a lot of stuff in your indexer project (e.g., your abi folder) - I recommend you place that outside of your indexer project
  • Could you update your project structure to what's recommended and try again ? ☝🏼
  • Your manifest file looks correct ✅

can problem be in using shell? i try using zsh:
telegram-cloud-photo-size-2-5460848482626689011-y

ra0x3 commented

@PaulZhemanov

  • I'd still recommend the project that structure from the docs ☝🏼
  • Do you have the wasm32 target installed via cargo ? rustup target list | grep wasm32
  • If so, this looks similar to #1465
  • We're actually working on a fix for this in #1499
  • Unfortunately we don't have a solution that works for everyone on all platforms at this time

@ra0x3 on my friends pc its ok with this structure.... mistake looks like cargo.toml is not correct
image

now i got this mistake
``
^^/s/i/account-balance-indexer >>> forc index deploy --url http://35.180.121.148
▹▸▹▹▹ ⏰ Building indexer... Compiling secp256k1-sys v0.8.1
Compiling hashbrown v0.13.2
Compiling fixed-hash v0.8.0
Compiling fuel-types v0.35.4
Compiling strum v0.24.1
Compiling num-integer v0.1.45
Compiling proc-macro-error-attr v1.0.4
Compiling tracing-core v0.1.32
Compiling fuel-storage v0.35.4
Compiling borrown v0.1.0
Compiling fuel-asm v0.35.4
Compiling primitive-types v0.12.2
▹▹▸▹▹ ⏰ Building indexer... 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/master/spark-perps/indexer/account-balance-indexer/target/release/build/secp256k1-sys-1c606a0362dad490/build-script-build (exit status: 1)
--- stdout
TARGET = Some("wasm32-unknown-unknown")
OPT_LEVEL = Some("3")
HOST = Some("aarch64-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=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
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=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=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = 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
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/master/spark-perps/indexer/account-balance-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-78712cb5b85a20d2/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/master/spark-perps/indexer/account-balance-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-78712cb5b85a20d2/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/master/spark-perps/indexer/account-balance-indexer/target/wasm32-unknown-unknown/release/build/secp256k1-sys-78712cb5b85a20d2/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 indexer... ▹▹▹▹▸ ⏰ Building indexer... ▹▹▹▹▹ ⏰ Building indexer... ▹▸▹▹▹ ⏰ Building indexer... ▹▹▸▹▹ ⏰ Building indexer... ▪▪▪▪▪ ❌ Build failed. Error: ❌ Failed to build index.
``