Skip to content

Cardano transaction database is locked in aggregator #2500

Open
@jpraynaud

Description

@jpraynaud

Why

During the release of 2517.0 some networks (release-mainnet, release-preprod, pre-release-preview) had the Cardano transaction database locked and the following failure:

thread 'tokio-runtime-worker' panicked at /home/runner/work/mithril/mithril/internal/mithril-persistence/src/sqlite/cursor.rs:35:51:
database is locked (code 5)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <mithril_persistence::sqlite::cursor::EntityCursor<T> as core::iter::traits::iterator::Iterator>::next
   3: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
   4: mithril_persistence::sqlite::connection_extensions::ConnectionExtensions::fetch_collect
   5: mithril_aggregator::database::repository::cardano_transaction_repository::<impl mithril_aggregator::services::cardano_transactions_importer::TransactionStore for mithril_persistence::database::repository::cardano_transaction_repository::CardanoTransactionRepository>::store_transactions::{{closure}}
   6: tokio::runtime::handle::Handle::block_on
   7: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
   8: tokio::runtime::task::core::Core<T,S>::poll
   9: tokio::runtime::task::harness::Harness<T,S>::poll
  10: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Analysis

  • Access (read) was possible with the sqlite3 CLI.
  • The fix was to stop the aggregator and manually run a vacuum on the database (but vacuum was probably not necessary).
  • The problem did not occur when releasing the 2517.1 distribution (the day after releasing 2517.0).

Problem was reproduced on dev-follower-preview network after 6 weeks of not updating the nodes (the problem was fixed after just a restart:):

