cardano-foundation / cardano-graphql

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

When he was running for a period of time, about 1 day, last time was several days, he made a mistake #568

Closed wodingdong closed 3 years ago

wodingdong commented 3 years ago

Environment

Alternatively, what release or Git revision are you using:

Platform

Platform version:

Runtime

Runtime version:

node -v
v14.17.2
docker version
root@ecs-8c6a:~# docker version
Client: Docker Engine - Community
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 11:56:40 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:54:48 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Steps to reproduce the bug

When he was running for a period of time, about 1 day, last time was several days, he made a mistake。 At first, it seemed to be running correctly I type: git clone --single-branch --branch 5.0.0 --recurse-submodules https://github.com/input-output-hk/cardano-graphql.git && cd cardano-graphql and: DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose up -d --build && docker-compose logs -f it seem ok, and when I type: curl -X POST -H "Content-Type: application/json" -d '{"query": "{cardano { tip { number slotNo epoch { number } } } }"}' http://localhost:3100/graphql it return ok and i cam open http://localhost:3100/graphql to execute command But now, it doesn't work,when it execute aboe command it return :

root@ecs-8c6a:~# curl -X POST -H "Content-Type: application/json" -d '{"query": "{cardano { tip { number slotNo epoch { number } } } }"}' http://localhost:3100/graphql curl: (56) Recv failure: Connection reset by peer

The last time this happened, I deleted all the docker containers and mirrors and started again. Now this happens again. What is the reason?

What is the expected behavior?

wodingdong commented 3 years ago

And now, I remove docker images,and try it from begin, it doesn't work

CyberCyclone commented 3 years ago

Have you waited for everything to be fully synced? Version 5.0.0 you can't query until it's fully synced with the network, which takes typically 18 hours.

wodingdong commented 3 years ago

The first time I successfully installed and used it was last week, about August 4th, and it was still working normally until yesterday.

wodingdong commented 3 years ago

Have you waited for everything to be fully synced? Version 5.0.0 you can't query until it's fully synced with the network, which takes typically 18 hours.

The first time I successfully installed and used it was last week, about August 4th, and it was still working normally until yesterday.

CyberCyclone commented 3 years ago

Can you please send through your error logs.

jun0tpyrc commented 3 years ago

Can you please send through your error logs.

hi please see https://github.com/input-output-hk/cardano-graphql/issues/573#issue-970902583

I think connection reset curl -X POST -H "Content-Type: application/json" -d '{"query": "{cardano { tip { number slotNo epoch { number } } } }"}' http://localhost:3100/graphql curl: (56) Recv failure: Connection reset by peer

is because graphql fail to init , and it never listen at port

wodingdong commented 3 years ago

Can you please send through your error logs.

hi please see #573 (comment)

I think connection reset curl -X POST -H "Content-Type: application/json" -d '{"query": "{cardano { tip { number slotNo epoch { number } } } }"}' http://localhost:3100/graphql curl: (56) Recv failure: Connection reset by peer

is because graphql fail to init , and it never listen at port

