Can't create instance of indexer following quickstart tutorial (DEPRECATED)

I found link to the Indexer book from main fuel page this one - The Fuel Indexer - The Fuel Indexer Service.

I have downloaded all dependencies that were mentioned here.

But when I started to follow Quickstart tutorial with this command I noticed some problems

forc index start \
    --embedded-database
    --fuel-node-host node-beta-2.fuel.network \
    --fuel-node-port 80

First of all I fixed all mistakes in this command like changing node url to latest v3 one and added \ symbol, so this one should be correct one

forc index start \
    --fuel-node-host beta-3.fuel.network \
    --fuel-node-port 80 \
    --embedded-database 

and tried to run this, but got this error :

^^>>> forc index start \                                                                                                                17:32:50 
              --fuel-node-host beta-3.fuel.network \
              --fuel-node-port 80 \
              --embedded-database 
error: Found argument '--embedded-database' which wasn't expected, or isn't valid in this context

	If you tried to supply `--embedded-database` as a value rather than a flag, use `-- --embedded-database`

USAGE:
    forc-index start --fuel-node-host <FUEL_NODE_HOST> --fuel-node-port <FUEL_NODE_PORT>

For more information try --help

And also I couldn’t run this command appropriate till I updated forc index to latest version. It would be better to create a note in documentation how to update this. I think those errors should be fixed in documentation not to cause more questions from developers.

So, after I tried to run it and got this error

📦 Downloading, unpacking, and bootstrapping database...

▹▹▸▹▹ ⏱  Setting up database...
                                                                                                                                                 The files belonging to this database system will be owned by user "lidia".    
This user must also own the server process.    
    
The database cluster will be initialized with locales    
  COLLATE:  C    
  CTYPE:    UTF-8    
  MESSAGES: C    
  MONETARY: C    
  NUMERIC:  C    
  TIME:     C    
The default database encoding has accordingly been set to "UTF8".    
The default text search configuration will be set to "simple".    
    
Data page checksums are disabled.    
    
fixing permissions on existing directory /Users/lidia/.fuel/indexer/postgres ... ok    
creating subdirectories ... ok    
selecting dynamic shared memory implementation ... posix    
selecting default max_connections ... 100    
selecting default shared_buffers ... 128MB    
selecting default time zone ... Europe/Lisbon    
creating configuration files ... ok    
running bootstrap script ... ok    
performing post-bootstrap initialization ... ok    
syncing data to disk ... ok    
    
Success. You can now start the database server using:    
    
    /Users/lidia/Library/Caches/pg-embed/darwin/arm64v8/14.6.0/bin/pg_ctl -D /Users/lidia/.fuel/indexer/postgres -l logfile start    
    
▸▹▹▹▹ ⏱  Setting up database...
                                                                                                                                                 💡 Creating database
waiting for server to start....2023-04-04 17:58:41.553 WEST [25872] LOG:  starting PostgreSQL 14.6 on x86_64-apple-darwin20.6.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.29), 64-bit    
2023-04-04 17:58:41.565 WEST [25872] LOG:  listening on IPv6 address "::1", port 5432    
2023-04-04 17:58:41.565 WEST [25872] LOG:  listening on IPv4 address "127.0.0.1", port 5432    
2023-04-04 17:58:41.566 WEST [25872] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"    
2023-04-04 17:58:41.571 WEST [25873] LOG:  database system was shut down at 2023-04-04 17:58:41 WEST    
2023-04-04 17:58:41.573 WEST [25872] LOG:  database system is ready to accept connections    
 done    
▹▸▹▹▹ ⏱  Setting up database...
                                                                                                                                                 2023-04-04 17:58:41.684 WEST [25880] ERROR:  database "postgres" already exists    
2023-04-04 17:58:41.684 WEST [25880] STATEMENT:  CREATE DATABASE "postgres"    
CREATE DATABASE "postgres"; rows affected: 0, rows returned: 0, elapsed: 359.458µs  
Database postgres already exists
2023-04-04 17:58:41.684 WEST [25880] LOG:  could not receive data from client: Connection reset by peer    

▪▪▪▪▪ ⏱  Setting up database...
                                                                                                                                                 2023-04-04 17:58:41.686 WEST [25872] LOG:  received fast shutdown request    
