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

Console not handling "--console-hge-endpoint" properly #10136

Open
TimUnderhay opened this issue Feb 19, 2024 · 0 comments
Open

Console not handling "--console-hge-endpoint" properly #10136

TimUnderhay opened this issue Feb 19, 2024 · 0 comments
Labels
k/bug Something isn't working

Comments

@TimUnderhay
Copy link

TimUnderhay commented Feb 19, 2024

Version Information

Server Version:
CLI Version (for CLI related issue): 2.37.0

Environment

OSS Docker image

What is the current behaviour?

I am running Hasura in a Docker compose stack running as a local dev environment. The command line is hasura-cli console --address 0.0.0.0 --no-browser --console-hge-endpoint http://local.somedomain.io/.

I can access and use the console on http://localhost:9695/console just fine. However, looking at the network inspector, there are multiple failing requests to bogus endpoint http://v1/graphql.

image

What is the expected behaviour?

These failing requests should succeed, using --console-hge-endpoint as the base URL.

How to reproduce the issue?

The HGE endpoint goes through an Nginx container which routes to HGE. The nginx config:

server {
  listen 80;
  http2 on;
  underscores_in_headers on;
  gzip on;
  gzip_proxied any;
  gzip_types text/plain application/xml;
  gunzip on;
  location /v1 {
    proxy_pass http://hasura:8080/v1;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
  }
  location /v2 {
    proxy_pass http://hasura:8080/v2;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
  }
}

The compose services are:

  hasura:
    image: v2.37.0-ce.cli-migrations-v3
    command: ["/bin/bash", "-c", "/hasura-finish-startup.sh"]
    ports:
      - "9695:9695"
      - "9693:9693"
    volumes:
      - ${SRC_DIR}/somedir/config.yaml:/config.yaml
      - ${SRC_DIR}/somedir/hasura-finish-startup.sh:/hasura-finish-startup.sh

  nginx:
    restart: unless-stopped
    image: nginx:${NGINX_DOCKER_TAG:-1.25.3-alpine}
    ports:
      - "80:80"

hasura-finish-startup.sh:

#!/bin/bash

function wait_for_port () {
  local PORT=$1
  echo Waiting for port $PORT
  while ! nc -z localhost $PORT; do   
    sleep 0.1
  done
  echo Port $PORT is listening
}

graphql-engine serve &
wait_for_port 8080
cd /
hasura-cli console --address 0.0.0.0 --no-browser --console-hge-endpoint http://local.somedomain.io/
wait

Screenshots or Screencast

See above

Please provide any traces or logs that could help here.

N/A

Any possible solutions/workarounds you're aware of?

None I'm aware of

Keywords

@TimUnderhay TimUnderhay added the k/bug Something isn't working label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant