这是indexloc提供的服务,不要输入任何密码
Skip to content

cli: The --address option of the hasura console command no longer works with v2.1.0 #8005

@sho-hata

Description

@sho-hata

Version Information

  • Server Version: v2.1.0
  • CLI Version (for CLI related issue): v2.1.0

Environment

  • Server: Docker container launched on Amazon EC2 Instance(docker image: hasura/graphql-engine:v2.1.0)
    • Docker containers expose port 8080.
  • Database: Docker container launched on Amazon EC2 Instance(docker image: postgres:12)
  • CLI: CLI installed on Amazon EC2 Instance

What is the expected behaviour?

The --address option should start the hasura console.

Keywords

hasura console

What is the current behaviour?

hasura console --address XXX.com --admin-secret XXX

When opening the web console screen, the error message is displayed.

Hasura console is not able to reach your Hasura CLI instance. Please ensure that your instance is running and the endpoint is configured correctly.

Also, you will no longer be able to apply to migrate on the web console.

How to reproduce the issue?

  1. Run hasura console command with the --address option set to a value other than localhost.
  2. Access the domain specified by --addressoption and open the web console screen.
  3. An error message(Hasura console is not able to reach your Hasura CLI instance...) will appear and you will not be able to apply to migrate from the web console.

Screenshots or Screencast

Screenshot 2022-01-06 14 25 49

Please provide any traces or logs that could help here.

Any possible solutions?

As a temporary measure, you can work around this by setting the values of both the --api-port and --address options.

e.g.

hasura console --api-host http://XXX.com --address XXX.com

Can you identify the location in the source code where the problem exists?

cli/commands/console.go#L129

With the v2.0.10 -> v.2.1.0 change, APIHost no longer references the value of the address option.

This causes the default value to be used for the API Host to connect to the server, even if the --address option is given.

The default value of api-host is localhost, so if the port number of localhost 9693 or the port specified by --api-port is not public, the connection will fail.

If the bug is confirmed, would you be willing to submit a PR?

Yes, I want to work for this :)

However, to submit a PR, you need to decide which value to use to launch the server when both the --api-host and --address options are specified.

Metadata

Metadata

Assignees

Labels

c/cliRelated to CLIk/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions