cardano-graphql icon indicating copy to clipboard operation
cardano-graphql copied to clipboard

Run cardano-graphql without docker

Open alexqrid opened this issue 4 years ago • 11 comments

Can I get a well-explained manual to run cardan-graphql without docker? This manual wasn't so helpful. I wasn't able to successfully run the api using the manual on ubuntu 20.04 LTS VPS.
I have fully synced running cardano-node, cardano-db-sync-extended and want to run cardano-graphql that will retrieve data from my existing database.

Build without docker

Steps I have tried after cloning cardano-graphql repo with submodules :

  1. Compiled qraphql-engine, ran it on port 8091.
  2. Defined environment variables as below:
export PGPASSFILE=/home/cardano/cardano-db-sync/config/pgpass
export CARDANO_NODE_SOCKET_PATH=/home/cardano/.newcardano/state-node-mainnet/sock
export HASURA_GRAPHQL_SERVER_PORT=8090
export HASURA_GRAPHQL_SERVER_HOST=127.0.0.1
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export GENESIS_FILE_BYRON=/home/cardano/cardano-graphql/config/network/mainnet/genesis/byron.json
export GENESIS_FILE_SHELLEY=/home/cardano/cardano-graphql/config/network/mainnet/genesis/shelley.json
export POSTGRES_DB=cexplorer
export POSTGRES_HOST=localhost
export POSTGRES_PASSWORD=password
export POSTGRES_PORT=5432
export POSTGRES_USER=cardano
export HASURA_GRAPHQL_ENABLE_TELEMETRY=false
export HASURA_CLI_PATH=/usr/local/bin/hasura 
export ALLOW_INTROSPECTION=false
export JQ_PATH=/usr/bin/jq
export HASURA_GRAPHQL_DATABASE_URL="postgres://cardano:[email protected]:5432/cexplorer"
export HASURA_GRAPHQL_ENABLED_LOG_TYPES="startup, http-log, webhook-log, websocket-log, query-log" 
  1. Ran the commands to build the project with yarn:
~/cardano-graphql$ yarn --frozen-lockfile --non-interactive &&   yarn build
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 15.12s.
yarn run v1.22.5
$ yarn workspaces run build

> @cardano-graphql/api-cardano-db-hasura
$ yarn codegen && tsc -b ./src
$ graphql-codegen
  ✔ Parse configuration
  ✔ Generate outputs

> @cardano-graphql/cli
$ tsc -b ./src && shx cp ../../docker-compose.yml dist/Docker/

> @cardano-graphql/client-ts
$ graphql-codegen -c codegen.yml && tsc
  ✔ Parse configuration
  ✔ Generate outputs

> @cardano-graphql/server
$ tsc -b ./src

> @cardano-graphql/util-dev
$ tsc -b ./src

> @cardano-graphql/util
$ tsc -b ./src
Done in 41.66s.
~/cardano-graphql$ node ./packages/server/dist/index.js
{"name":"cardano-graphql","hostname":"cardano-fork","pid":27166,"level":30,"msg":"Initializing Hasura { module: 'HasuraClient' }","time":"2021-02-11T09:51:16.417Z","v":0}
{"name":"cardano-graphql","hostname":"cardano-fork","pid":27166,"level":30,"msg":"GraphQL HTTP server at http://0.0.0.0:3100/ started","time":"2021-02-11T09:51:16.829Z","v":0}
{"name":"cardano-graphql","hostname":"cardano-fork","pid":27166,"level":50,"msg":"Command failed: /usr/local/bin/hasura --skip-update-check --project /home/cardano/cardano-graphql/packages/api-cardano-db-hasura/hasura/project --endpoint http://localhost:8090 metadata apply\ntime=\"2021-02-11T09:55:21Z\" level=fatal msg=\"failed to apply metadata: cannot apply metadata on the database: cannot build actions from metadata: cannot install plugin cli-ext: install failed: could not create staging dir \\\"/tmp/plugins-downloads/cli-ext\\\": mkdir /tmp/plugins-downloads/cli-ext: permission denied\"\n","time":"2021-02-11T09:55:21.651Z","v":0}

The API responded with error to my request and then finished

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

