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

Issues running Chain-index on WSL2 - fully syncing but not running the webserver #350

Closed
RustyCamel opened this issue Mar 8, 2022 · 1 comment · Fixed by #351
Closed
Labels
bug Something isn't working

Comments

@RustyCamel
Copy link

Summary

I've run into an issue with the chain-index while trying to run a PAB testnet environment on Ubuntu (WSL2). The index will start up, sync to 100%, update to new blocks, but the webserver will never start. In fact, the port that the chain-index is supposed to occupy remains empty throughout this process. Commmands like curl -s localhost:9083/tip | jq '.tipSlot.getSlot' return nothing.

After some debugging, I isolated this piece of code - this is the last piece of code that runs after starting the chain-index server:

withAsync (runLogEffects (convertLog PrettyObject trace) $ logProgress chan) wait

It seems to log the output of the chain-index's progress, but I'm not sure. I believe it's responsible for outputs like this on the console:

[chain-index:Info:39] [2022-03-06 10:13:17.47 UTC] Still in sync. Applied 13 blocks, 0 rollbacks in the last 300s. Current tip is Point(Slot 52192355, BlockId 1893367e3a8139b6866e4c6e81bb1d2ecfa80660b1b027785f05d3e309a2d6d6)

This is the source of the problematic line: plutus-apps/plutus-chain-index/src/Plutus/ChainIndex/App.hs

I have two theories, but otherwise don't really know where to go from here.

  1. There are some issues with running an Async function in WSL2 (unlikely as I see Async functions in other, working Plutus apps)
  2. The database is corrupted somehow, and the line of code shown above is parsing through it in an attempt to fix it. I've tried rebuilding the database three times (using different commits on Github) to no avail.

Steps to reproduce the behavior

  1. Setup Ubuntu using (WSL2)
  2. Setup plutus-apps and nix-shell environment
  3. Setup testnet node and chain index following the procedure in plutus-apps/plutus-pab/test-node/README.md
  4. Start testnet node plutus-apps/plutus-pab/test-node/start-testnet-node.sh
  5. Start chain index cabal exec -- plutus-chain-index --config testnet/chain-index-config.json start-index

Actual Result

  • Node starts, and syncs as expected.
  • Chain-index starts, and syncs with messages like this [chain-index:Info:39] [2022-03-08 22:43:10.55 UTC] Syncing (17.81%). Applied 5639 blocks, 1 rollbacks in the last 30s. Current tip is Point(Slot 217317, BlockId 30a184e831362e7f6674ab5a6a94607e2222d440efab77eb5aedad9be5470328)
  • Occasional error: ChainIndexError: Insertion failed: UTxO insertion failed - already a block with the given number
  • Chain-index webserver never starts, and the port 9083 remains unoccupied throughout the process and even after sync completion

Expected Result

Chain-index webserver starts on port 9083.

Describe the approach you would take to fix this

No response

System info

OS: Ubuntu (WSL2)
Version: 20.04.4 LTS (Focal Fossa)
Plutus: Various tags and commits, including v2022-01-17 and the latest commit

@RustyCamel RustyCamel added the bug Something isn't working label Mar 8, 2022
@ghost
Copy link

ghost commented Mar 9, 2022

Thanks for reporting! Indeed there is a problem with withAsync handler. Will be fixed in #351.

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

Successfully merging a pull request may close this issue.

1 participant