cardano-foundation / cardano-graphql

GraphQL API for Cardano
Apache License 2.0
262 stars 104 forks source link

Cardano-db-sync and cardano-node-ogmios report errors when using snapshots for data synchronization #736

Closed apufvqsp closed 2 years ago

apufvqsp commented 2 years ago

Ask a question

When I use node snapshot data for node synchronization, I get the following error, how to solve this error?

[db-sync-node:Info:152760] [2022-07-13 02:40:04.26 UTC] Starting chainSyncClient
[db-sync-node:Info:152760] [2022-07-13 02:40:04.32 UTC] Cardano.Db tip is at slot 4492799, block 4490510
[db-sync-node:Info:152765] [2022-07-13 02:40:04.32 UTC] Running DB thread
[db-sync-node:Info:152765] [2022-07-13 02:40:04.33 UTC] Rolling back to slot 4492799, hash f8084c61b6a238acec985b59310b6ecec49c0ab8352249afd7268da5cff2a457
[db-sync-node:Info:152765] [2022-07-13 02:40:04.35 UTC] No blocks need to be deleted
[db-sync-node:Info:152765] [2022-07-13 02:40:04.35 UTC] Found in memory ledger snapshot at slot 4492799, hash f8084c61b6a238acec985b59310b6ecec49c0ab8352249afd7268da5cff2a457
[db-sync-node:Info:152765] [2022-07-13 02:40:08.30 UTC] File /var/lib/cdbsync/4492799-f8084c61b6-207.lstate exists

[db-sync-node:Error:152765] [2022-07-13 02:40:08.30 UTC] runDBThread: DbInsertException "EpochParam" (SqlError {sqlState = "42703", sqlExecStatus = FatalError, sqlErrorMsg = "column \"entropy\" of relation \"epoch_param\" does not exist", sqlErrorDetail = "", sqlErrorHint = ""})
[db-sync-node:Error:152768] [2022-07-13 02:40:08.30 UTC] recvMsgRollForward: AsyncCancelled
[db-sync-node:Error:152760] [2022-07-13 02:40:08.30 UTC] ChainSyncWithBlocksPtcl: DbInsertException "EpochParam" (SqlError {sqlState = "42703", sqlExecStatus = FatalError, sqlErrorMsg = "column \"entropy\" of relation \"epoch_param\" does not exist", sqlErrorDetail = "", sqlErrorHint = ""})

[db-sync-node.Mux:Info:152757] [2022-07-13 02:40:08.30 UTC] Bearer on ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "/ipc/node.socket"} event: State: Dead
[db-sync-node.Mux:Notice:152757] [2022-07-13 02:40:08.30 UTC] Bearer on ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "/ipc/node.socket"} event: Miniprotocol MiniProtocolNum 5 InitiatorDir terminated with exception DbInsertException "EpochParam" (SqlError {sqlState = "42703", sqlExecStatus = FatalError, sqlErrorMsg = "column \"entropy\" of relation \"epoch_param\" does not exist", sqlErrorDetail = "", sqlErrorHint = ""})

[db-sync-node.Subscription:Error:152756] [2022-07-13 02:40:08.30 UTC] Identity Application Exception: LocalAddress "/node-ipc/node.socket" DbInsertException "EpochParam" (SqlError {sqlState = "42703", sqlExecStatus = FatalError, sqlErrorMsg = "column \"entropy\" of relation \"epoch_param\" does not exist", sqlErrorDetail = "", sqlErrorHint = ""})
[db-sync-node.ErrorPolicy:Error:6] [2022-07-13 02:40:08.30 UTC] IP LocalAddress "/node-ipc/node.socket" ErrorPolicyUnhandledApplicationException (DbInsertException "EpochParam" (SqlError {sqlState = "42703", sqlExecStatus = FatalError, sqlErrorMsg = "column \"entropy\" of relation \"epoch_param\" does not exist", sqlErrorDetail = "", sqlErrorHint = ""}))

