cardano-foundation / cardano-graphql

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

Manual restart docker graphql required after syncing db #752

Open RdeWilde opened 2 years ago

RdeWilde commented 2 years ago

Summary

When booting my node, it'll start syncing (after installing the snapshot) which will take some time. This results in sockets not being available yet etc. Therefore cardano-graphql will exit.

To get the graphql up and running I have to manually restart it after sync has completed.

How can I make it restart automatically or something like that? I hoped it already did, but after waiting an hour I gave up 😅

Steps to reproduce the bug

Actual Result

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

Expected Result

{"data":{"cardanoDbMeta":{"initialized":true,"syncPercentage":100}}}

Environment

cardano-node:1.35.2-1
cardano-graphql:master-testnet
cardano-graphql-hasura:6.2.0
cardano-db-sync:13.0.3
ogmios:v5.5.3-testnet

Platform

Platform version

20.04

Runtime

Runtime version

20.10.17, build 100c701

rhyslbw commented 2 years ago

Thanks for the detailed report. I'll see what we can do to handle the initial startup more elegantly

lcgogo commented 2 years ago

@rhyslbw same issue, after restart graphql, the running node index.js does not listen 3100 port at all!

root@a66dfb3debcf:/app/packages/server/dist# netstat -ntulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.11:34583        0.0.0.0:*               LISTEN      -
udp        0      0 127.0.0.11:58658        0.0.0.0:*                           -
root@a66dfb3debcf:/app/packages/server/dist# ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 07:13 ?        00:00:01 node index.js
root         103       0  0 07:16 pts/0    00:00:00 /bin/bash
root         116     103  0 07:18 pts/0    00:00:00 ps -ef