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

Indexer-db loses consistency after a while #10

Open
JacqueGM opened this issue Feb 23, 2023 · 0 comments
Open

Indexer-db loses consistency after a while #10

JacqueGM opened this issue Feb 23, 2023 · 0 comments
Labels
bug 💥 Something isn't working

Comments

@JacqueGM
Copy link

Describe the bug
After having running land-local setup for awhile the setup stops working and it seems that it's bc the db loses consistency.

To Reproduce
Steps to reproduce the behavior:

  1. Go to land-local
  2. Run setup from-image
  3. Wait for a while
  4. See indexer-db logs

Expected behavior

The setup should be running without stopping as long as the user has not terminated the containers

Logs

ERROR:  insert or update on table "transaction_2" violates foreign key constraint "fk_transaction_2_block_number"
indexer-db_1  | 2023-02-22 20:59:30.579 UTC [2094] DETAIL:  Key (block_number)=(5223) is not present in table "block".
indexer-db_1  | 2023-02-22 20:59:30.579 UTC [2094] CONTEXT:  SQL statement "insert into transaction_2
 select distinct ts2.block_number
indexer-db_1  | 	                  , ts2."from"
indexer-db_1  | 	                  , ts2."to"
indexer-db_1  | 	                  , ts2.hash
indexer-db_1  | 	                  , ts2.index
indexer-db_1  | 	                  , ts2.timestamp
indexer-db_1  | 	                  , ts2.value::numeric
indexer-db_1  | 	                  , ts2.input
indexer-db_1  | 	                  , ts2.nonce
indexer-db_1  | 	                  , ts2.type
indexer-db_1  | 	                  , ts2.classification
indexer-db_1  | 	    from _block_staging sb
indexer-db_1  | 	             join _transaction_staging ts2 on sb.number= ts2.block_number
indexer-db_1  | 	    where sb.selected_at = selected_at_ts
indexer-db_1  | 	    on conflict do nothing"
indexer-db_1  | 	PL/pgSQL function import_from_staging_2() line 103 at SQL statement
indexer-db_1  | 2023-02-22 20:59:30.579 UTC [2094] STATEMENT:  call import_from_staging_2()
indexer-db_1  | 2023-02-22 20:59:35.694 UTC [5475] ERROR:  insert or update on table "transaction_2" violates foreign key constraint "fk_transaction_2_block_number"
indexer-db_1  | 2023-02-22 20:59:35.694 UTC [5475] DETAIL:  Key (block_number)=(5223) is not present in table "block".
indexer-db_1  | 2023-02-22 20:59:35.694 UTC [5475] CONTEXT:  SQL statement "insert into transaction_2
indexer-db_1  | 	    select distinct ts2.block_number
indexer-db_1  | 	                  , ts2."from"
indexer-db_1  | 	                  , ts2."to"
indexer-db_1  | 	                  , ts2.hash
indexer-db_1  | 	                  , ts2.index
indexer-db_1  | 	                  , ts2.timestamp
indexer-db_1  | 	                  , ts2.value::numeric
indexer-db_1  | 	                  , ts2.input
indexer-db_1  | 	                  , ts2.nonce
indexer-db_1  | 	                  , ts2.type
indexer-db_1  | 	                  , ts2.classification
indexer-db_1  | 	    from _block_staging sb
indexer-db_1  | 	             join _transaction_staging ts2 on sb.number= ts2.block_number
indexer-db_1  | 	    where sb.selected_at = selected_at_ts
indexer-db_1  | 	    on conflict do nothing"
indexer-db_1  | 	PL/pgSQL function import_from_staging_2() line 103 at SQL statement

Desktop-Computer (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]
    .
@JacqueGM JacqueGM added the bug 💥 Something isn't working label Feb 23, 2023
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

1 participant