planetarium / mimir

A backend service that provides 9c-related utility APIs.
https://nine-chronicles.dev/
GNU Affero General Public License v3.0
4 stars 18 forks source link

The `Mimir` process is stuck since #358 was merged. #363

Closed boscohyun closed 1 month ago

boscohyun commented 1 month ago

The Mimir process is stuck since #358 was merged.

[16:23:37 FTL] [Mimir.Worker.ActionHandler.ProductsHandler] 0x85f9835cfE5cE43a5AaeA4fA356A4943eCB368aD Product[6348fcd8-ba97-4312-9351-2a7d9c1991cf] is exists but state is `Bencodex Null`
Mimir.Worker.Exceptions.StateIsNullException: State is Bencodex.Types.Null for '0x54658Fc4b2280966415525eCa15A38B509e6bc00(Product)
   at Mimir.Worker.Util.StateGetter.GetProductState(Guid productId, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Util/StateGetter.cs:line 225
   at Mimir.Worker.ActionHandler.ProductsHandler.AddNewProductsAsync(Address avatarAddress, Address productsStateAddress, List`1 productsToAdd, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 136
[16:23:39 FTL] [Mimir.Worker.Worker] An error occurred during polling.
System.Collections.Generic.KeyNotFoundException: Element 'Object' not found.
   at MongoDB.Bson.BsonDocument.get_Item(String name)
   at Mimir.Worker.ActionHandler.ProductsHandler.GetExistingProductIds(Address productsStateAddress) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 117
   at Mimir.Worker.ActionHandler.ProductsHandler.SyncWrappedProductsStateAsync(Address avatarAddress, Address productsStateAddress, ProductsState productsState, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 99
   at Mimir.Worker.ActionHandler.ProductsHandler.TryHandleAction(String actionType, Int64 processBlockIndex, IValue actionPlainValueInternal, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 56
   at Mimir.Worker.ActionHandler.BaseActionHandler.TryHandleAction(Int64 blockIndex, Address signer, IAction action, IValue actionType, IValue actionPlainValueInternal, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/BaseActionHandler.cs:line 53
   at Mimir.Worker.Poller.TxPoller.ProcessTransactions(Int64 syncedBlockIndex, Int32 limit, CancellationToken cancellationToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 212
   at Mimir.Worker.Poller.TxPoller.ProcessBlocksAsync(Int64 syncedBlockIndex, Int64 targetBlockIndex, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 136
   at Mimir.Worker.Poller.TxPoller.RunAsync(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 109
   at Mimir.Worker.Worker.DoWork(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Worker.cs:line 72
[16:23:39 ERR] [Microsoft.Extensions.Hosting.Internal.Host] BackgroundService failed
System.Collections.Generic.KeyNotFoundException: Element 'Object' not found.
   at MongoDB.Bson.BsonDocument.get_Item(String name)
   at Mimir.Worker.ActionHandler.ProductsHandler.GetExistingProductIds(Address productsStateAddress) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 117
   at Mimir.Worker.ActionHandler.ProductsHandler.SyncWrappedProductsStateAsync(Address avatarAddress, Address productsStateAddress, ProductsState productsState, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 99
   at Mimir.Worker.ActionHandler.ProductsHandler.TryHandleAction(String actionType, Int64 processBlockIndex, IValue actionPlainValueInternal, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 56
   at Mimir.Worker.ActionHandler.BaseActionHandler.TryHandleAction(Int64 blockIndex, Address signer, IAction action, IValue actionType, IValue actionPlainValueInternal, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/BaseActionHandler.cs:line 53
   at Mimir.Worker.Poller.TxPoller.ProcessTransactions(Int64 syncedBlockIndex, Int32 limit, CancellationToken cancellationToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 212
   at Mimir.Worker.Poller.TxPoller.ProcessBlocksAsync(Int64 syncedBlockIndex, Int64 targetBlockIndex, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 136
   at Mimir.Worker.Poller.TxPoller.RunAsync(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 109
   at Mimir.Worker.Worker.DoWork(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Worker.cs:line 72
   at Mimir.Worker.Worker.ExecuteAsync(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Worker.cs:line 36
   at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
[16:23:39 FTL] [Microsoft.Extensions.Hosting.Internal.Host] The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
System.Collections.Generic.KeyNotFoundException: Element 'Object' not found.
   at MongoDB.Bson.BsonDocument.get_Item(String name)
   at Mimir.Worker.ActionHandler.ProductsHandler.GetExistingProductIds(Address productsStateAddress) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 117
   at Mimir.Worker.ActionHandler.ProductsHandler.SyncWrappedProductsStateAsync(Address avatarAddress, Address productsStateAddress, ProductsState productsState, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 99
   at Mimir.Worker.ActionHandler.ProductsHandler.TryHandleAction(String actionType, Int64 processBlockIndex, IValue actionPlainValueInternal, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/ProductsHandler.cs:line 56
   at Mimir.Worker.ActionHandler.BaseActionHandler.TryHandleAction(Int64 blockIndex, Address signer, IAction action, IValue actionType, IValue actionPlainValueInternal, IClientSessionHandle session, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/ActionHandler/BaseActionHandler.cs:line 53
   at Mimir.Worker.Poller.TxPoller.ProcessTransactions(Int64 syncedBlockIndex, Int32 limit, CancellationToken cancellationToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 212
   at Mimir.Worker.Poller.TxPoller.ProcessBlocksAsync(Int64 syncedBlockIndex, Int64 targetBlockIndex, CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 136
   at Mimir.Worker.Poller.TxPoller.RunAsync(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Poller/TxPoller.cs:line 109
   at Mimir.Worker.Worker.DoWork(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Worker.cs:line 72
   at Mimir.Worker.Worker.ExecuteAsync(CancellationToken stoppingToken) in /Users/seungmin/Repositories/mimir/Mimir.Worker/Worker.cs:line 36
   at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)

Process finished with exit code 0.

This is probably due to a change in the Json conversion logic.

image
moreal commented 1 month ago

It is resolved by #368 in part.

moreal commented 1 month ago

It may be completed by #375

moreal commented 1 month ago

It is resolved by #382