{
  "errors": [
    {
      "message": "GraphQL error: field \"epochs\" not found in type: 'query_root'",
      "locations": [
        {
          "line": 1,
          "column": 3
        }
      ],
      "path": [
        "cardanoDbMeta"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "graphQLErrors": [
            {
              "extensions": {
                "path": "$.selectionSet.epochs",
                "code": "validation-failed"
              },
              "message": "field \"epochs\" not found in type: 'query_root'"
            }
          ],
          "networkError": null,
          "message": "GraphQL error: field \"epochs\" not found in type: 'query_root'",
          "stacktrace": [
            "Error: GraphQL error: field \"epochs\" not found in type: 'query_root'",
            "    at new ApolloError (/home/cardano/cardano-graphql/node_modules/apollo-client/bundle.umd.js:92:26)",
            "    at /home/cardano/cardano-graphql/node_modules/apollo-client/bundle.umd.js:1588:34",
            "    at /home/cardano/cardano-graphql/node_modules/apollo-client/bundle.umd.js:2008:15",
            "    at Set.forEach (<anonymous>)",
            "    at /home/cardano/cardano-graphql/node_modules/apollo-client/bundle.umd.js:2006:26",
            "    at Map.forEach (<anonymous>)",
            "    at QueryManager.broadcastQueries (/home/cardano/cardano-graphql/node_modules/apollo-client/bundle.umd.js:2004:20)",
            "    at /home/cardano/cardano-graphql/node_modules/apollo-client/bundle.umd.js:2131:19",
            "    at Object.next (/home/cardano/cardano-graphql/node_modules/zen-observable/lib/Observable.js:322:23)",
            "    at notifySubscription (/home/cardano/cardano-graphql/node_modules/zen-observable/lib/Observable.js:135:18)"
          ]
        }
      }
    }
  ],
  "data": null
}

Then I tried to run all this services using docker and while docker images were building I notice that there is another command I haven't executed the command yarn workspaces run build and thought may be this can be an issue, I tried to recompile the version without docker but it didn't help.

Build with docker

Also building with docker didn't help me, postgres and graphql containers always failed with password authentication in postgres while cardano-db-sync-extended succeeded and continuously inserts data to database:

cardano-node_1              | [db6a287f:cardano.node.ChainDB:Notice:179] [2021-02-11 14:51:12.34 UTC] Chain extended, new tip: 85112ff21e06ccd6d254faef0a35bc1753ad93b151
179dacb8671585150aa3a2 at slot 3826695
cardano-db-sync-extended_1  | [db-sync-node:Info:52] [2021-02-11 14:51:12.68 UTC] insertByronBlock: slot 900101, block 900000, hash f6ebdf5d3c531301b942fe077ed6c3f1110fa
6cdc53d97de8f95bfbf66dff055
cardano-node_1              | [db6a287f:cardano.node.ChainDB:Notice:179] [2021-02-11 14:51:13.59 UTC] Chain extended, new tip: c4119da995e77177ddca423f98e4ab97e6ae675c69
7a8ce2564ef297a40ef7bb at slot 3827166
postgres_1                  | 2021-02-11 14:51:14.804 UTC [326] FATAL:  password authentication failed for user "postgres"
postgres_1                  | 2021-02-11 14:51:14.804 UTC [326] DETAIL:  Password does not match for user "postgres".
postgres_1                  |   Connection matched pg_hba.conf line 95: "host all all all md5"
cardano-graphql_1           | {"name":"cardano-graphql","hostname":"30e5affabf20","pid":1,"level":50,"err":{"message":"password authentication failed for user \"postgres
\"","name":"error","stack":"error: password authentication failed for user \"postgres\"\n    at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:27
8:15)\n    at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)\n    at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)\n    at
 Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:10:42)\n    at Socket.emit (events.js:315:20)\n    at addChunk (internal/streams/readable.js:309:12)\n  
  at readableAddChunk (internal/streams/readable.js:284:9)\n    at Socket.Readable.push (internal/streams/readable.js:223:10)\n    at TCP.onStreamRead (internal/stream_b
ase_commons.js:188:23)","code":"28P01"},"msg":"password authentication failed for user \"postgres\"","time":"2021-02-11T14:51:14.808Z","v":0}
cardano-node_1              | [db6a287f:cardano.node.ChainDB:Notice:179] [2021-02-11 14:51:14.84 UTC] Chain extended, new tip: f6b8d798cfbbcb9a84c867bb33c04979815a31c656
f0fe811b139c87e7621909 at slot 3827625
cardano-node_1              | [db6a287f:cardano.node.ChainDB:Notice:179] [2021-02-11 14:51:15.12 UTC] Chain extended, new tip: f2ba44139ab025e0dade5c5e8405e5f68b014af6e67e327dfa7b96d023182be7 at slot 3827686
cardano-graphql_1           | {"name":"cardano-graphql","hostname":"30e5affabf20","pid":1,"level":30,"msg":"GraphQL HTTP server at http://0.0.0.0:3100/ started","time":"2021-02-11T14:51:15.356Z","v":0}
cardano-graphql_1           | {"name":"cardano-graphql","hostname":"30e5affabf20","pid":1,"level":40,"msg":"DbClient.pgSubscriber: Reconnecting attempt 1","time":"2021-02-11T14:51:15.359Z","v":0}