Starting server...
{"msg":"Started","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.32882563Z","hostname":"11bd18ae8fc6","pid":1,"node_version":"0.7.47+7eb3a8a","run_mode":"dev"}
Press Ctrl+C to stop
{"msg":"SERVE command","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.329725727Z","hostname":"11bd18ae8fc6","pid":1,"config":"ServeCommandConfiguration { environment: Production, cardano_cli_path: \"/app/bin/cardano-cli\", cardano_node_socket_path: \"/ipc/node.socket\", cardano_node_version: \"10.3.1\", network_magic: Some(42), network: \"preview\", chain_observer_type: Pallas, protocol_parameters: ProtocolParameters { k: 5, m: 100, phi_f: 0.65 }, snapshot_uploader_type: Gcp, snapshot_bucket_name: Some(\"cdn.aggregator.dev-follower-preview.api.mithril.network\"), snapshot_use_cdn_domain: false, server_ip: \"0.0.0.0\", server_port: 8080, public_server_url: Some(\"https://aggregator.dev-follower-preview.api.mithril.network/aggregator\"), run_interval: 60000, db_directory: \"/db\", snapshot_directory: \"/mithril-aggregator/mithril/snapshots\", data_stores_directory: \"/mithril-aggregator/mithril/stores\", genesis_verification_key: \"5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d\", reset_digests_cache: false, disable_digests_cache: false, store_retention_limit: Some(5), era_reader_adapter_type: CardanoChain, era_reader_adapter_params: Some(\"{\\\"address\\\":\\\"addr_test1qzzngukkj9ydjemqjlgfn42sevy2xnvauay46weushlpuq9thd4ray00csjssf4sxftv04xeequ3xfx72nujg9y4d5ysgkxxlh\\\",\\\"verification_key\\\":\\\"5b35352c3232382c3134342c38372c3133382c3133362c34382c382c31342c3138372c38352c3134382c39372c3233322c3235352c3232392c33382c3234342c3234372c3230342c3139382c31332c33312c3232322c32352c3136342c35322c3130322c39312c3132302c3230382c3134375d\\\"}\"), ancillary_files_signer_config: GcpKms { resource_name: GcpCryptoKeyVersionResourceName { project: \"iog-hydra\", location: \"europe-west1\", key_ring: \"mithril-testing\", key_name: \"mithril-ancillary\", version: \"1\" }, credentials_json_env_var: \"GOOGLE_APPLICATION_CREDENTIALS_GCP_KMS_JSON\" }, signed_entity_types: Some(\"CardanoTransactions,CardanoStakeDistribution,CardanoDatabase\"), snapshot_compression_algorithm: Zstandard, zstandard_parameters: Some(ZstandardCompressionParameters { level: 9, number_of_workers: 4 }), cexplorer_pools_url: Some(\"https://preview-js.cexplorer.io/api-static/pool/list.json\"), signer_importer_run_interval: 720, allow_unparsable_block: false, cardano_transactions_prover_cache_pool_size: 5, cardano_transactions_database_connection_pool_size: 10, cardano_transactions_signing_config: CardanoTransactionsSigningConfig { security_parameter: BlockNumber(0), step: BlockNumber(15) }, cardano_transactions_prover_max_hashes_allowed_by_request: 100, cardano_transactions_block_streamer_max_roll_forwards_per_poll: 10000, enable_metrics_server: true, metrics_server_ip: \"0.0.0.0\", metrics_server_port: 9090, persist_usage_report_interval_in_seconds: 10, leader_aggregator_endpoint: Some(\"https://aggregator.dev-preview.api.mithril.network/aggregator\"), custom_origin_tag_white_list: Some(\"HYDRA,LACE,BLOCKFROST,IBC,DOLOS,AMARU,ACROPOLIS\") }"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.329902053Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/monitoring.sqlite3"}
{"msg":"Applying database migrations","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.340631785Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder"}
{"msg":"Check database version","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.340891825Z","hostname":"11bd18ae8fc6","pid":1,"src":"DatabaseVersionChecker"}
{"msg":"database up to date","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.383111418Z","hostname":"11bd18ae8fc6","pid":1,"src":"DatabaseVersionChecker"}
{"msg":"Starting monitoring event loop to log messages.","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:41.38356537Z","hostname":"11bd18ae8fc6","pid":1,"src":"EventStore"}
{"msg":"Sufficient time has passed since last vacuum","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:41.438049289Z","hostname":"11bd18ae8fc6","pid":1,"min_interval_days":7,"elapsed_days":21,"last_vacuum":"2025-04-28 09:11:19.445171625 UTC"}
{"msg":"Performing vacuum","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:41.438639191Z","hostname":"11bd18ae8fc6","pid":1}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.438774514Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/aggregator.sqlite3"}
{"msg":"Applying database migrations","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.505919252Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder"}
{"msg":"Check database version","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.506034265Z","hostname":"11bd18ae8fc6","pid":1,"src":"DatabaseVersionChecker"}
{"msg":"database up to date","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.507682236Z","hostname":"11bd18ae8fc6","pid":1,"src":"DatabaseVersionChecker"}
{"msg":"Handle discrepancies at startup of epoch settings store, will record epoch settings from the configuration for epoch 936","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.519839382Z","hostname":"11bd18ae8fc6","pid":1,"epoch_settings_configuration":"AggregatorEpochSettings { protocol_parameters: ProtocolParameters { k: 5, m: 100, phi_f: 0.65 }, cardano_transactions_signing_config: CardanoTransactionsSigningConfig { security_parameter: BlockNumber(0), step: BlockNumber(15) } }"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.521557017Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Applying database migrations","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.541378947Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder"}
{"msg":"Check database version","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.541475902Z","hostname":"11bd18ae8fc6","pid":1,"src":"DatabaseVersionChecker"}
{"msg":"database up to date","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.549972307Z","hostname":"11bd18ae8fc6","pid":1,"src":"DatabaseVersionChecker"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.550097174Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.550795814Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.551592242Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.55295833Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.554132434Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.555142617Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.555991878Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.556821514Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.557616874Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Opening SQLite connection","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.558720351Z","hostname":"11bd18ae8fc6","pid":1,"src":"ConnectionBuilder","options":"[EnableForeignKeys, EnableWriteAheadLog]","path":"/mithril-aggregator/mithril/stores/cardano-transaction.sqlite3"}
{"msg":"Start database vacuum","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:41.559708456Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService"}
{"msg":"Vacuum main database","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:41.560711255Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService"}
{"msg":"Running `vacuum` on the SQLite database","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:41.560858572Z","hostname":"11bd18ae8fc6","pid":1,"src":"SqliteCleaner","src":"AggregatorUpkeepService"}
{"msg":"Vacuum finished","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:43.044106274Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService"}
{"msg":"Vacuum performed","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:43.056574169Z","hostname":"11bd18ae8fc6","pid":1,"last_vacuum":"2025-05-19T16:29:43.044408202+00:00"}
{"msg":"New AggregatorHTTPClient created","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:44.243476022Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorHTTPClient"}
{"msg":"Starts computing the Merkle map pool resource of size 5","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:44.328228008Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService","up_to_block_number":3172724}
{"msg":"Computing the Merkle map pool resource 1/5","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:46.519696533Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Computing the Merkle map pool resource 3/5","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:46.51973805Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Computing the Merkle map pool resource 4/5","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:47.808156242Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Computing the Merkle map pool resource 2/5","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:47.837505627Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Computing the Merkle map pool resource 5/5","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:49.104610838Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Draining the Merkle map pool","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:49.888226877Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Giving back new resources to the Merkle map pool","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:49.888349959Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"Completed computing the Merkle map pool resource of size 5","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:49.888389787Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilProverService"}
{"msg":"New MithrilCertificateVerifier created","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.008763307Z","hostname":"11bd18ae8fc6","pid":1}
{"msg":"New MultiSignerImpl created","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.009168859Z","hostname":"11bd18ae8fc6","pid":1,"src":"MultiSignerImpl"}
{"msg":"Initializing runtime","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.009343553Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime"}
{"msg":"Launching State Machine","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.010363546Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime"}
{"msg":"Started","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.010834184Z","hostname":"11bd18ae8fc6","pid":1,"src":"CardanoTransactionsPreloader"}
{"msg":"Locking signed entity type","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.010855739Z","hostname":"11bd18ae8fc6","pid":1,"src":"CardanoTransactionsPreloader","entity_type":"CardanoTransactions"}
{"msg":"================================================================================","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.012389018Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime"}
{"msg":"New cycle: Idle - No TimePoint","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.012885027Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime"}
{"msg":"Incrementing 'mithril_aggregator_runtime_cycle_total_since_startup' counter","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.013731489Z","hostname":"11bd18ae8fc6","pid":1,"src":"MetricsService"}
{"msg":">> get_time_point_from_chain","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.013940356Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":"Starting HTTP server for metrics on port 9090","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.029024708Z","hostname":"11bd18ae8fc6","pid":1,"src":"MetricsServer"}
{"msg":"Metrics sent, Sleeping for 10 seconds","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.032628655Z","hostname":"11bd18ae8fc6","pid":1,"src":"UsageReporter"}
{"msg":"Event received","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.032890926Z","hostname":"11bd18ae8fc6","pid":1,"src":"EventStore","event":"EventMessage { source: \"Metrics\", action: \"mithril_aggregator_runtime_cycle_total_since_startup\", content: Object {\"date\": String(\"2025-05-19T16:29:50.031786144Z\"), \"name\": String(\"mithril_aggregator_runtime_cycle_total_since_startup\"), \"origin\": String(\"\"), \"period\": Object {\"nanos\": Number(0), \"secs\": Number(10)}, \"value\": Number(1)}, headers: {} }"}
{"msg":"Event ID=103504 created","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.032918098Z","hostname":"11bd18ae8fc6","pid":1,"src":"EventStore"}
{"msg":"No last polled point available, falling back to the highest stored chain point","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.148704126Z","hostname":"11bd18ae8fc6","pid":1,"src":"CardanoTransactionsImporter"}
{"msg":"Retrieving Cardano transactions until block numbered '3250290'","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.148739557Z","hostname":"11bd18ae8fc6","pid":1,"src":"CardanoTransactionsImporter","highest_stored_block_number":"Some(BlockNumber(3185425))","starting_slot_number":"Some(SlotNumber(79267146))"}
{"msg":"Connected to a new client","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.15130223Z","hostname":"11bd18ae8fc6","pid":1,"src":"PallasChainReader"}
{"msg":"Has agency, finding intersect point...","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.151328443Z","hostname":"11bd18ae8fc6","pid":1,"src":"PallasChainReader","point":"RawCardanoPoint { slot_number: SlotNumber(79267146), block_hash: \"7e04f60a72c0320a13849f43450d8b3259c18ebcf3a72ad988cb8cb1ca04b2da\" }"}
{"msg":"→ Trying to transition to READY","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:50.233430978Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime","last_time_point":"TimePoint { epoch: Epoch(937), immutable_file_number: 18749, chain_point: ChainPoint { slot_number: SlotNumber(81016186), block_number: BlockNumber(3250290), block_hash: \"4de999f54c68a5ffcec2e62c49cdbb298e2c44252da260f4bf3423f8cc51b70b\" } }"}
{"msg":"Retrieve epoch settings","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.233538955Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorHTTPClient"}
{"msg":">> poll_next","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.271055248Z","hostname":"11bd18ae8fc6","pid":1,"src":"ChainReaderBlockStreamer"}
{"msg":">> close_signer_registration_round","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.309892668Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":">> update_era_checker(Epoch(937))","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:50.310594752Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":"Current Era is pythagoras (Epoch 937).","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.519369019Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":">> update_stake_distribution","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.519516065Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner","time_point":"TimePoint {\n    epoch: Epoch(\n        937,\n    ),\n    immutable_file_number: 18749,\n    chain_point: ChainPoint {\n        slot_number: SlotNumber(\n            81016186,\n        ),\n        block_number: BlockNumber(\n            3250290,\n        ),\n        block_hash: \"4de999f54c68a5ffcec2e62c49cdbb298e2c44252da260f4bf3423f8cc51b70b\",\n    },\n}"}
{"msg":">> inform_new_epoch(Epoch(937))","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.527320207Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":">> inform_epoch(epoch: Epoch(937))","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.527590613Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilCertifierService"}
{"msg":"Informed of a new Epoch: Epoch(937). Cleaned 0 open messages along with their single signatures.","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.527834692Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilCertifierService"}
{"msg":">> inform_epoch(epoch: Epoch(937))","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.527936414Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilEpochService"}
{"msg":">> upkeep","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.537572841Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":"Start upkeep of the application","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.537594187Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService"}
{"msg":"Pruning stale data","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.537603776Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService","current_epoch":"Epoch(937)","pruned_data":"Stake pool"}
{"msg":"Pruning stale data","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.537910269Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService","current_epoch":"Epoch(937)","pruned_data":"Epoch settings"}
{"msg":"Pruning stale data","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.538397598Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService","current_epoch":"Epoch(937)","pruned_data":"Signer registration"}
{"msg":"Some entities are locked - Skipping database upkeep","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.538460944Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService"}
{"msg":"Upkeep finished","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.538638131Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorUpkeepService"}
{"msg":">> open_signer_registration_round","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.538728101Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner","time_point":"TimePoint {\n    epoch: Epoch(\n        937,\n    ),\n    immutable_file_number: 18749,\n    chain_point: ChainPoint {\n        slot_number: SlotNumber(\n            81016186,\n        ),\n        block_number: BlockNumber(\n            3250290,\n        ),\n        block_hash: \"4de999f54c68a5ffcec2e62c49cdbb298e2c44252da260f4bf3423f8cc51b70b\",\n    },\n}"}
{"msg":">> update_epoch_settings","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.540167433Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":">> update_epoch_settings","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.540343007Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilEpochService"}
{"msg":"Inserting epoch settings in epoch 939","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.540511601Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilEpochService","epoch_settings":"AggregatorEpochSettings { protocol_parameters: ProtocolParameters { k: 5, m: 100, phi_f: 0.65 }, cardano_transactions_signing_config: CardanoTransactionsSigningConfig { security_parameter: BlockNumber(0), step: BlockNumber(15) } }"}
{"msg":"Retrieve epoch settings","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.540521886Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorHTTPClient"}
{"msg":">> update_next_signers_with_stake","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.656735331Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilEpochService"}
{"msg":">> precompute_epoch_data","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.660726166Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilEpochService"}
{"msg":">> precompute_epoch_data","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.725847373Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":">> precompute_epoch_data","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.725878671Z","hostname":"11bd18ae8fc6","pid":1,"src":"MithrilEpochService"}
{"msg":">> is_certificate_chain_valid","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:51.781992626Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRunner"}
{"msg":"An error occurred, runtime state kept. message = 'certificate chain is invalid'","v":0,"name":"mithril-aggregator","level":50,"time":"2025-05-19T16:29:51.791998432Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime","nested_error":"There is an epoch gap between the last certificate epoch (Epoch(924)) and current epoch (Epoch(937))\n\nStack backtrace:\n   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from\n   1: <mithril_aggregator::services::certifier::certifier_service::MithrilCertifierService as mithril_aggregator::services::certifier::interface::CertifierService>::verify_certificate_chain::{{closure}}\n   2: <mithril_aggregator::services::certifier::buffered_certifier::BufferedCertifierService as mithril_aggregator::services::certifier::interface::CertifierService>::verify_certificate_chain::{{closure}}\n   3: <mithril_aggregator::runtime::runner::AggregatorRunner as mithril_aggregator::runtime::runner::AggregatorRunnerTrait>::is_certificate_chain_valid::{{closure}}\n   4: mithril_aggregator::runtime::state_machine::AggregatorRuntime::cycle::{{closure}}\n   5: mithril_aggregator::commands::serve_command::ServeCommand::execute::{{closure}}::{{closure}}\n   6: tokio::runtime::task::core::Core<T,S>::poll\n   7: tokio::runtime::task::harness::Harness<T,S>::poll\n   8: tokio::runtime::scheduler::multi_thread::worker::Context::run_task\n   9: tokio::runtime::context::scoped::Scoped<T>::set\n  10: tokio::runtime::context::runtime::enter_runtime\n  11: tokio::runtime::scheduler::multi_thread::worker::run\n  12: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll\n  13: tokio::runtime::task::core::Core<T,S>::poll\n  14: tokio::runtime::task::harness::Harness<T,S>::poll\n  15: tokio::runtime::blocking::pool::Inner::run\n  16: std::sys::backtrace::__rust_begin_short_backtrace\n  17: core::ops::function::FnOnce::call_once{{vtable.shim}}\n  18: std::sys::pal::unix::thread::Thread::new::thread_start\n  19: <unknown>\n  20: __clone"}
{"msg":"… Cycle finished","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:51.79205192Z","hostname":"11bd18ae8fc6","pid":1,"src":"AggregatorRuntime","run_interval_in_ms":60000,"approximate_next_cycle_time":"16:30:50.012"}
{"msg":"Starting import","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:55.030144735Z","hostname":"11bd18ae8fc6","pid":1,"src":"SignersImporter"}
{"msg":"Retrieving data from source","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:55.030185098Z","hostname":"11bd18ae8fc6","pid":1,"source_url":"https://preview-js.cexplorer.io/api-static/pool/list.json"}
{"msg":"Persisting retrieved data in the database","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:55.178682468Z","hostname":"11bd18ae8fc6","pid":1,"src":"SignersImporter","number_of_signer_to_insert":464}
{"msg":"Cycle finished, Sleeping for 720 min","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:55.182973784Z","hostname":"11bd18ae8fc6","pid":1,"src":"SignersImporter"}

thread 'tokio-runtime-worker' panicked at /home/runner/work/mithril/mithril/internal/mithril-persistence/src/sqlite/cursor.rs:35:51:
database is locked (code 5)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <mithril_persistence::sqlite::cursor::EntityCursor<T> as core::iter::traits::iterator::Iterator>::next
   3: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
   4: mithril_persistence::sqlite::connection_extensions::ConnectionExtensions::fetch_collect
   5: mithril_aggregator::database::repository::cardano_transaction_repository::<impl mithril_aggregator::services::cardano_transactions_importer::TransactionStore for mithril_persistence::database::repository::cardano_transaction_repository::CardanoTransactionRepository>::store_transactions::{{closure}}
   6: tokio::runtime::handle::Handle::block_on
   7: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
   8: tokio::runtime::task::core::Core<T,S>::poll
   9: tokio::runtime::task::harness::Harness<T,S>::poll
  10: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
{"msg":"Releasing signed entity type","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.430365466Z","hostname":"11bd18ae8fc6","pid":1,"src":"CardanoTransactionsPreloader","entity_type":"CardanoTransactions"}
{"msg":"Finished","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:29:58.430400067Z","hostname":"11bd18ae8fc6","pid":1,"src":"CardanoTransactionsPreloader"}
{"msg":"OPTIONS /aggregator/status 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.888613197Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/snapshots 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.888650349Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/certificates 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.888658321Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/mithril-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.888664829Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/status 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.907289334Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/mithril-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.907950838Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/certificates 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.909706065Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/snapshots 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.909730886Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-database 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.921668066Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-transactions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.921702691Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.922781824Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-transactions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.936770494Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-database 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.937247515Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:29:58.940040327Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"Metrics sent, Sleeping for 10 seconds","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:30:00.029685455Z","hostname":"11bd18ae8fc6","pid":1,"src":"UsageReporter"}
{"msg":"OPTIONS /aggregator/artifact/snapshots 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.89032428Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/status 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.890504593Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/certificates 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.89052543Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/mithril-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.890540792Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/status 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.914003852Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/snapshots 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.91403894Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/certificates 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.915223952Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/mithril-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.916098883Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-transactions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.922791596Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-database 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.922857207Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.922872284Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-transactions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.940842927Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-database 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.94312569Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:08.94316459Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"Metrics sent, Sleeping for 10 seconds","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:30:10.030050098Z","hostname":"11bd18ae8fc6","pid":1,"src":"UsageReporter"}
{"msg":"OPTIONS /aggregator/status 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.888101795Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/snapshots 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.888148791Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/certificates 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.889420722Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/mithril-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.889450585Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/mithril-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.908275232Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/snapshots 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.908529041Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/status 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.909023735Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/certificates 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.909193587Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-transactions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.925100436Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-database 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.925129272Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"OPTIONS /aggregator/artifact/cardano-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.925749599Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-database 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.940592806Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-transactions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.941995869Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"GET /aggregator/artifact/cardano-stake-distributions 200 OK","v":0,"name":"mithril-aggregator","level":20,"time":"2025-05-19T16:30:18.943989673Z","hostname":"11bd18ae8fc6","pid":1,"src":"http_server"}
{"msg":"Metrics sent, Sleeping for 10 seconds","v":0,"name":"mithril-aggregator","level":30,"time":"2025-05-19T16:30:20.029376732Z","hostname":"11bd18ae8fc6","pid":1,"src":"UsageReporter"}

What

Identify and fix the source of the lock on the Cardano transaction database in the aggregator.

How

  • Investigate the source of the lock
  • Create a fix for the database lock

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug ⚠️Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions