cardano-graphql
cardano-graphql copied to clipboard
graphql database internal server error
Summary
I have been using cardano-graphql 8.0.0. I updated to cardano-graphql 8.1.0 for Chang Hardfork.
Then only graphql query became frequently unstable.
Do you know what is causing this?
Steps to reproduce the bug
Changes are made to docker-compose.yml. See the attached docker-compose.yml.txt. docker-compose.yml.txt
- Removed token-metadata-registry
- Mounting each volume on local /data/cardano/docker-volume.
cardano-db-sync was restored using
Environment=RESTORE_SNAPHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.2/db-sync-snapshot-schema-13.2-block-10548081-x86_64.tgz
Actual Result
It takes more than 5 minutes to get this response
curl -X POST -H "Content-Type: application/json" -d '{"query": "{ cardanoDbMeta { initialized syncPercentage }}"}' http://localhost:3100/graphql
{
"errors": [
{
"message": "database query error: {
\"response\": {
\"errors\": [
{
\"extensions\": {
\"code\": \"unexpected\",
\"path\": \"$\"
},
\"message\": \"database query error\"
}
],
\"status\": 200
},
\"request\": {
\"query\": \"query {
epochs (limit: 1, order_by: { number: desc }) {
number
}
cardano {
tip {
epoch {
number
}
slotNo
forgedAt
}
}
}\"
}
}",
"locations": [
{
"line": 1,
"column": 3
}
],
"path": [
"cardanoDbMeta"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"response": {
"errors": [
{
"extensions": {
"code": "unexpected",
"path": "$"
},
"message": "database query error"
}
],
"status": 200
},
"request": {
"query": "query {
epochs (limit: 1, order_by: { number: desc }) {
number
}
cardano {
tip {
epoch {
number
}
slotNo
forgedAt
}
}
}\n "
},
"stacktrace": [
"Error: database query error: {
\"response\": {
\"errors\": [
{
\"extensions\": {
\"code\": \"unexpected\",
\"path\": \"$\"
},
\"message\": \"database query error\"
}
],
\"status\": 200
},
\"request\": {
\"query\": \"query {
epochs (limit: 1, order_by: { number: desc }) {
number
}
cardano {
tip {
epoch {
number
}
slotNo
forgedAt
}
}
}\"
}
}",
" at GraphQLClient.<anonymous> (/app/node_modules/graphql-request/dist/index.js:170:35)",
" at step (/app/node_modules/graphql-request/dist/index.js:63:23)",
" at Object.next (/app/node_modules/graphql-request/dist/index.js:44:53)",
" at fulfilled (/app/node_modules/graphql-request/dist/index.js:35:58)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
]
}
}
}
],
"data": null
}
Expected Result
Sometimes this request is success.
curl -X POST -H "Content-Type: application/json" -d '{"query": "{ cardanoDbMeta { initialized syncPercentage }}"}' http://localhost:3100/graphql
{"data":{"cardanoDbMeta":{"initialized":true,"syncPercentage":100}}}
Environment
Amazon Linux 2/m6i.4xlarge EBS / : 300GB /data: 2.25TB
Platform
- [ ] Linux (Ubuntu)
- [X] Linux (Other)
- [ ] macOS
- [ ] Windows
Platform version
Amazon Linux 2
Runtime
- [ ] Node.js
- [X] Docker
Runtime version
docker 20.10.7