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

Error Using CLI Console, can't GET http://0.0.0.0:9693/apis/migrate/settings #6048

Open
duskmoon314 opened this issue Oct 20, 2020 · 11 comments
Labels

Comments

@duskmoon314
Copy link

I'm following the doc Setting up Hasura migrations. I want to use hasura console, and try step 5.

I am using a Ubuntu 16.04 server, having hasura engine and postgres in docker:

CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                     NAMES
d2a2eb158d5e        hasura/graphql-engine:latest   "graphql-engine serve"   17 minutes ago      Up 17 minutes       0.0.0.0:23333->8080/tcp   hasura
af35fe785fac        postgres:12                    "docker-entrypoint.s…"   25 hours ago        Up 4 hours          0.0.0.0:5432->5432/tcp    postgres

I use this command on a Ubuntu 16.04 server:

hasura console --address 0.0.0.0 --no-browser
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      28693/sshd
tcp6       0      0 :::5432                 :::*                    LISTEN      16419/docker-proxy
tcp6       0      0 :::9693                 :::*                    LISTEN      19396/hasura
tcp6       0      0 :::9695                 :::*                    LISTEN      19396/hasura
tcp6       0      0 :::23333                :::*                    LISTEN      19289/docker-proxy

Then I tried to open the console, and got this:

image

It seems that the port for migrating isn't working correctly. How can I solve this problem?


my config.yaml:

version: 2
endpoint: http://<server_ip_address>:23333
admin_secret: <admin_secret>
jwt_secret: <jwt_secret>
metadata_directory: metadata
actions:
  kind: synchronous
  handler_webhook_baseurl: http://localhost:3000

hasura docker env:

HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:<postgres_password>@postgres:5432/postgres
HASURA_GRAPHQL_ADMIN_SECRET=<admin_secret>
HASURA_GRAPHQL_JWT_SECRET=<jwt_secret>
ACTION_SECRET=<action_secret>
HASURA_GRAPHQL_CORS_DOMAIN="*"
# USE hasura console instead
# HASURA_GRAPHQL_ENABLE_CONSOLE="true"
# HASURA_GRAPHQL_CONSOLE_ASSETS_DIR=/srv/console-assets
UNAUTHORIZED_ROLE=anonymous
@duskmoon314
Copy link
Author

On server, I get this:

$ curl -G 0.0.0.0:9693/apis/migrate/settings
{"migration_mode":"true"}

Is this a server problem?

@duskmoon314
Copy link
Author

I find a solution: use hasura cli on my pc

@x0y-gt
Copy link

x0y-gt commented Feb 26, 2021

Can this be reopened? Its happening exactly the same to me.

But I think this is an error because if I want to configure the console to listen on any IP it should be smart enough to make a request to the IP of the server instead of send the request to 0.0.0.0

@duskmoon314 duskmoon314 reopened this Feb 27, 2021
@duskmoon314
Copy link
Author

@x0y-gt OK

@jkopb
Copy link

jkopb commented Mar 15, 2021

It would be great if this bug could be fixed. The current implementation makes it impossible to run the console in environments where you cannot control the public URL.

I'm for instance having issues setting it up on Gitpod.io. Gitpod automatically creates a public URL for each server process running on localhost, and this address cannot be customized. This makes it impossible to run hasura console, as the migration server ends up running on a different URL than the console server, but the console app makes requests to localhost.

Currently, I have to work around the issue by using JS user scripts through browser extensions, which manually redirect the requests to the correct migration server URL.

@hutchic
Copy link

hutchic commented Aug 6, 2021

I think my hack is similar to @jbuverud

In chrome set a breakpoint at line 22 of the api-explorer source

image

When the breakpoint triggers adjust the configuration as necessary

window.__env.apiHost = "http://x.x.x.x"

Then continue from the breakpoint

Could this please allow a environment variable / .env file override?

@sam-artuso
Copy link

Having the same exact problem... has anyone found a solution?

@m-Bilal
Copy link
Member

m-Bilal commented Mar 7, 2023

We recently added a flag to the CLI that should fix this. Could you folks try that out and let us know if it works for your use case?

@andoks
Copy link
Contributor

andoks commented Mar 24, 2023

@m-Bilal I still have problems trying to run hasura console in a docker container, in particular on windows with docker desktop, and this here seems to be one of the possible issues (#2824 (comment)) I had to set --console-hge-endpoint=http://localhost:8080 to make anything work at all. On linux it mostly works, with some errors in the firefox developer console still though.

@dgbau
Copy link

dgbau commented Apr 25, 2023

I might have a solution! I have been running into this same/similar issue, trying to launch the console from a VS Code SSH session. I found that VSC was porting 9695 automatically when the command was run, but was not porting 9693. I manually added that port to the forwarding, and now the call to http://localhost:9693/apis/migrate/settings succeeds. I am not using any flags in the console command besides --project, --secret and --endpoint.

It seems like this is new, either 9693 was getting automatically added to forwarded ports before, or the calls to the above URL were on 9695.

@m-Bilal
Copy link
Member

m-Bilal commented May 2, 2023

@andoks , sorry, I lost track of this issue. I'll be looking into it over the next 2 weeks

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

No branches or pull requests

11 participants