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

Subgraph initialisation failed due to: git commit -m "Initialize subgraph" #1565

Open
shantanu-bico opened this issue Jan 17, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@shantanu-bico
Copy link

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

Upon initialising a subgraph (hosted-service), the initialisation broke with the following trace:
✖ Failed to fetch Start Block: Failed to fetch contract creation transaction hash
✔ Do you want to retry? (Y/n) · true
✔ Fetching Start Block
✔ Start Block · 17025946
✔ Contract Name · Contract
✔ Index contract events as entities (Y/n) · true
Generate subgraph
Write subgraph to directory
✔ Create subgraph scaffold
✔ Initialize networks config
✖ Failed to initialize subgraph repository: Command failed: git commit -m "Initialize subgraph"

Error: Command failed: git commit -m "Initialize subgraph"

Code: 1

For context, I have git initialised in my cli and setup appropriately, my git cli version is "git version 2.39.3 (Apple Git-145)"

For further context, here is the version of graph and node cli that I am using:
graph --version
@graphprotocol/graph-cli/0.66.0 darwin-arm64 node-v21.2.0

Reproduction

There is no repo yet, I am stuck at the first step of initilisation

Steps to Reproduce the Bug or Issue

Upon following the default steps at Initialising a hosted service subgraph, the first step to graph init is causing this issue for me.
It isn't my first subgraph but this error started occuring randomly.

The command I ran: graph init --product hosted-service shantanu-bico/sa-v1-factory-ethereum
The output trace recieved:
✔ Ethereum network · mainnet
✔ Contract address · 0x000000f9ee1842bb72f6bbdd75e6d3d4e3e9594c
✔ Fetching ABI from Etherscan
✖ Failed to fetch Start Block: Failed to fetch contract creation transaction hash
✔ Do you want to retry? (Y/n) · true
✖ Failed to fetch Start Block: Failed to fetch contract creation transaction hash
✔ Do you want to retry? (Y/n) · true
✔ Fetching Start Block
✔ Start Block · 17025946
✔ Contract Name · Contract
✔ Index contract events as entities (Y/n) · true
Generate subgraph
Write subgraph to directory
✔ Create subgraph scaffold
✔ Initialize networks config
✖ Failed to initialize subgraph repository: Command failed: git commit -m "Initialize subgraph"

Error: Command failed: git commit -m "Initialize subgraph"

Code: 1

Expected behavior

I expect the graph to be initialised

Screenshots or Videos

No response

Platform

  • MacOS
    @graphprotocol/graph-cli/0.66.0 darwin-arm64 node-v21.2.0

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

@shantanu-bico shantanu-bico added the bug Something isn't working label Jan 17, 2024
@saihaj
Copy link
Member

saihaj commented Jan 17, 2024

do you have git installed?

@shantanu-bico
Copy link
Author

Yes @saihaj , I do, as I mentioned the git cli version is "git version 2.39.3 (Apple Git-145)"
And also, this issue is new, I have developed and deployed multiple subgraphs before.

@saihaj
Copy link
Member

saihaj commented Jan 17, 2024

hmm so to unblock you try graph init --skip-git. That should let you init a subgraph.

I am curious why git commit is failing there isn't any detailed error. Can you try running DEBUG=graph-cli:* graph init and then we can see if there are more useful logs

@shantanu-bico
Copy link
Author

Yes, adding --skip-git worked.
Here are the logs you requested:
graph-cli:protocol Available networks {"arweave":["arweave-mainnet"],"ethereum":["mainnet","rinkeby","goerli","poa-core","poa-sokol","gnosis","matic","mumbai","fantom","fantom-testnet","bsc","chapel","clover","avalanche","fuji","celo","celo-alfajores","fuse","moonbeam","moonriver","mbase","arbitrum-one","arbitrum-goerli","arbitrum-sepolia","optimism","optimism-goerli","aurora","aurora-testnet","base-testnet","base","zksync-era","zksync-era-testnet","sepolia","polygon-zkevm-testnet","polygon-zkevm","scroll-sepolia","scroll"],"near":["near-mainnet","near-testnet"],"cosmos":["cosmoshub-4","theta-testnet-001","osmosis-1","osmo-test-4","juno-1","uni-3"],"substreams":["mainnet"]} +0ms
› Warning: In next major version, this flag will be removed. By default we will deploy to the Graph Studio. Learn more about Sunrise of
› Decentralized Data https://thegraph.com/blog/unveiling-updated-sunrise-decentralized-data/
› Warning: In next major version, this flag will be removed. By default we will stop initializing a Git repository.
graph-cli:commands:init Flags: {
graph-cli:commands:init 'allow-simple-name': false,
graph-cli:commands:init 'skip-install': false,
graph-cli:commands:init 'skip-git': false
graph-cli:commands:init } +0ms

@saihaj
Copy link
Member

saihaj commented Jan 24, 2024

@shantanu-bico I added some more debug logs around the git init flow. Can you try running this version 0.67.3-alpha-20240124142956-af00244 with the debug flag?

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

2 participants