[db-sync-node.Subscription:Notice:47] [2022-07-13 02:40:09.80 UTC] Identity Restarting Subscription after 5.57262274s desired valency 1 current valency 0
[db-sync-node.Subscription:Notice:47] [2022-07-13 02:40:14.24 UTC] Identity Starting Subscription Worker, valency 1
[db-sync-node.Subscription:Notice:152781] [2022-07-13 02:40:14.24 UTC] Identity Connection Attempt Start, destination LocalAddress "/node-ipc/node.socket"
[db-sync-node.Subscription:Notice:152781] [2022-07-13 02:40:14.24 UTC] Identity Connection Attempt End, destination LocalAddress "/node-ipc/node.socket" outcome: ConnectSuccessLast
[db-sync-node.Handshake:Info:152781] [2022-07-13 02:40:14.24 UTC] WithMuxBearer (ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "/ipc/node.socket"}) Send (ClientAgency TokPropose,MsgProposeVersions (fromList [(NodeToClientV_1,TInt 764824073),(NodeToClientV_2,TInt 764824073),(NodeToClientV_3,TInt 764824073),(NodeToClientV_4,TInt 764824073),(NodeToClientV_5,TInt 764824073),(NodeToClientV_6,TInt 764824073),(NodeToClientV_7,TInt 764824073),(NodeToClientV_8,TInt 764824073),(NodeToClientV_9,TInt 764824073),(NodeToClientV_10,TInt 764824073)]))
[db-sync-node.Handshake:Info:152781] [2022-07-13 02:40:14.24 UTC] WithMuxBearer (ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "/ipc/node.socket"}) Recv (ServerAgency TokConfirm,MsgAcceptVersion NodeToClientV_10 (TInt 764824073))
[db-sync-node.Mux:Info:152781] [2022-07-13 02:40:14.24 UTC] Bearer on ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "/ipc/node.socket"} event: Handshake Client end, duration 0.000277286s
[db-sync-node.Mux:Info:152782] [2022-07-13 02:40:14.24 UTC] Bearer on ConnectionId {localAddress = LocalAddress "", remoteAddress = LocalAddress "/ipc/node.socket"} event: State: Mature
[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:24.31 UTC] Chain extended, new tip: 7e837a057ca6ae19079f438679592a1293e04769351d345a2bf2de268c1c2865 at slot 64263265
[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:25.05 UTC] Chain extended, new tip: 9c1e3f525f06ebb019cef33fcc0b869b82de02b4a1ec15cf8a0c96e9d07d5396 at slot 64263503
[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:26.36 UTC] Chain extended, new tip: c35be2aebe502d3f1131ca8eea52c2b898985973a0c27a9e8e914c13f0c410f9 at slot 64263932
[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:27.67 UTC] Chain extended, new tip: 08bc98b2705c48a2e1d82fa4f66ac5d62cb6aecaa57183c179723d0e20d3e1c9 at slot 64264301
[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:28.96 UTC] Chain extended, new tip: 8c6376ccf44853751d01d5fd6840defc15910b161a0689667827d0b41af53347 at slot 64264642

[f1a4768c:cardano.node.LocalErrorPolicy:Error:66] [2022-07-13 02:39:29.18 UTC] IP LocalAddress "/ipc/node.socket@5735" ErrorPolicyUnhandledApplicationException (MuxError MuxBearerClosed "<socket: 24> closed when reading data, waiting on next header True")

[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:30.24 UTC] Chain extended, new tip: dfd89c4b8c92c651c25f52f6695f47bd622e00a2b9dece445c6bd8ebc4dc578b at slot 64264955
[f1a4768c:cardano.node.ChainDB:Notice:35] [2022-07-13 02:39:31.56 UTC] Chain extended, new tip: 0364ad05558c9f61b91bfb1bafc86e282fa80b685972ce5ca2f0b522ab6079df at slot 64265311
erikd commented 2 years ago
DbInsertException "EpochParam" (SqlError {sqlState = "42703", sqlExecStatus = FatalError,
    sqlErrorMsg = "column \"entropy\" of relation \"epoch_param\" does not exist", sqlErrorDetail = "",
    sqlErrorHint = ""})

This suggests that there is a database schema mismatch. Have you just upgraded? If you upgrade from one major version (eg 12.0.x) to another (eg 13.0.x) you will need to drop the database and resync (or use a snapshot).

apufvqsp commented 2 years ago

thank you for your reply

I didn't notice that the schema's version is not the same

I just looked at the update date of the snapshot, the schema-12 snapshot is too far from the last block height

Since schema-12 and schema-13 snapshots are not compatible, why not provide the most recent snapshot of schema-12?

erikd commented 2 years ago

There is a hard fork due towards the end of this month. Version 12 will not be compatible with that hardfork, but version 13 is.

apufvqsp commented 2 years ago

@erikd OK, thanks Does cardano graphql have plans to upgrade to a new version? or how can it support snapshot block data of version 13 v6.2.0 is not compatible with snapshots of version 13 by default

erikd commented 2 years ago

I would be incredibly surprised if an update/upgrade was not planned.

apufvqsp commented 2 years ago

Ok, looking forward to the update, thank you all