hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.2k stars 2.77k forks source link

Unable to retrieve Schema for Data connector, unsure what to do next #10335

Open motleydev opened 4 months ago

motleydev commented 4 months ago

Component

Impacts CLI/Connectors

What is the current behaviour?

Added a data connector (postgres, called CRM, in a subgraph called MongoDB - don't ask) and when I attempt to update the connector link, it says it can't read the schema, I am unsure what to do next.

9:32AM ERR Unable to retrieve schema for DataConnectorLink "crm" in Subgraph config "/Users/jmartin/Development/Hasura/demos/mongo-atlas/ddn/mongodb/subgraph.yaml": Error fetching schema: Get "http://local.hasura.dev:8085/schema": dial tcp 127.0.0.1:8085: connect: connection refused

What is the expected behaviour?

Provide a hint where to look. Is there an auth issue, is the server down, etc.

How to reproduce the issue?

  1. Run a local postgres instance and expose it on port something like 9999
  2. Run the connector steps to add the postgres instance
  3. Attempt to update

Please provide any traces or logs that could help here.

From the monodb_crm connector container

error initializing connector state: unable to initialize connection pool: pool timed out while waiting for an open connection
{"timestamp":"2024-07-14T21:05:34.576327Z","level":"ERROR","fields":{"meta.signal_type":"log","event.domain":"ndc","event.name":"Initialization error","name":"Initialization error","body":"error initializing connector state: unable to initialize connection pool: pool timed out while waiting for an open connection","error":true},"target":"ndc_postgres::connector"}
{"timestamp":"2024-07-14T21:06:45.497730Z","level":"ERROR","fields":{"meta.signal_type":"log","event.domain":"ndc","event.name":"Initialization error","name":"Initialization error","body":"error initializing connector state: unable to initialize connection pool: pool timed out while waiting for an open connection","error":true},"target":"ndc_postgres::connector"}
error initializing connector state: unable to initialize connection pool: pool timed out while waiting for an open connection

Any possible solutions/workarounds you're aware of?

Unknown

Keywords

DX

motleydev commented 4 months ago

Compose.yaml

services:
  mongodb_crm:
    build:
      context: .
      dockerfile_inline: |-
        FROM ghcr.io/hasura/ndc-postgres:v0.8.0
        COPY ./ /etc/connector
    develop:
      watch:
        - path: ./
          action: sync+restart
          target: /etc/connector
    env_file:
      - .env.local
    extra_hosts:
      - local.hasura.dev=host-gateway
    ports:
      - mode: ingress
        target: 8080
        published: "8085"
        protocol: tcp
motleydev commented 4 months ago

configuration populated correctly, all the files seem to be correct expect for this connection error with the postgres connector

motleydev commented 4 months ago

Perhaps related to the otel container not working I get this error, thought running pat is actually set

 2024-07-15T09:06:44.216Z       info    envprovider@v0.104.0/provider.go:53     Configuration references empty environment variable  {"name": "HASURA_DDN_PAT"}
otel-collector-1       | Error: failed to resolve config: cannot resolve the configuration: expanding ${env:HASURA_DDN_PAT}: expected convertable to string value type, got %!q(<nil>)(<nil>)
otel-collector-1       | 2024/07/15 09:06:44 collector server run finished with error: failed to resolve config: cannot resolve the configuration: expanding ${env:HASURA_DDN_PAT}: expected convertable to string value type, got %!q(<nil>)(<nil>)
motleydev commented 4 months ago

the connector issue is that I was trying to use localhost stupidly for the connecting string. That being said, I wonder if we could throw a more helpful error?

Otel container not being able to expand the ddn pat command is a real problem though