Sorry, It work well a week, and it occur error today, error: {"type":"http-log","timestamp":"2021-08-23T06:45:00.196+0000","level":"info","detail":{"operation":{"query_executi on_time":3.639105e-3,"user_vars":{"x-hasura-role":"cardano-graphql"},"request_id":"aadbeb73-3415-4c07-ab0e-9a81d18b3198","response_size":145,"re quest_read_time":4.136e-6},"http_info":{"status":200,"http_version":"HTTP/1.1","url":"/v1/graphql","ip":"172.20.0.5","method":"POST","content_en coding":"gzip"}}} hasura_1 | {"type":"http-log","timestamp":"2021-08-23T06:45:00.196+0000","level":"info","detail":{"operation":{"query_executi on_time":3.073699e-3,"user_vars":{"x-hasura-role":"cardano-graphql"},"request_id":"a543dc33-d4c8-450b-87e7-29b0c0768131","response_size":144,"re quest_read_time":4.125e-6},"http_info":{"status":200,"http_version":"HTTP/1.1","url":"/v1/graphql","ip":"172.20.0.5","method":"POST","content_en coding":"gzip"}}} postgres_1 | 2021-08-22 22:24:45.229 UTC [20022] STATEMENT: WITH "Asset__mutation_result_alias" AS (UPDATE "public"."Asset" SE T "decimals" = NULL,"description" = ($1)::text,"logo" = ($2)::text,"metadataHash" = ($3)::bpchar,"name" = ($4)::text,"ticker" = ($5)::text,"url" = ($6)::text WHERE (('true') AND ((((("public"."Asset"."assetId") = (($7)::bytea)) AND ('true')) AND ('true')) AND ('true'))) RETURNING * , CA SE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ), "Asset__all_columns_alias" AS (SELECT " assetId" , "assetName" , "decimals" , "description" , "fingerprint" , "firstAppearedInSlot" , "logo" , "metadataHash" , "name" , "policyId" , "t icker" , "url" FROM "Asset__mutation_result_alias" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM "Asset__all_column s_alias" ), 'returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM (SELECT " _0_root.base"."assetId" AS "assetId" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "Asset__all_columns_alias" WHERE ('true') ) AS "_0_root.base" ) AS "_2_root" ) ) postgres_1 | 2021-08-22 22:34:25.275 UTC [20262] ERROR: value too long for type character varying(65536) postgres_1 | 2021-08-22 22:34:25.275 UTC [20262] STATEMENT: WITH "Asset__mutation_result_alias" AS (UPDATE "public"."Asset" SE T "decimals" = ($1)::integer,"description" = ($2)::text,"logo" = ($3)::text,"metadataHash" = ($4)::bpchar,"name" = ($5)::text,"ticker" = ($6)::t ext,"url" = ($7)::text WHERE (('true') AND ((((("public"."Asset"."assetId") = (($8)::bytea)) AND ('true')) AND ('true')) AND ('true'))) RETURNI NG * , CASE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ), "Asset__all_columns_alias" AS ( SELECT "assetId" , "assetName" , "decimals" , "description" , "fingerprint" , "firstAppearedInSlot" , "logo" , "metadataHash" , "name" , "polic yId" , "ticker" , "url" FROM "Asset__mutation_result_alias" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM "Asset__a ll_columns_alias" ), 'returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM ( SELECT "_0_root.base"."assetId" AS "assetId" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "Asset__all_columns_alias" WHERE ('tru e') ) AS "_0_root.base" ) AS "_2_root" ) ) postgres_1 | 2021-08-22 22:40:01.091 UTC [20262] ERROR: value too long for type character varying(65536) postgres_1 | 2021-08-22 22:40:01.091 UTC [20262] STATEMENT: WITH "Asset__mutation_result_alias" AS (UPDATE "public"."Asset" SE T "decimals" = ($1)::integer,"description" = ($2)::text,"logo" = ($3)::text,"metadataHash" = ($4)::bpchar,"name" = ($5)::text,"ticker" = ($6)::t ext,"url" = ($7)::text WHERE (('true') AND ((((("public"."Asset"."assetId") = (($8)::bytea)) AND ('true')) AND ('true')) AND ('true'))) RETURNI NG * , CASE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ), "Asset__all_columns_alias" AS ( SELECT "assetId" , "assetName" , "decimals" , "description" , "fingerprint" , "firstAppearedInSlot" , "logo" , "metadataHash" , "name" , "polic yId" , "ticker" , "url" FROM "Asset__mutation_result_alias" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM "Asset__a ll_columns_alias" ), 'returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM ( SELECT "_0_root.base"."assetId" AS "assetId" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "Asset__all_columns_alias" WHERE ('tru e') ) AS "_0_root.base" ) AS "_2_root" ) ) postgres_1 | 2021-08-22 23:12:18.216 UTC [21082] ERROR: value too long for type character varying(65536) postgres_1 | 2021-08-22 23:12:18.216 UTC [21082] STATEMENT: WITH "Asset__mutation_result_alias" AS (UPDATE "public"."Asset" SE T "decimals" = ($1)::integer,"description" = ($2)::text,"logo" = ($3)::text,"metadataHash" = ($4)::bpchar,"name" = ($5)::text,"ticker" = ($6)::t ext,"url" = ($7)::text WHERE (('true') AND ((((("public"."Asset"."assetId") = (($8)::bytea)) AND ('true')) AND ('true')) AND ('true'))) RETURNI NG * , CASE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ), "Asset__all_columns_alias" AS ( SELECT "assetId" , "assetName" , "decimals" , "description" , "fingerprint" , "firstAppearedInSlot" , "logo" , "metadataHash" , "name" , "polic yId" , "ticker" , "url" FROM "Asset__mutation_result_alias" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM "Asset__a ll_columns_alias" ), 'returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM ( SELECT "_0_root.base"."assetId" AS "assetId" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "Asset__all_columns_alias" WHERE ('tru e') ) AS "_0_root.base" ) AS "_2_root" ) ) postgres_1 | 2021-08-22 23:16:07.338 UTC [21082] ERROR: value too long for type character varying(65536) postgres_1 | 2021-08-22 23:16:07.338 UTC [21082] STATEMENT: WITH "Asset__mutation_result_alias" AS (UPDATE "public"."Asset" SE T "decimals" = ($1)::integer,"description" = ($2)::text,"logo" = ($3)::text,"metadataHash" = ($4)::bpchar,"name" = ($5)::text,"ticker" = ($6)::t ext,"url" = ($7)::text WHERE (('true') AND ((((("public"."Asset"."assetId") = (($8)::bytea)) AND ('true')) AND ('true')) AND ('true'))) RETURNI NG * , CASE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ), "Asset__all_columns_alias" AS ( SELECT "assetId" , "assetName" , "decimals" , "description" , "fingerprint" , "firstAppearedInSlot" , "logo" , "metadataHash" , "name" , "polic yId" , "ticker" , "url" FROM "Asset__mutation_result_alias" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM "Asset__a ll_columns_alias" ), 'returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM ( SELECT "_0_root.base"."assetId" AS "assetId" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "Asset__all_columns_alias" WHERE ('tru e') ) AS "_0_root.base" ) AS "_2_root" ) ) postgres_1 | 2021-08-22 23:20:00.160 UTC [21227] ERROR: value too long for type character varying(65536) postgres_1 | 2021-08-22 23:20:00.160 UTC [21227] STATEMENT: WITH "Asset__mutation_result_alias" AS (UPDATE "public"."Asset" SE T "decimals" = ($1)::integer,"description" = ($2)::text,"logo" = ($3)::text,"metadataHash" = ($4)::bpchar,"name" = ($5)::text,"ticker" = ($6)::t ext,"url" = NULL WHERE (('true') AND ((((("public"."Asset"."assetId") = (($7)::bytea)) AND ('true')) AND ('true')) AND ('true'))) RETURNING * , CASE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ), "Asset__all_columns_alias" AS (SELECT "assetId" , "assetName" , "decimals" , "description" , "fingerprint" , "firstAppearedInSlot" , "logo" , "metadataHash" , "name" , "policyId" , "ticker" , "url" FROM "Asset__mutation_result_alias" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM "Asset__all_col umns_alias" ), 'returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM (SELECT "_0_root.base"."assetId" AS "assetId" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "Asset__all_columns_alias" WHERE ('true') ) AS "_0_root.base" ) AS "_2_root" ) ) postgres_1 | 2021-08-22 23:21:53.243 UTC [21292] ERROR: value too long for type character varying(65536) cardano-node-ogmios_1 | {"severity":"Info","timestamp":"2021-08-22T00:16:08.765450945Z","thread":"90","message":{"tag":"OgmiosHealth","hea lthCheck":{"tag":"HealthTick","status":{"startTime":"2021-08-11T08:53:56.498599464Z","lastKnownTip":{"headerHash":"fd99a9eff72173029b8177d90c843 24252fa97fb5ffa1ce60d89a308f4e43c92","slotNo":38025077,"blockNo":6143133},"lastTipUpdate":"2021-08-22T00:16:08.765239691Z","networkSynchronizati on":0.99999,"currentEra":"Mary","metrics":{"activeConnections":3,"totalConnections":6,"totalUnrouted":0,"sessionDurations":{"mean":2441746,"min" :0,"max":0},"runtimeStats":{"currentHeapSize":4911,"gcCpuTime":1249661363295,"cpuTime":4534142539635,"maxHeapSize":22223},"totalMessages":102139 41}}}},"version":"v4.0.0-??-????????"}