To sum up I want to know how can I build cardano-graphql better without docker, but I will also glad if it is possible to run it in docker either.

alexqrid avatar Feb 11 '21 15:02 alexqrid

@rhyslbw Help please.

alexqrid avatar Feb 16 '21 09:02 alexqrid

@alexqrid I'm thinking of adding another Dockerfile that bundles everything into one image, which will serve as a complete reference and may be a preferred approach as a standalone deployment.

rhyslbw avatar Feb 17 '21 02:02 rhyslbw

I could successfully build it using docker. But actually the problem is that, if you change database password in config/secrets/postgres_password graphql container can't connect to the database, displaying that the password was wrong for the user. It doesn't matter if you change it before the first build or rebuild it, I tried both on clean VPS and couldn't succeed. But if you build everything with default credentials it will succeed.

alexqrid avatar Feb 17 '21 21:02 alexqrid

config/secrets/postgres_password does not affect cardano-graphql settings

xray-robot avatar May 18 '21 18:05 xray-robot

I could successfully build it using docker. But actually the problem is that, if you change database password in config/secrets/postgres_password graphql container can't connect to the database, displaying that the password was wrong for the user. It doesn't matter if you change it before the first build or rebuild it, I tried both on clean VPS and couldn't succeed. But if you build everything with default credentials it will succeed.

Check this https://github.com/input-output-hk/cardano-graphql/issues/500#issuecomment-845360652

xray-robot avatar May 20 '21 18:05 xray-robot

I could successfully build it using docker. But actually the problem is that, if you change database password in config/secrets/postgres_password graphql container can't connect to the database, displaying that the password was wrong for the user. It doesn't matter if you change it before the first build or rebuild it, I tried both on clean VPS and couldn't succeed. But if you build everything with default credentials it will succeed.

So, what is the solution if you want to use some other postgres with different password?

mikaint avatar Jun 04 '21 19:06 mikaint

Hi! Please can anyone tell me, how long cardano-graphql can initialize? I have synced cardano node, db-sync-extended, hasura-cli, graphql-engine and cardano-graphql succesfully built by nix, running out of docker. dbsync is working, graphql too (listening on 8090), and after launching cardano-graphql I have this messages:

