Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Engine metadata is inconsistent with database #527

Open
Maksat-luci opened this issue Feb 27, 2023 · 3 comments
Open

GraphQL Engine metadata is inconsistent with database #527

Maksat-luci opened this issue Feb 27, 2023 · 3 comments
Assignees

Comments

@Maksat-luci
Copy link

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
Copy link
Author

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
Copy link

IDerr commented May 17, 2023

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

@RiccardoM RiccardoM assigned MonikaCat and unassigned RiccardoM May 17, 2023
@llwinner
Copy link

llwinner commented Aug 4, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants