graph-node: Subgraph built on Mac M1 chip fails: 'registering new sigaltstack failed'
Do you want to request a feature or report a bug? Bug
*What is the current behavior? Indexing a subgraph built on a Mac M1 Chip fails after deployment with the following error:
graph-node_1 | Mar 30 17:44:30.544 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 2, current_block_head: 1, provider: localhost-rpc-0, component: BlockIngestor
graph-node_1 | Mar 30 17:44:40.634 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 3, current_block_head: 2, provider: localhost-rpc-0, component: BlockIngestor
graph-node_1 | Mar 30 17:44:41.150 INFO 1 trigger found in this block for this subgraph, block_hash: 0x591ae02eb53ff160e33abe0cc1fcbf0813c380e897523f3ab1aed294cff56159, block_number: 3, subgraph_id: QmRvEgBm8fknmKVcBC9SJECFg1hJZFSsE5SzJ3VSuji8hQ, component: SubgraphInstanceManager
graph-node_1 | thread 'mapping-QmRvEgBm8fknmKVcBC9SJECFg1hJZFSsE5SzJ3VSuji8hQ-635e0c5d-65f3-4468-abf8-5bcfdfff157d' panicked at 'assertion failed: `(left == right)`
graph-node_1 | left: `-1`,
graph-node_1 | right: `0`: registering new sigaltstack failed', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/wasmtime-runtime-0.21.0/src/traphandlers.rs:774:9
graph-node_1 | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
graph-node_1 | Mar 30 17:44:41.312 ERRO Subgraph instance failed to run: Failed to process trigger in block #3 (591ae02eb53ff160e33abe0cc1fcbf0813c380e897523f3ab1aed294cff56159), transaction 89db588442c8299ef04d471ce3dfd0ef21d58e3e63bfefc7b7eda120f962fc81: Mapping terminated before handling trigger: oneshot canceled, code: SubgraphSyncingFailure, id: QmRvEgBm8fknmKVcBC9SJECFg1hJZFSsE5SzJ3VSuji8hQ, subgraph_id: QmRvEgBm8fknmKVcBC9SJECFg1hJZFSsE5SzJ3VSuji8hQ, component: SubgraphInstanceManager
This was also reported in Discord: Reports error Mentions M1 On both local node and hosted service
The same subgraph built and deployed on an Intel chip Mac works.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Build and deploy a subgraph from a Mac with a new M1 chip.
git clone https://github.com/austintgriffith/scaffold-eth.git m1-bug-demo
cd m1-bug-demo
// install submodules
yarn install
// run a local hardhat chain
yarn chain
In a second tab run a local graph node
yarn graph-run-node
Deploy a simple local contract to the chain and to the subgraph
// deploy contracts
yarn deploy
// register the subgraph
yarn graph-create-local
yarn graph-ship-local
Error visible in the graph node logs
Versions:
"@graphprotocol/graph-cli": "0.18.0",
"@graphprotocol/graph-ts": "0.18.0"
What is the expected behavior? Subgraph starts indexing as normal.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 31 (17 by maintainers)
Hey @kennym, I still didn’t have much time to tackle this issue yet.
For now you either have to run
graph-nodeby havingRustinstalled in your local machine, or use thisdockertag for now: https://hub.docker.com/layers/graphprotocol/graph-node/2c23cce/images/sha256-9182194b742c2c1a70658f7f01aa49a30a8ecd2353f7ae1e7cfd43be73f7c262?context=explore@dylankilkenny I’ve been able to run
graph-nodeon a Macbook Pro M1 13" locally by:wasmtime’smainbranch, at this moment it is pointed to this commit: https://github.com/bytecodealliance/wasmtime/commit/4d036a4e347ae3f9f4ca43416ac84bcd2304cb6bTo do this I just did this change on
runtime/wasm/Cargo.toml, moving from:to
watcrate, so I did an update with:After these changes I think you should be go to go 😊
Greetings – just dropping a note here after following a link from the Wasmtime issue – FYI we’re planning to cut our next release of Wasmtime on Monday and it should include a new PR that makes M1 work (though we still don’t have it on CI so I can’t say for sure; if not, we have a contributor who is actively working on M1 issues). Sorry and thanks for the patience!
I just stumbled upon this bug again when I saw this problem on a M1. The graph-node was running in a docker-compose. First we tried with
v0.22.0(older than this issue).After reading through this issue I though it should be fixed, so we tried
v0.23.1orlatestat the time of writing. Interestingly, this did not fix the problem. But after some research, I found the docker-compose file on scaffold-eth with version2c23cce.Although the
panickederror did not appear anymore and the subgraph actually started to index some entities, the graph-node container crashed:So I see two problems here:
2c23cceandlatest.@dylankilkenny @otaviopace @azf20 Can you please test if you can successfully deploy a subgraph to your local graph-node running with docker-compose and pointing to
v0.23.1orlatest?This is working as of Docker for Mac
4.1.0, which updated Qemu to6.1.0🎉 https://docs.docker.com/desktop/mac/release-notes/#upgrades-1This is what worked for me: Mac M1 13" 2020
Thanks to: https://github.com/graphprotocol/graph-node/issues/2325#issuecomment-871701589
docker-compose.yml
graphnode command (must run inside of graphnode repo)
Note: downgrading to https://hub.docker.com/layers/graphprotocol/graph-node/2c23cce/images/sha256-9182194b742c2c1a70658f7f01aa49a30a8ecd2353f7ae1e7cfd43be73f7c262?context=explore didn’t work for me because I was using subgraph version “0.0.5” which requires additional changes to node-modules that broke other stuff https://githubmemory.com/repo/austintgriffith/scaffold-eth/issues/456
@otaviopace thanks - that worked!
I replicated this with 0.23.1. I know @otaviopace and @leoyvens looked into this previously?
It looks like Docker’s position is that running x86-64 images on aarch64 is not guaranteed to work. We should fix this on our side by publishing multi-architecture tags.
Just FYI, this seems working for the issue mentioned on the title by @azf20 , but then it raises the issue mentioned by @schmidsi. https://github.com/graphprotocol/graph-node/issues/2325#issuecomment-867523744
Is there a fix for this in the latest releases?
@otaviopace yes, we could try to fix it on our side by seeing if it reproduces outside docker when running this build process https://github.com/graphprotocol/graph-node/blob/master/docker/Dockerfile#L16-L29.
I think for this we gonna have to look into our whole docker image build process, tweak some things until we find what’s breaking on the M1 (maybe we’re adding something that has incompatibility with
wasmtime?).@otaviopace thanks for the help, its back up and running now 🙂
@dylankilkenny since I am also trying to run
graph-nodeon a M1, I will be investigating this as well.I already found some things that might be breaking at compilation time, when we advance on this matter I will post the solution here 🙂