forbole / callisto

Callisto (formerly BDJuno) is the official Juno implementation for Big Dipper, the open-source block explorer for Cosmos
https://bigdipper.live
MIT License
90 stars 247 forks source link

GraphQL Engine metadata is inconsistent with database #527

Open Maksat-luci opened 1 year ago

Maksat-luci commented 1 year ago

hello, I created postgress, then connected bdjuno to my postgress, and checked everything works there, data about my blockchain is displayed in postgress, then I launched hasura and the second postgress using docker, but this error occurs during operation, what could be the problem?

    image: postgres:12
    restart: always
    volumes:
    - db_data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: postgrespassword
  graphql-engine:
    image: hasura/graphql-engine:v2.18.0
    ports:
    - "8080:8080"
    depends_on:
    - "postgres"
    restart: always
    environment:
      ACTION_BASE_URL: "http://localhost:3000"
      ## postgres database to store Hasura metadata
      HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
      HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
      ## this env var can be used to add the above postgres database to Hasura as a data source. this can be removed/updated based on your needs
      PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
      ## enable the console served by server
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
      ## enable debugging mode. It is recommended to disable this in production
      HASURA_GRAPHQL_DEV_MODE: "true"
      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
 ## uncomment next line to run console offline (i.e load console assets from server instead of CDN)
      # HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets
      ## uncomment next line to set an admin secret
      # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
volumes:

this is my docker compos hasura file

            max_connections: 20
        grpc:
            address: localhost:9090
            insecure: true
parsing:
    workers: 1
    listen_new_blocks: true
    parse_old_blocks: true
    parse_genesis: true
    start_height: 1
    average_block_time: 5s
database:
    name: bdjuno
    host: localhost
    port: 5432
    user: mdc
    password: maksatmambetaliev
    schema: public
    max_open_connections: 1
    max_idle_connections: 1
    partition_size: 100000
    partition_batch: 1000
logging:
    level: debug
    format: text
actions:
    host: 127.0.0.1
    port: 3000

this bdjuno config.yaml file

Maksat-luci commented 1 year ago

should I comment out the line "#HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres" then instead of a bunch of errors, one appears


Inconsistent object: environment variable 'HASURA_GRAPHQL_DATABASE_URL' not set```
IDerr commented 1 year ago

Having the same issue on my side, I have set this variable but some errors afterwards :(

EDIT: Was an issue on my side, forgot to import a sql file... Everything is working on my side now

llwinner commented 1 year ago

@IDerr May I ask a question? Where should I import sql file? The postgre docker container that written by hasura docker-compose.yaml? I import sql files to that postgre docker container, but when I run bdjuno start, I got an error: failed to get last block height from database error="pq: permission denied for table block" Please help me, thanks.