2023-04-04 17:58:41.686 WEST [25872] LOG:  aborting any active transactions    
2023-04-04 17:58:41.687 WEST [25872] LOG:  background worker "logical replication launcher" (PID 25879) exited with exit code 1    
2023-04-04 17:58:41.687 WEST [25874] LOG:  shutting down    
2023-04-04 17:58:41.689 WEST [25872] LOG:  database system is shut down    
Using database directory at "/Users/lidia/.fuel/indexer/postgres"
waiting for server to shut down.... done    
server stopped    

Starting PostgreSQL...

waiting for server to start....2023-04-04 17:58:41.833 WEST [25884] LOG:  starting PostgreSQL 14.6 on x86_64-apple-darwin20.6.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.29), 64-bit    
2023-04-04 17:58:41.836 WEST [25884] LOG:  listening on IPv6 address "::1", port 5432    
2023-04-04 17:58:41.836 WEST [25884] LOG:  listening on IPv4 address "127.0.0.1", port 5432    
2023-04-04 17:58:41.836 WEST [25884] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"    
2023-04-04 17:58:41.840 WEST [25885] LOG:  database system was shut down at 2023-04-04 17:58:41 WEST    
2023-04-04 17:58:41.841 WEST [25884] LOG:  database system is ready to accept connections    
 done    
server started    
select exists(SELECT 1 from …; rows affected: 0, rows returned: 1, elapsed: 1.239ms

select
  exists(
    SELECT
      1
    from
      pg_database
    WHERE
      datname = $1
  )
  

✅ Successfully started database.
2023-04-04 17:58:41.964 WEST [25892] LOG:  could not receive data from client: Connection reset by peer    

✅ Successfully started the indexer service at PID 25894.
^^>>> 2023-04-04T16:58:42.328656Z  INFO fuel_indexer::commands::run: 43: Configuration: IndexerConfig { fuel_node: FuelNodeConfig { host: "beta-3.fuel.network", port: "80" }, graphql_api: GraphQLConfig { host: "localhost", port: "29987", max_body_size: 5242880 }, database: PostgresConfig { user: "postgres", password: "XXXX", host: "localhost", port: "5432", database: "postgres" }, metrics: false, stop_idle_indexers: false, run_migrations: false, authentication: AuthenticationConfig { enabled: false, strategy: None, jwt_secret: None, jwt_issuer: None, jwt_expiry: None } }
2023-04-04T16:58:42.378300Z  INFO sqlx::query: SELECT * FROM index_registry; rows affected: 0, rows returned: 0, elapsed: 534.792µs  
Error: Error from sqlx: Database(
    PgDatabaseError {
        severity: Error,
        code: "42P01",
        message: "relation \"index_registry\" does not exist",
        detail: None,
        hint: None,
        position: Some(
            Original(
                15,
            ),
        ),
        where: None,
        schema: None,
        table: None,
        column: None,
        data_type: None,
        constraint: None,
        file: Some(
            "parse_relation.c",
        ),
        line: Some(
            1384,
        ),
        routine: Some(
            "parserOpenTable",
        ),
    },
)

Caused by:
    0: error returned from database: relation "index_registry" does not exist
    1: relation "index_registry" does not exist

What’s wrong with this? I have checked latest version of forc index in documentation by following https://fuellabs.github.io/fuel-indexer/latest link, it says it should be 0.6.1 but latest what I could to download is 0.6.0, I am not sure, maybe problem is in this…

Please help me))))

1 Like

@sway We recently fixed a bug related to the database caused by the --embedded-database flag not persisting the database (the database was being created, but it was ephemeral). I believe this should fix your issue.

v0.7 should have the fix you need. Will cut that release today.

Edit: Fix PR is here fix: persist embedded db when flag is passed by ra0x3 · Pull Request #730 · FuelLabs/fuel-indexer · GitHub

2 Likes

When will it be available to download from here https://crates.io/crates/forc-index?

Latest available version there is 0.6.1

hello
I have updated forc index to latest 0.7.0 version but I still keep getting same error while trying to run this command

forc index start \
    --fuel-node-host beta-3.fuel.network \
    --fuel-node-port 80 \
    --embedded-database 

The indexer is now on version 0.10.0 are you still getting the same error? If you are please include the output.

nope, It was fixed it recent updates
thanks

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.