{"name":"cardano-graphql","hostname":"cardano5.ph182","pid":28957,"level":30,"module":"Server","msg":"Initializing","time":"2021-08-10T06:59:10.379Z","v":0}
{"name":"cardano-graphql","hostname":"cardano5.ph182","pid":28957,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2021-08-10T06:59:10.497Z","v":0}
{"name":"cardano-graphql","hostname":"cardano5.ph182","pid":28957,"level":50,"msg":"Cannot read property 'reserves' of null","time":"2021-08-10T06:59:21.851Z","v":0}

No other events, and no 3001 port listening What can be wrong? Thank you

kiselev-sv avatar Aug 10 '21 07:08 kiselev-sv

same problem , no error message

like stucking there forever , same if restart

{"name":"cardano-graphql","hostname":"db8fdfff62a9","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2021-08-13T07:27:56.234Z","v":0}
{"name":"cardano-graphql","hostname":"db8fdfff62a9","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2021-08-13T07:27:56.603Z","v":0}
{"name":"cardano-graphql","hostname":"db8fdfff62a9","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2021-08-13T07:49:17.481Z","v":0}
{"name":"cardano-graphql","hostname":"db8fdfff62a9","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2021-08-13T07:49:17.856Z","v":0}

behind which hasura having a lot log for

{"type":"http-log","timestamp":"2021-08-13T08:04:31.518+0000","level":"info","detail":{"operation":{"query_execution_time":1.010462e-3,"user_vars":{"x-hasura-role":"cardano-graphql"},"request_id":"3ea26472-86a0-4468-83a5-067b5806e5be","response_size":62,"request_read_time":6.553e-6},"http_info":{"status":200,"http_version":"HTTP/1.1","url":"/v1/graphql","ip":"172.25.0.7","method":"POST","content_encoding":"gzip"}}}
{"type":"query-log","timestamp":"2021-08-13T08:04:33.602+0000","level":"info","detail":{"request_id":"ca957c5b-7dc7-4b8f-a570-f56816b9c360","generated_sql":{"cardano":{"prepared_arguments":["{\"x-hasura-role\":\"cardano-graphql\"}"],"query":"SELECT  coalesce(json_agg(\"root\" ), '[]' ) AS \"root\" FROM  (SELECT  row_to_json((SELECT  \"_4_e\"  FROM  (SELECT  \"_3_root.or.currentEpoch\".\"currentEpoch\" AS \"currentEpoch\"       ) AS \"_4_e\"      ) ) AS \"root\" FROM  (SELECT  *  FROM \"public\".\"Cardano\"  WHERE ('true')     ) AS \"_0_root.base\" LEFT OUTER JOIN LATERAL (SELECT  row_to_json((SELECT  \"_2_e\"  FROM  (SELECT  \"_1_root.or.currentEpoch.base\".\"number\" AS \"number\"       ) AS \"_2_e\"      ) ) AS \"currentEpoch\" FROM  (SELECT  *  FROM \"public\".\"Epoch\"  WHERE ((\"_0_root.base\".\"currentEpochNo\") = (\"number\"))     ) AS \"_1_root.or.currentEpoch.base\"      ) AS \"_3_root.or.currentEpoch\" ON ('true')     LIMIT 1 ) AS \"_5_root\"      "}},"query":{"query":"query {\n            cardano {\n                currentEpoch {\n                    number\n                }\n            }\n        }"}}}

jun0tpyrc avatar Aug 13 '21 07:08 jun0tpyrc

Just a quick update as I was trying to achieve the same thing. Try to set a higher log level with export LOGGER_MIN_SEVERITY=debug

I for example got the log output:

{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2021-11-19T11:18:34.595Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"module":"HasuraClient","msg":"","time":"2021-11-19T11:18:34.974Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 1 of 10, retrying...","time":"2021-11-19T11:18:34.975Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"module":"HasuraClient","msg":"","time":"2021-11-19T11:18:36.398Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 2 of 10, retrying...","time":"2021-11-19T11:18:36.398Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"module":"HasuraClient","msg":"","time":"2021-11-19T11:18:38.551Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 3 of 10, retrying...","time":"2021-11-19T11:18:38.551Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"module":"HasuraClient","msg":"","time":"2021-11-19T11:18:41.988Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 4 of 10, retrying...","time":"2021-11-19T11:18:41.988Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"module":"HasuraClient","msg":"","time":"2021-11-19T11:18:47.722Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 5 of 10, retrying...","time":"2021-11-19T11:18:47.722Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"module":"HasuraClient","msg":"","time":"2021-11-19T11:18:57.463Z","v":0}
{"name":"cardano-graphql","hostname":"r02.munichmetal.de","pid":728323,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 6 of 10, retrying...","time":"2021-11-19T11

So somehow migrations can't be applied. I guess I'll have to check how to fix that but at least I have a starting point. Would love to know what you guys found out. Cheers, Alex

ruttkowa avatar Nov 19 '21 11:11 ruttkowa

Experiencing a similar problem. I created a shell script to try and run cardano-graphql side by side with cardano-node.

export CARDANO_NODE_CONFIG_PATH=/media/ralampay/Secondary/etc/mainnet/mainnet-config.json
export CARDANO_GRAPHQL_PATH=/media/ralampay/Secondary/src/cardano/cardano-graphql
export METADATA_SERVER_URI="https://metadata.cardano-testnet.iohkdev.io"
cd $CARDANO_GRAPHQL_PATH

export HASURA_CLI_PATH=/home/ralampay/.nvm/versions/node/v14.18.1/bin/
export HASURA_URI=http://localhost:8090
export GENESIS_FILE_BYRON=./config/network/mainnet/genesis/byron.json
export GENESIS_FILE_SHELLEY=./config/network/mainnet/genesis/shelley.json
export POSTGRES_DB=cexplorer
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export POSTGRES_USER=developer
export POSTGRES_PASSWORD=password

node ./packages/server/dist/index.js

I'm getting a permission denied from the bin directory for some reason.

ralampay avatar Nov 28 '21 10:11 ralampay

I have almost the same problem. As you know now present server and background services.

I have this server service:

[Unit]
Description=Cardano NodeJS Server
Wants=network-online.target graphql-engine.service
After=network.target network-online.target multi-user.target graphql-engine.service

[Service]
User=root
Group=root
Environment=NODE_PORT=3100
Environment=NODE_ENV=production
EnvironmentFile=/opt/graphql/graphql.env
WorkingDirectory=/opt/cardano-graphql/packages/server/
ExecStart=/usr/bin/node /opt/cardano-graphql/packages/server/dist/index.js
KillSignal=SIGINT
RestartKillSignal=SIGINT
SyslogIdentifier=graphql-server
LimitNOFILE=32768
Restart=always
RestartSec=15s
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target

and background service:

[Unit]
Description=Cardano NodeJS Background
Wants=network-online.target graphql-engine.service postgresql.service
After=network.target network-online.target multi-user.target graphql-engine.service postgresql.service

[Service]
User=root
Group=root
EnvironmentFile=/opt/graphql/graphql.env
WorkingDirectory=/opt/cardano-graphql/packages/api-cardano-db-hasura/
ExecStart=/usr/bin/node /opt/cardano-graphql/packages/api-cardano-db-hasura/dist/background.js
KillSignal=SIGINT
RestartKillSignal=SIGINT
SyslogIdentifier=graphql-background
LimitNOFILE=32768
Restart=always
RestartSec=15s
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target

my env file is:

CARDANO_NODE_SOCKET_PATH=/opt/cardano/node-relay/db/node.socket
CARDANO_NODE_CONFIG_PATH=/opt/cardano/node-relay/mainnet-config.json
CARDANO_GRAPHQL_PATH=/opt/cardano-graphql
GENESIS_FILE_BYRON=/opt/cardano/node-relay/mainnet-byron-genesis.json
GENESIS_FILE_SHELLEY=/opt/cardano/node-relay/mainnet-shelley-genesis.json
HASURA_CLI_PATH=/usr/local/bin/hasura
HASURA_CLI_EXT_PATH=/usr/local/bin/hasura-cli_ext
HASURA_URI="http://hasura:8090"
HASURA_GRAPHQL_ENABLE_TELEMETRY=true
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES=true
HASURA_GRAPHQL_ENABLE_CONSOLE=true
HASURA_GRAPHQL_SERVER_PORT=8090
HASURA_GRAPHQL_SERVER_HOST=127.0.0.1
#HASURA_GRAPHQL_CORS_DOMAIN="*"
HASURA_GRAPHQL_DISABLE_CORS=true
HASURA_GRAPHQL_INSECURE_SKIP_TLS_VERIFY=true
HASURA_GRAPHQL_DATABASE_URL="postgres://cexplorer:[email protected]:5432/cexplorer"
HASURA_GRAPHQL_ENABLED_LOG_TYPES="startup, http-log, webhook-log, websocket-log, query-log" 
HASURA_GRAPHQL_ADMIN_SECRET=hasurapass
HASURA_ADMIN_SECRET=hasurapass
HASURA_GRAPHQL_LOG_LEVEL=debug
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
SECRET_DIR=/opt/secrets/
POSTGRES_DB=cexplorer
POSTGRES_USER=cexplorer
POSTGRES_PASSWORD=cexplorer
POSTGRES_DB_FILE=/opt/secrets/postgres_db
POSTGRES_USER_FILE=/opt/secrets/postgres_user
POSTGRES_PASSWORD_FILE=/opt/secrets/postgres_password
NETWORK=mainnet
METADATA_SERVER_URI="https://tokens.cardano.org/metadata"
OGMIOS_HOST="ogmios"
ALLOW_INTROSPECTION=true
JQ_PATH=/usr/bin/jq
LOGGER_MIN_SEVERITY=debug
CACHE_ENABLED=true
#RESTORE_SNAPSHOT=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.1/db-sync-snapshot-schema-13.1-block-8714992-x86_64.tgz
RESTORE_RECREATE_DB=N
PGPASSFILE=/opt/cardano-db-sync/config/pgpass-mainnet

One problem is - server port 3100 is not appear, just absent. netstat -nlp, even after 1 hour still nothing.

Second one - backgroung not work as needed, here is log:


May 12 15:57:20 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":30,"module":"Db","msg":"Initializing...","time":"2023-05-12T15:57:20.138Z","v":0}
May 12 15:57:20 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"module":"Db","msg":"pgSubscriber: Connected","time":"2023-05-12T15:57:20.242Z","v":0}
May 12 15:57:20 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":30,"module":"HasuraBackgroundClient","msg":"Initializing","time":"2023-05-12T15:57:20.243Z","v":0}
May 12 15:57:21 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 1 of 10, retrying...","time":"2023-05-12T15:57:21.677Z","v":0}
May 12 15:57:24 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 2 of 10, retrying...","time":"2023-05-12T15:57:24.090Z","v":0}
May 12 15:57:27 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 3 of 10, retrying...","time":"2023-05-12T15:57:27.137Z","v":0}
May 12 15:57:31 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 4 of 10, retrying...","time":"2023-05-12T15:57:31.657Z","v":0}
May 12 15:57:38 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 5 of 10, retrying...","time":"2023-05-12T15:57:38.365Z","v":0}
May 12 15:57:49 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 6 of 10, retrying...","time":"2023-05-12T15:57:49.093Z","v":0}
May 12 15:58:06 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 7 of 10, retrying...","time":"2023-05-12T15:58:06.986Z","v":0}
May 12 15:58:37 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 8 of 10, retrying...","time":"2023-05-12T15:58:37.086Z","v":0}
May 12 15:59:28 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 9 of 10, retrying...","time":"2023-05-12T15:59:28.719Z","v":0}
May 12 16:00:58 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":20,"msg":"Applying PostgreSQL schema migrations: Attempt 10 of 10, exiting","time":"2023-05-12T16:00:58.173Z","v":0}
May 12 16:00:58 graphql graphql-background[114046]: {"name":"background","hostname":"graphql","pid":114046,"level":50,"msg":"Command failed: /usr/local/bin/hasura --skip-update-check --project /opt/cardano-graphql/packages/api-cardano-db-hasura/hasura/project --endpoint http://hasura:8090 migrate --database-name default apply --up all\n{\"level\":\"error\",\"msg\":\"skipping applying migrations on database 'default', encountered: \\n{\\n  \\\"code\\\": \\\"postgres-error\\\",\\n  \\\"error\\\": \\\"query execution failed\\\",\\n  \\\"internal\\\": {\\n    \\\"arguments\\\": [],\\n    \\\"error\\\": {\\n      \\\"description\\\": null,\\n      \\\"exec_status\\\": \\\"FatalError\\\",\\n      \\\"hint\\\": null,\\n      \\\"message\\\": \\\"must be owner of table block\\\",\\n      \\\"status_code\\\": \\\"42501\\\"\\n    },\\n    \\\"prepared\\\": false,\\n    \\\"statement\\\": \\\"\\\\nCREATE OR REPLACE VIEW \\\\\\\"AdaPots\\\\\\\" AS\\\\n  SELECT\\\\n    epoch_no AS \\\\\\\"epochNo\\\\\\\",\\\\n    deposits,\\\\n    fees,\\\\n    reserves,\\\\n    rewards,\\\\n    slot_no AS \\\\\\\"slotNo\\\\\\\",\\\\n    treasury,\\\\n    utxo\\\\nFROM ada_pots;\\\\n\\\\nCREATE TABLE IF NOT EXISTS \\\\\\\"Asset\\\\\\\" (\\\\n    \\\\\\\"assetId\\\\\\\" BYTEA PRIMARY KEY,\\\\n    \\\\\\\"assetName\\\\\\\" BYTEA,\\\\n    \\\\\\\"decimals\\\\\\\" INT,\\\\n    \\\\\\\"description\\\\\\\" VARCHAR,\\\\n    \\\\\\\"fingerprint\\\\\\\" CHAR(44),\\\\n    \\\\\\\"firstAppearedInSlot\\\\\\\" INT,\\\\n    \\\\\\\"logo\\\\\\\" VARCHAR,\\\\n    \\\\\\\"metadataHash\\\\\\\" CHAR(40),\\\\n    \\\\\\\"name\\\\\\\" VARCHAR,\\\\n    \\\\\\\"policyId\\\\\\\" BYTEA,\\\\n    \\\\\\\"ticker\\\\\\\" VARCHAR(9),\\\\n    \\\\\\\"url\\\\\\\" VARCHAR\\\\n);\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Block\\\\\\\" AS\\\\n SELECT (COALESCE(( SELECT sum((tx.fee)::bigint) AS sum\\\\n           FROM tx\\\\n          WHERE (tx.block_id = block.id)), (0)::NUMERIC))::bigint AS fees,\\\\n    block.hash,\\\\n    block.block_no AS \\\\\\\"number\\\\\\\",\\\\n    block.op_cert AS \\\\\\\"opCert\\\\\\\",\\\\n    previous_block.hash AS \\\\\\\"previousBlockHash\\\\\\\",\\\\n    next_block.hash AS \\\\\\\"nextBlockHash\\\\\\\",\\\\n    jsonb_build_object('major', block.proto_major, 'minor', block.proto_minor) AS \\\\\\\"protocolVersion\\\\\\\",\\\\n    block.size,\\\\n    block.tx_count AS \\\\\\\"transactionsCount\\\\\\\",\\\\n    block.epoch_no AS \\\\\\\"epochNo\\\\\\\",\\\\n    block.\\\\\\\"time\\\\\\\" AS \\\\\\\"forgedAt\\\\\\\",\\\\n    block.epoch_slot_no AS \\\\\\\"slotInEpoch\\\\\\\",\\\\n    block.slot_no AS \\\\\\\"slotNo\\\\\\\",\\\\n    slot_leader.id AS \\\\\\\"slot_leader_id\\\\\\\",\\\\n    slot_leader.pool_hash_id AS \\\\\\\"pool_hash_id\\\\\\\",\\\\n    block.vrf_key As \\\\\\\"vrfKey\\\\\\\"\\\\n   FROM (((block\\\\n     LEFT JOIN block previous_block ON ((block.previous_id = previous_block.id)))\\\\n     LEFT JOIN block next_block ON ((next_block.previous_id = block.id)))\\\\n     LEFT JOIN slot_leader ON ((block.slot_leader_id = slot_leader.id)));\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Cardano\\\\\\\" AS\\\\n SELECT block.block_no AS \\\\\\\"tipBlockNo\\\\\\\",\\\\n    block.epoch_no AS \\\\\\\"currentEpochNo\\\\\\\"\\\\n   FROM block\\\\n  WHERE (block.block_no IS NOT NULL)\\\\n  ORDER BY block.id DESC\\\\n LIMIT 1;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"CollateralInput\\\\\\\" AS\\\\nSELECT\\\\n  source_tx_out.address,\\\\n  source_tx_out.value,\\\\n  tx.hash AS \\\\\\\"txHash\\\\\\\",\\\\n  source_tx.hash AS \\\\\\\"sourceTxHash\\\\\\\",\\\\n  collateral_tx_in.tx_out_index AS \\\\\\\"sourceTxIndex\\\\\\\",\\\\n  source_tx_out.id AS source_tx_out_id\\\\nFROM\\\\n  tx\\\\nJOIN collateral_tx_in\\\\n  ON collateral_tx_in.tx_in_id = tx.id\\\\nJOIN tx_out AS source_tx_out\\\\n  ON collateral_tx_in.tx_out_id = source_tx_out.tx_id\\\\n  AND collateral_tx_in.tx_out_index = source_tx_out.index\\\\nJOIN tx AS source_tx\\\\n  ON source_tx_out.tx_id = source_tx.id;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"CollateralOutput\\\\\\\" AS\\\\nSELECT\\\\n  address,\\\\n  collateral_tx_out.address_has_script AS \\\\\\\"addressHasScript\\\\\\\",\\\\n  value,\\\\n  tx.hash AS \\\\\\\"txHash\\\\\\\",\\\\n  collateral_tx_out.id,\\\\n  index,\\\\n  collateral_tx_out.inline_datum_id AS \\\\\\\"inline_datum_id\\\\\\\",\\\\n  collateral_tx_out.reference_script_id AS \\\\\\\"reference_script_id\\\\\\\",\\\\n  collateral_tx_out.payment_cred AS \\\\\\\"paymentCredential\\\\\\\"\\\\nFROM tx\\\\nJOIN collateral_tx_out\\\\n  ON tx.id = collateral_tx_out.tx_id;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Delegation\\\\\\\" AS\\\\nSELECT\\\\n  delegation.id AS \\\\\\\"id\\\\\\\",\\\\n  stake_address.view AS \\\\\\\"address\\\\\\\",\\\\n  delegation.redeemer_id AS \\\\\\\"redeemerId\\\\\\\",\\\\n  delegation.tx_id AS \\\\\\\"tx_id\\\\\\\",\\\\n  pool_hash_id AS \\\\\\\"pool_hash_id\\\\\\\"\\\\nFROM delegation\\\\nJOIN stake_address on delegation.addr_id = stake_address.id;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Epoch\\\\\\\" AS\\\\nSELECT\\\\n  epoch.fees AS \\\\\\\"fees\\\\\\\",\\\\n  epoch.out_sum AS \\\\\\\"output\\\\\\\",\\\\n  epoch.no AS \\\\\\\"number\\\\\\\",\\\\n  epoch_param.nonce AS \\\\\\\"nonce\\\\\\\",\\\\n  epoch.tx_count AS \\\\\\\"transactionsCount\\\\\\\",\\\\n  epoch.start_time AS \\\\\\\"startedAt\\\\\\\",\\\\n  epoch.end_time AS \\\\\\\"lastBlockTime\\\\\\\",\\\\n  epoch.blk_count AS \\\\\\\"blocksCount\\\\\\\"\\\\nFROM epoch\\\\n  LEFT JOIN epoch_param on epoch.no = epoch_param.epoch_no;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Datum\\\\\\\" AS\\\\nSELECT\\\\n  bytes,\\\\n  hash,\\\\n  id,\\\\n  tx_id,\\\\n  value\\\\nFROM datum;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"RedeemerDatum\\\\\\\" AS\\\\nSELECT\\\\n  bytes,\\\\n  hash,\\\\n  id,\\\\n  tx_id,\\\\n  value\\\\nFROM redeemer_data;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"ProtocolParams\\\\\\\" AS\\\\nSELECT\\\\n  epoch_param.influence AS \\\\\\\"a0\\\\\\\",\\\\n  epoch_param.coins_per_utxo_size AS \\\\\\\"coinsPerUtxoByte\\\\\\\",\\\\n  epoch_param.collateral_percent AS \\\\\\\"collateralPercent\\\\\\\",\\\\n  cost_model.costs AS \\\\\\\"costModels\\\\\\\",\\\\n  epoch_param.decentralisation AS \\\\\\\"decentralisationParam\\\\\\\",\\\\n  epoch_param.max_collateral_inputs AS \\\\\\\"maxCollateralInputs\\\\\\\",\\\\n  epoch_param.max_epoch AS \\\\\\\"eMax\\\\\\\",\\\\n  epoch_param.epoch_no AS \\\\\\\"epoch_no\\\\\\\",\\\\n  epoch_param.extra_entropy AS \\\\\\\"extraEntropy\\\\\\\",\\\\n  epoch_param.key_deposit AS \\\\\\\"keyDeposit\\\\\\\",\\\\n  epoch_param.max_block_size AS \\\\\\\"maxBlockBodySize\\\\\\\",\\\\n  epoch_param.max_block_ex_mem AS \\\\\\\"maxBlockExMem\\\\\\\",\\\\n  epoch_param.max_block_ex_steps AS \\\\\\\"maxBlockExSteps\\\\\\\",\\\\n  epoch_param.max_bh_size AS \\\\\\\"maxBlockHeaderSize\\\\\\\",\\\\n  epoch_param.max_tx_ex_mem AS \\\\\\\"maxTxExMem\\\\\\\",\\\\n  epoch_param.max_tx_ex_steps AS \\\\\\\"maxTxExSteps\\\\\\\",\\\\n  epoch_param.max_tx_size AS \\\\\\\"maxTxSize\\\\\\\",\\\\n  epoch_param.max_val_size AS \\\\\\\"maxValSize\\\\\\\",\\\\n  epoch_param.min_fee_a AS \\\\\\\"minFeeA\\\\\\\",\\\\n  epoch_param.min_fee_b AS \\\\\\\"minFeeB\\\\\\\",\\\\n  epoch_param.min_pool_cost AS \\\\\\\"minPoolCost\\\\\\\",\\\\n  epoch_param.min_utxo_value AS \\\\\\\"minUTxOValue\\\\\\\",\\\\n  epoch_param.optimal_pool_count AS \\\\\\\"nOpt\\\\\\\",\\\\n  epoch_param.pool_deposit AS \\\\\\\"poolDeposit\\\\\\\",\\\\n  epoch_param.price_mem AS \\\\\\\"priceMem\\\\\\\",\\\\n  epoch_param.price_step AS \\\\\\\"priceStep\\\\\\\",\\\\n  jsonb_build_object('major', epoch_param.protocol_major, 'minor', epoch_param.protocol_major) AS \\\\\\\"protocolVersion\\\\\\\",\\\\n  epoch_param.monetary_expand_rate AS \\\\\\\"rho\\\\\\\",\\\\n  epoch_param.treasury_growth_rate AS \\\\\\\"tau\\\\\\\"\\\\nFROM epoch_param\\\\nJOIN cost_model\\\\n  ON epoch_param.cost_model_id = cost_model.id;\\\\n\\\\nCREATE OR REPLACE VIEW \\\\\\\"Redeemer\\\\\\\" AS\\\\nSELECT\\\\n  redeemer.fee AS \\\\\\\"fee\\\\\\\",\\\\n  redeemer.id AS \\\\\\\"id\\\\\\\",\\\\n 

And this log is cycled, how to resolve it? How to make normal logs and see worked port to use it?

minzak avatar May 12 '23 16:05 minzak