baking-bad / tzkt

😼 Awesome Tezos blockchain indexer and API
https://tzkt.io
MIT License
183 stars 35 forks source link

Indexer stops at block 2441748 #107

Closed GBBx closed 2 years ago

GBBx commented 2 years ago

Hi,

I have two instances of tzkt (v1.8.4) running against tezos-node v13.0 (mainnet).

Both tzkt indexers stopped at the same block. The current blockheight reported by the tzkt api is 2441748. Indexer log:

         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
fail: Tzkt.Sync.Services.Observer[0]
      Failed to rebase branch. An exception has been raised that is likely due to a transient failure.
      System.InvalidOperationException: An exception has been raised that is likely due to a transient failure.
       ---> Npgsql.NpgsqlException (0x80004005): Exception while reading from stream
       ---> System.TimeoutException: Timeout during reading attempt
         at Npgsql.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
         at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
         at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
         at Tzkt.Sync.Protocols.Proto1.BigMapCommit.Revert(Block block) in /app/src/tzkt/Tzkt.Sync/Protocols/Handlers/Proto1/Commits/BigMapCommit.cs:line 527
         at Tzkt.Sync.Protocols.Proto12Handler.Revert() in /app/src/tzkt/Tzkt.Sync/Protocols/Handlers/Proto12/Proto12Handler.cs:line 315
         at Tzkt.Sync.ProtocolHandler.RevertLastBlock(String predecessor) in /app/src/tzkt/Tzkt.Sync/Protocols/ProtocolHandler.cs:line 141
         at Tzkt.Sync.ProtocolHandler.RevertLastBlock(String predecessor) in /app/src/tzkt/Tzkt.Sync/Protocols/ProtocolHandler.cs:line 161
         at Tzkt.Sync.Services.Observer.RebaseLocalBranchAsync(CancellationToken cancelToken) in /app/src/tzkt/Tzkt.Sync/Services/Observer/Observer.cs:line 157
         at Tzkt.Sync.Services.Observer.ExecuteAsync(CancellationToken cancelToken) in /app/src/tzkt/Tzkt.Sync/Services/Observer/Observer.cs:line 74
fail: Tzkt.Sync.Services.Observer[0]
      Failed to apply block: Validation exception - invalid block predecessor. Rebase local branch...
fail: Tzkt.Sync.Services.Observer[0]
      Invalid head [2441747:BLMGwtZ7MRT28SpJbs1XGJGnSHQqWH4tJB8K2FHZfbhthLvJT4d]. Reverting...

I tried to restart them but it did not help.

Zir0h commented 2 years ago

I don't know if it is the right way of doing it, but I had to increase the timeout by appending CommandTimeout=600; to the ConnectionStrings__DefaultConnection: lines.

GBBx commented 2 years ago

@Zir0h Thanks for your advice. Adding the timeout did help.