wodingdong commented 3 years ago

I delete all images and remove it now, I try to run 5.1.0-beta and hope it fix this problem.

wodingdong commented 3 years ago

Really bad,I try to use 5.1.0-beta1, I delete all docker images and container, use comman:

git clone --single-branch --branch 5.1.0-beta.1 --recurse-submodules https://github.com/input-output-hk/cardano-graphql.git && cd cardano-graphql

and

DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose up -d --build && docker-compose logs -f

It can't work when it pass 18 hours: it log :

cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:37.77 UTC] Chain extended, new tip: 111025200a9cf8692d4e91af866d701e70bec2c5d96eec3e78d88ec182c4c4b9 at slot 36824945 cardano-db-sync-extended_1 | [db-sync-node:Info:69] [2021-08-24 02:00:38.79 UTC] Offline pool metadata fetch: 43 results, 17 fetch errors cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:39.03 UTC] Chain extended, new tip: c4e1cbacb8684fff1c9db6b48605082516511b8760ca2a5d0ac4571ab316574e at slot 36825218 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:40.32 UTC] Chain extended, new tip: 7acb1d5e1797058e5b9e65a6c4cdb76b6e196978d94f8edddda295225bfd9581 at slot 36825488 postgres_1 | 2021-08-24 02:00:40.544 UTC [46] LOG: checkpoints are occurring too frequently (23 seconds apart) postgres_1 | 2021-08-24 02:00:40.544 UTC [46] HINT: Consider increasing the configuration parameter "max_wal_size". cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:41.59 UTC] Chain extended, new tip: 5007d79da1b19942df72031dc4610d4a92d4ec8415cd63ab5fc463142c819611 at slot 36825669 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:43.00 UTC] Chain extended, new tip: f6e2e2d46ee17483a87fd789b19db89a4afe3d90cce983ac83b749bf7fc698ac at slot 36825781 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:44.72 UTC] Chain extended, new tip: 9570bad1efd39fa47f9069bd3861ef89389572840590e4c613ba476cc284955c at slot 36826115 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:45.98 UTC] Chain extended, new tip: 6e2a86a503541d3a6eb72f771e8c8922e84618e46594c44990a41f40a146a551 at slot 36826508 cardano-node-ogmios_1 | {"severity":"Info","timestamp":"2021-08-24T02:00:46.927336461Z","thread":"17","message":{"tag":"OgmiosHealth","healthCheck":{"tag":"HealthTick","status":{"startTime":"2021-08-23T09:33:28.031375477Z","lastKnownTip":{"slot":36826651,"hash":"8428e7171255641288a372cd9f3064c7dc4825c4de14218235219278f4a00560","blockNo":6083749},"lastTipUpdate":"2021-08-24T02:00:46.826973283Z","networkSynchronization":0.98885,"currentEra":"Mary","metrics":{"activeConnections":0,"totalConnections":0,"totalUnrouted":0,"sessionDurations":{"mean":0,"min":0,"max":0},"runtimeStats":{"currentHeapSize":856,"gcCpuTime":65502492132,"cpuTime":1108030719237,"maxHeapSize":986},"totalMessages":0}}}},"version":"v4.0.0"} cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:47.27 UTC] Chain extended, new tip: 02c48709b86a752280305955a775f4aa217df5d3a29cea3723f9f34adca95ed6 at slot 36826803 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:48.66 UTC] Chain extended, new tip: 02ee8e274f7a50a6400502e2202fc26e6224ca3d155abeead7635f1b64001838 at slot 36827034 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:50.02 UTC] Chain extended, new tip: 17af35d89de3d915c482865f4b3e9a0b9c10c9982b489a360251f2ac7e64abc7 at slot 36827361 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:51.28 UTC] Chain extended, new tip: 77a6cd7227fb981e90b9818e64edc2170e6464a92339390ea982c64fa8e35233 at slot 36827662 cardano-node-ogmios_1 | [c0a7f05d:cardano.node.ChainDB:Notice:35] [2021-08-24 02:00:52.70 UTC] Chain extended, new tip: da0c0834b8ec2cf9da72f466634068656a13654965ec18abf4a88e2bff5c5f0b at slot 36827766

