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

fix: add instantiating indexer status, and display error if instantiation fails #1460

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

lostman
Copy link
Contributor

@lostman lostman commented Nov 8, 2023

Description

On develop, when indexer instantiation fails, forc index status will display the last status from the database. This may be running, Indexed 12345 blocks.

This PR adds IndexerStatusKind::Instantiating to avoid this situation.

In addition, if the indexer instantiation fails, the status is set to error and a proper message is displayed:

Indexers:

─ fuellabs
   ├─ explorer
   |  • id: 1
   |  • created at: 2023-11-08 11:54:53.323558 UTC (6h 45m ago)
   |  • status: error
   |  • status message:
   |      Error instantiating wasm interpreter: Link(
   |          Import(
   |              "env",
   |              "ff_single_select",
   |              UnknownImport(
   |                  Function(
   |                      FunctionType {
   |                          params: [
   |                              I64,
   |                              I32,
   |                              I32,
   |                          ],
   |                          results: [
   |                              I32,
   |                          ],
   |                      },
   |                  ),
   |              ),
   |          ),
   |      )

Testing steps

  1. Check out maciej/1437-entity-find and start the indexer:
cargo run --bin fuel-indexer -- run --run-migrations --fuel-node-host beta-4.fuel.network --fuel-node-port 80 --replace-indexer --manifest examples/fuel-explorer/fuel-explorer/fuel_explorer.manifest.yaml
  1. Check out develop, and restart the indexer without --manifest to keep the incompatible indexer in the database.
  2. Run forc index status to see the incorrect status.
  3. Check out maciej/add-more-indexer-statuses, and restart the indexer (again, without --manifest).
  4. Run forc index status to see the correct status and error.

@lostman lostman changed the title add instantiating indexer status, and display error if instantiation fails fix: add instantiating indexer status, and display error if instantiation fails Nov 8, 2023
@lostman lostman marked this pull request as ready for review November 9, 2023 08:53
@ra0x3 ra0x3 merged commit fc5ca2f into develop Nov 9, 2023
19 checks passed
@ra0x3 ra0x3 deleted the maciej/add-more-indexer-statuses branch November 9, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants