No pg_hba.conf entry for host "172.23.0.4", user "postgres", database "postgres", no encryption. #9839
Unanswered
danielliem49
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to follow the Hasura quickstart with Docker from the following link:
https://hasura.io/docs/latest/getting-started/docker-simple/
Here is the docker-compose.yaml file from Docker. I ran it with no changes:
version: "3.6" services: postgres: image: postgres:15 restart: always volumes: - db_data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: postgrespassword graphql-engine: image: hasura/graphql-engine:v2.32.0 ports: - "8080:8080" restart: always environment: HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console HASURA_GRAPHQL_DEV_MODE: "true" HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log HASURA_GRAPHQL_METADATA_DEFAULTS: '{"backend_configs":{"dataconnector":{"athena":{"uri":"http://data-connector-agent:8081/api/v1/athena"},"mariadb":{"uri":"http://data-connector-agent:8081/api/v1/mariadb"},"mysql8":{"uri":"http://data-connector-agent:8081/api/v1/mysql"},"oracle":{"uri":"http://data-connector-agent:8081/api/v1/oracle"},"snowflake":{"uri":"http://data-connector-agent:8081/api/v1/snowflake"}}}}' depends_on: data-connector-agent: condition: service_healthy data-connector-agent: image: hasura/graphql-data-connector:v2.32.0 restart: always ports: - 8081:8081 environment: QUARKUS_LOG_LEVEL: ERROR # FATAL, ERROR, WARN, INFO, DEBUG, TRACE QUARKUS_OPENTELEMETRY_ENABLED: "false" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8081/api/v1/athena/health"] interval: 5s timeout: 10s retries: 5 start_period: 5s volumes: db_data:
The postgresql and data-connector-agent containers run fine, however the graphql-engine container constanly errors out and restarts.
Here is the error log from the graphql-engine container:
2023-08-21 17:19:30 {"detail":{"message":{"host":"Unknown or invalid host","message":"Postgres connection failed","retry_attempt":0}},"level":"warn","timestamp":"2023-08-22T00:19:30.409+0000","type":"pg-client"} 2023-08-21 17:19:30 {"detail":{"message":{"host":"Unknown or invalid host","message":"Postgres connection failed","retry_attempt":1}},"level":"warn","timestamp":"2023-08-22T00:19:30.409+0000","type":"pg-client"} 2023-08-21 17:19:30 {"detail":{"info":"WARNING: No admin secret provided","kind":"no_admin_secret"},"level":"warn","timestamp":"2023-08-22T00:19:30.511+0000","type":"startup"} 2023-08-21 17:19:30 {"detail":{"info":{"admin_secret_set":false,"auth_hook":null,"auth_hook_mode":null,"console_assets_dir":null,"console_sentry_dsn":null,"cors_config":{"allowed_origins":"*","disabled":false,"ws_read_cookie":null},"enable_allowlist":false,"enable_console":true,"enable_maintenance_mode":false,"enable_metadata_query_logging":false,"enable_telemetry":true,"enabled_apis":["config","pgdump","metadata","graphql"],"enabled_log_types":["webhook-log","http-log","startup","query-log","websocket-log"],"events_fetch_batch_size":100,"experimental_features":[],"graceful_shutdown_timeout":60,"infer_function_permissions":true,"jwt_secret":[],"live_query_options":{"batch_size":100,"refetch_delay":1},"log_level":"info","port":8080,"remote_schema_permissions":false,"server_host":"HostAny","stringify_numeric_types":false,"transaction_isolation":"ISOLATION LEVEL READ COMMITTED","unauth_role":null,"use_prepared_statements":true,"v1-boolean-null-collapse":false,"websocket_compression_options":"NoCompression","websocket_connection_init_timeout":"Refined (Seconds {seconds = 3s})","websocket_keep_alive":"KeepAliveDelay {unKeepAliveDelay = Refined (Seconds {seconds = 5s})}"},"kind":"server_configuration"},"level":"info","timestamp":"2023-08-22T00:19:30.511+0000","type":"startup"} 2023-08-21 17:19:30 {"detail":{"info":{"database_url":"postgres://postgres:...@postgres:5432/postgres","retries":1},"kind":"postgres_connection"},"level":"info","timestamp":"2023-08-22T00:19:30.511+0000","type":"startup"} 2023-08-21 17:19:30 {"detail":{"message":{"host":"Unknown or invalid host","message":"Postgres connection failed","retry_attempt":0}},"level":"warn","timestamp":"2023-08-22T00:19:30.511+0000","type":"pg-client"} 2023-08-21 17:19:30 {"detail":{"message":{"host":"Unknown or invalid host","message":"Postgres connection failed","retry_attempt":1}},"level":"warn","timestamp":"2023-08-22T00:19:30.511+0000","type":"pg-client"} 2023-08-21 17:19:30 {"detail":{"info":{"code":"postgres-error","error":"connection error","internal":"connection to server at \"postgres\" (172.23.0.2), port 5432 failed: FATAL: no pg_hba.conf entry for host \"172.23.0.4\", user \"postgres\", database \"postgres\", no encryption\n","path":"$"},"kind":"catalog_migrate"},"level":"error","timestamp":"2023-08-22T00:19:30.511+0000","type":"startup"} 2023-08-21 17:19:30 {"error":"connection error","path":"$","code":"postgres-error","internal":"connection to server at \"postgres\" (172.23.0.2), port 5432 failed: FATAL: no pg_hba.conf entry for host \"172.23.0.4\", user \"postgres\", database \"postgres\", no encryption\n"}
Here is the log from the postgres container:
2023-08-21 17:19:30 2023-08-22 00:19:30.409 UTC [217] FATAL: no pg_hba.conf entry for host "172.23.0.4", user "postgres", database "postgres", no encryption 2023-08-21 17:19:30 2023-08-22 00:19:30.511 UTC [218] FATAL: no pg_hba.conf entry for host "172.23.0.4", user "postgres", database "postgres", no encryption 2023-08-21 17:19:30 2023-08-22 00:19:30.513 UTC [219] FATAL: no pg_hba.conf entry for host "172.23.0.4", user "postgres", database "postgres", no encryption 2023-08-21 17:19:30 2023-08-22 00:19:30.615 UTC [220] FATAL: no pg_hba.conf entry for host "172.23.0.4", user "postgres", database "postgres", no encryption
I tried running the same process on a coworker's Mac and it worked. For reference, I am using a Lenovo Thinkpad running Windows 11. I tried running on WSL and the same error happened.
Any help would be greatly appreciated, thank you!
Beta Was this translation helpful? Give feedback.
All reactions