cardano-foundation / cardano-graphql

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

db-sync-node.Subscription:Error #579

Closed rezagazeri closed 3 years ago

rezagazeri commented 3 years ago

Hi, I set up cardano-graphql with docker- compose on testnet and had set everything accoording to its documentation and it was sync until 98% ,but when I wanted to run cardano- graphql again with below command Get below error

DOCKER_BUILDKIT=1 \
COMPOSE_DOCKER_CLI_BUILD=1 \ API_PORT=3101 \ HASURA_PORT=8091 \ OGMIOS_PORT=1338 \ POSTGRES_PORT=5433 \ Selection_066

METADATA_SERVER_URI="https://metadata.cardano-testnet.iohkdev.io" \ docker-compose -p testnet up -d --build &&\ docker-compose -p testnet logs

` error: cardano-db-sync-extended_1 | [db-sync-node.Subscription:Error:56] [2021-08-27 06:52:02.78 UTC] Identity Connection Attempt Exception, destination LocalAddress "/node-ipc/node.socket" exception: Network.Socket.connect: <socket: 21>: does not exist (No such file or directory)

`

CyberCyclone commented 3 years ago

What happens when you do: docker-compose down

And bring it back up again? It will take a while for cardano-node / ogmios to start up (~10 mins) before syncing again.

@rhyslbw am I right in that the documentation is missing NETWORK=testnet which is needed as one of the environmental params in the docker pull section? Building has it as 'export', although I'm not sure if docker-compose can use environments from system export.

rezagazeri commented 3 years ago

I use this command to down it: docker-compose -p testnet down

after a while, when I run it again with below commands:

DOCKER_BUILDKIT=1 \ COMPOSE_DOCKER_CLI_BUILD=1 API_PORT=3101 HASURA_PORT=8091 OGMIOS_PORT=1338 POSTGRES_PORT=5433 METADATA_SERVER_URI="https://metadata.cardano-testnet.iohkdev.io" docker-compose -p testnet up -d --build && docker-compose -p testnet logs

I will get the same error. That is strange that first time it was syncing , Epoch was 260 whereas last Epoch in Testnet is 151! and syncing should be stopped but it didn't.

rhyslbw commented 3 years ago

We are missing the NETWORK env in those docs, thanks @CyberCyclone. This should work, but first, drop the volumes:

docker-compose -p testnet down -v
DOCKER_BUILDKIT=1 \
COMPOSE_DOCKER_CLI_BUILD=1 \
NETWORK=testnet \
API_PORT=3101 \
HASURA_PORT=8091 \
OGMIOS_PORT=1338 \
POSTGRES_PORT=5433 \
METADATA_SERVER_URI="https://metadata.cardano-testnet.iohkdev.io" \
docker-compose -p testnet up -d --build &&\
docker-compose -p testnet logs -f

Building has it as 'export', although I'm not sure if docker-compose can use environments from system export.

I just verified this by removing the default variables in the compose file, and it populated via the exported variable.

rezagazeri commented 3 years ago

@rhyslbw @CyberCyclone Thanks I had done the commands and now it syncs to Testnet Network. But Graphql Server in this address "http://localhost:3101/graphql" doesn't work and doesn't connect.

Below command I also executed and again run the docker-compose up. but it doesn't connect. docker-compose -p testnet down .

my container are below: Selection_067 inputoutput/cardano-graphql:5.1.0-beta.1 container( testnet_cardano-graphql_1 container) is reset almost every 3 minutes.

rhyslbw commented 3 years ago

Try this release candidate branch @rezagazeri https://github.com/input-output-hk/cardano-graphql/tree/5-1-stable