and i type :

curl -X POST -H "Content-Type: application/json" -d '{"query": "{cardano { tip { number slotNo epoch { number } } } }"}' http://localhost:3100/graphql

same error return as 5.0.0,

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

This question is very important to me. Please reply when you see how I can solve it. Thank you very much

wodingdong commented 3 years ago

cardano-db-sync-extended_1 | [db-sync-node.Subscription:Error:62] [2021-08-24 03:34:02.41 UTC] Identity Connection Attempt Exception, destination LocalAddress "/node-ipc/node.socket" exception: Network.Socket.connect: <socket: 22>: does not exist (No such file or directory) cardano-db-sync-extended_1 | [db-sync-node.ErrorPolicy:Warning:6] [2021-08-24 03:34:02.41 UTC] IP LocalAddress "/node-ipc/node.socket" ErrorPolicySuspendPeer (Just (ConnectionExceptionTrace Network.Socket.connect: <socket: 22>: does not exist (No such file or directory))) 20s 20s cardano-db-sync-extended_1 | [db-sync-node.Subscription:Warning:59] [2021-08-24 03:34:02.43 UTC] Identity Failed to start all required subscriptions cardano-db-sync-extended_1 | [db-sync-node.Subscription:Notice:59] [2021-08-24 03:34:03.43 UTC] Identity Restarting Subscription after 1.0256796s desired valency 1 current valency 0 cardano-node-ogmios_1 | {"severity":"Warning","timestamp":"2021-08-24T03:34:05.524959153Z","thread":"7","message":{"tag":"OgmiosHealth","healthCheck":{"tag":"HealthFailedToConnect","socket":"/ipc/node.socket","retryingIn":5}},"version":"v4.0.0"} postgres_1 | 2021-08-24 03:34:10.498 UTC [20] LOG: checkpoints are occurring too frequently (21 seconds apart) postgres_1 | 2021-08-24 03:34:10.498 UTC [20] HINT: Consider increasing the configuration parameter "max_wal_size". cardano-node-ogmios_1 | {"severity":"Warning","timestamp":"2021-08-24T03:34:10.529935256Z","thread":"7","message":{"tag":"OgmiosHealth","healthCheck":{"tag":"HealthFailedToConnect","socket":"/ipc/node.socket","retryingIn":5}},"version":"v4.0.0"} cardano-db-sync-extended_1 | [db-sync-node.Subscription:Notice:59] [2021-08-24 03:34:12.42 UTC] Identity Starting Subscription Worker, valency 1 cardano-db-sync-extended_1 | [db-sync-node.Subscription:Notice:64] [2021-08-24 03:34:12.42 UTC] Identity Connection Attempt Start, destination LocalAddress "/node-ipc/node.socket" cardano-db-sync-extended_1 | [db-sync-node.Subscription:Error:64] [2021-08-24 03:34:12.42 UTC] Identity Connection Attempt Exception, destination LocalAddress "/node-ipc/node.socket" exception: Network.Socket.connect: <socket: 22>: does not exist (No such file or directory) cardano-db-sync-extended_1 | [db-sync-node.ErrorPolicy:Warning:6] [2021-08-24 03:34:12.42 UTC] IP LocalAddress "/node-ipc/node.socket" ErrorPolicySuspendPeer (Just (ConnectionExceptionTrace Network.Socket.connect: <socket: 22>: does not exist (No such file or directory))) 20s 20s

wodingdong commented 3 years ago

5.1.0 work well