input-output-hk / plutus-apps

The Plutus application platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`plutus-chain-index` fails to start: `Not performing automatic migration due to data loss`

VladimirLogachev opened this issue · comments


  • plutus-chain-index fails to start: Not performing automatic migration due to data loss
[nix-shell:~/work/plutus-apps/plutus-pab/test-node]$ cabal exec -- plutus-chain-index --config testnet/chain-index-config.json start-index

Command line config:
AppConfig {acLogConfigPath = Nothing, acMinLogLevel = Nothing, acConfigPath = Just "testnet/chain-index-config.json", acCLIConfigOverrides = CLIConfigOverrides {ccSocketPath = Nothing, ccDbPath = Nothing, ccPort = Nothing, ccNetworkId = Nothing, ccAppendTransactionQueueSize = Nothing}, acCommand = StartChainIndex}

Logging config:
Representation {minSeverity = Info, rotation = Nothing, setupScribes = [ScribeDefinition {scKind = StdoutSK, scFormat = ScText, scName = "stdout", scPrivacy = ScPublic, scRotation = Nothing, scMinSev = Debug, scMaxSev = Emergency}], defaultScribes = [(StdoutSK,"stdout")], setupBackends = [KatipBK,AggregationBK,MonitoringBK,EKGViewBK], defaultBackends = [KatipBK,AggregationBK,EKGViewBK], hasEKG = Just (Endpoint ("localhost",12790)), hasGraylog = Nothing, hasPrometheus = Nothing, hasGUI = Nothing, traceForwardTo = Nothing, forwardDelay = Nothing, traceAcceptAt = Nothing, options = fromList []}

Chain Index config:
Socket: testnet/node.sock
Db: /tmp/chain-index.db
Port: 9083
Network Id: Testnet (NetworkMagic {unNetworkMagic = 1097911063})
Security Param: 2160
Store from: BlockNo 0
Append transaction queue size: 500
plutus-chain-index: user error (autoMigrate: Not performing automatic migration due to data loss)

Steps to reproduce the behavior

  1. Clone the repo
  2. Build executables
    nix-shell --option cores 1
    cabal build plutus-pab-examples plutus-chain-index
  3. Start the node
    cd plutus-pab/test-node
  4. Wait for the sync to complete (it keeps printing Chain extended, new tip: ...)
  5. Start the chain index
    cd plutus-pab/test-node
    cabal exec -- plutus-chain-index --config testnet/chain-index-config.json start-index

Actual Result

plutus-chain-index fails to start

Expected Result

plutus-chain-index starts successfully

Describe the approach you would take to fix this

No response

System info

OS: macOS (M1)
Version: 12.3.1 (21E258)
plutus-apps: v2022-04-06

This message means that beam can't migrate automatically and it should be done manually.

In #315 txs table was removed and utxo_out_refs was added. You might do drop table txs with sqlite3 chain-index.db and chain-index will start and will continue to work but utxo_out_refs table will be empty.

If you want to fill it, the better way would be to delete the database file and to index from the beginning.

@ak3n if I clone the repo (let's say the today's main branch) in a separate directory, will I also need to reset anything manually?

Oh, yes, it stores the DB in /tmp/chain-index.db.

Strange choice, I would say. Why not ./chain-index.db?
It turns out that the test-node instructions are valid only if the user hasn't ever run the chain index before. Like "implicit global state".

Anyway, thank you.

ezoic increase your site revenue