cardano-foundation / cardano-graphql

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

cardano-graphql-8.2.1 unable to query initialization status #887

Closed zhy827827 closed 1 month ago

zhy827827 commented 2 months ago

Ask a question

I run Cardano-Graphql-8.2.1 for about a week.

curl   -X POST   -H "Content-Type: application/json"   -d '{"query": "{ cardanoDbMeta { initialized syncPercentage }}"}'   http://localhost:3200/graphql 

curl: (56) Recv failure: Connection reset by peer

docker logs -f cardano-graphql-821_server_1

{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initialized","time":"2024-08-21T07:05:12.976Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2024-08-21T07:05:12.976Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2024-08-21T07:05:13.114Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":50,"msg":"Remote schema is missing Block","time":"2024-08-21T07:08:37.095Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initializing. This can take a few minutes...","time":"2024-08-21T07:08:37.951Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"[Object: null prototype] {\n  slot: 132657813,\n  id: '20e97a5f574e4d829fafb83913745e2e99d094debe2dba953d21090836aff0c0'\n}","time":"2024-08-21T07:08:37.968Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initialized","time":"2024-08-21T07:08:37.968Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2024-08-21T07:08:37.968Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2024-08-21T07:08:38.113Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":50,"msg":"Remote schema is missing Block","time":"2024-08-21T07:12:02.094Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initializing. This can take a few minutes...","time":"2024-08-21T07:12:02.954Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"[Object: null prototype] {\n  slot: 132658008,\n  id: 'cd1b0f4ebc72aaa2ef802e0d2e16af9d4fa9710f640f23a6e9cddd818cd80d7b'\n}","time":"2024-08-21T07:12:02.974Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initialized","time":"2024-08-21T07:12:02.974Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2024-08-21T07:12:02.975Z","v":0}
{"name":"cardano-graphql","hostname":"6fde5729a4ca","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2024-08-21T07:12:03.106Z","v":0}

What's the problem? All logs have no error messages

docker info:

891f82424a33   cardanofoundation/cardano-graphql-background:8.2.1-mainnet   "node background.js"     About an hour ago   Up 2 minutes                                                                                                                                                                                                                                                                                cardano-graphql-821_background_1
2643b4b1f134   cardano-graphql-821_token-metadata-registry                  "/bin/sh -c 'sh /app…"   About an hour ago   Up About an hour             0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                                                                                                                                                                                                                      cardano-graphql-821_token-metadata-registry_1
b233ab8abf05   cardanofoundation/cardano-graphql-hasura:8.2.1               "docker-entrypoint.s…"   About an hour ago   Up About an hour             0.0.0.0:8090->8080/tcp, :::8090->8080/tcp                                                                                                                                                                                                                      cardano-graphql-821_hasura_1
bb4d14fc9925   ghcr.io/intersectmbo/cardano-node:9.1.0                      "cardano-node run --…"   About an hour ago   Up About an hour                                                                                                                                                                                                                                                                            cardano-graphql-821_cardano-node_1
e050b9ce3115   cardanosolutions/ogmios:v6.5.0                               "/bin/ogmios --host …"   About an hour ago   Up About an hour (healthy)   0.0.0.0:1337->1337/tcp, :::1337->1337/tcp                                                                                                                                                                                                                      cardano-graphql-821_ogmios_1
6fde5729a4ca   cardanofoundation/cardano-graphql-server:8.2.1-mainnet       "node index.js"          About an hour ago   Up About a minute            3200/tcp, 0.0.0.0:3200->3100/tcp, :::3200->3100/tcp                                                                                                                                                                                                            cardano-graphql-821_server_1
a16b32f0b7a7   postgres:14.10-alpine                                        "docker-entrypoint.s…"   About an hour ago   Up About an hour             0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                                                                                                                                                                                                      cardano-graphql-821_postgres_1
Kammerlo commented 2 months ago

Is ogmios and the node running without errors?

Since the server should log messages like this: {"name":"cardano-graphql","hostname":"0a163bd7f60c","pid":1,"level":30,"module":"Server","msg":"Sync Progress: cardano-db-sync: 0.29% | Asset: 0%","time":"2024-08-21T07:53:19.204Z","v":0} And this data is provided via ogmios.

Also the message Remote schema is missing Block indicates that somethings wrong with db-sync. Could you check it again please?

zhy827827 commented 2 months ago

I couldn't find the error log in ogmios

Ogmios's log content is

{"severity":"Info","timestamp":"2024-08-21T08:05:03.542951031Z","thread":"115","message":{"Health":{"tag":"HealthTick","status":{"startTime":"2024-08-21T06:05:18.18954097Z","lastKnownTip":{"slot":132661212,"id":"be580a9992c192be3abfba7d5030528fa33a68180b7e71e983fb3b3184e6c0a4","height":10732006},"lastTipUpdate":"2024-08-21T08:05:03.541608893Z","networkSynchronization":1.00000,"currentEra":"babbage","metrics":{"activeConnections":1,"runtimeStats":{"cpuTime":46480568233,"currentHeapSize":854,"gcCpuTime":39876305870,"maxHeapSize":859},"sessionDurations":{"max":0,"mean":204171.0588235294,"min":0},"totalConnections":35,"totalMessages":70,"totalUnrouted":0},"connectionStatus":"connected","currentEpoch":504,"slotInEpoch":296412,"version":"v6.5.0 (63a9e9d3)","network":"mainnet"}}},"version":"v6.5.0 (63a9e9d3)"}

Cardano-node caught up with the block

linconvidal commented 2 months ago

Hey @zhy827827! It appears that the db-sync container isn’t running, which is likely the cause of the issue.

zhy827827 commented 1 month ago

I synchronized using snapshots, and now it's working normally, sync assets. thankyou @linconvidal