Graphql-engine: Bug when exporting metadata through the CLI

Created on 1 Jun 2020  路  5Comments  路  Source: hasura/graphql-engine

In a straightforward local setup with docker-compose as described in the docs + local Hasura CLI, hasura metadata export is failing.

It works if I export it under root. So it could be some permission related issue.

I can't find better logging to know better what is going. If you can suggest some flags I can give more useful information.

Environment:

  • Mac OS X Mojave (10.14.6)
  • Both CLI and engine at version: 1.2.1

Full log:

$ hasura metadata export --log-level debug
DEBU global config file exisits, verifying contents
DEBU global config is pre-set to &cli.GlobalConfig{UUID:"99e3c3a9-43a9-4b4d-a5f8-954f306b43c7", EnableTelemetry:true, ShowUpdateNotification:true, CLIEnvironment:"default"}
DEBU global config: uuid: 99e3c3a9-43a9-4b4d-a5f8-954f306b43c7
DEBU global config: enableTelemetry: true
DEBU global config: showUpdateNotification: true
DEBU global config: cliEnvironment: default
DEBU graphql engine endpoint: http://localhost:8080
DEBU graphql engine admin_secret:
DEBU versions: cli: [v1.2.1] server: [v1.2.1]
DEBU compatibility check: [true] older cli version might not be compatible with latest server apis, please update cli
DEBU server: uuid: 1ba79630-8828-4d70-a6e5-39f50465307f
DEBU response: {"result_type":"TuplesOk","result":[["count"],["1"]]}
DEBU response: {"result_type":"TuplesOk","result":[["count"],["1"]]}
DEBU response: {"version":2,"tables":[{"table":{"schema":"public","name":"test"}}],"actions":[{"name":"actionName","definition":{"handler":"http://host.docker.internal:3000","output_type":"SampleOutput","arguments":[{"name":"arg1","type":"SampleInput!"}],"type":"mutation","kind":"synchronous"}}],"custom_types":{"input_objects":[{"name":"SampleInput","fields":[{"name":"username","type":"String!"},{"name":"password","type":"String!"}]}],"objects":[{"name":"SampleOutput","fields":[{"name":"accessToken","type":"String!"}]}]}}
DEBU output:                                       command="sdl to"
DEBU telemetry: beamed                             fields.time=48.239749ms isError=true
FATA[0004] failed to export metadata: cannot export metadata from server: cannot export actions from metadata: error in converting metadata to sdl: exit status 4:
cli

Most helpful comment

The problem was pkg was breaking because I had NODE_OPTIONS env variable with some settings. Thanks for the help!

All 5 comments

@davazp are you running the CLI inside a container ?

No, CLI is installed locally. I can try later to see if it makes a difference though.

I dug a bit deeper. I linked the CLI to a local version of the cli_ext plugin. It works when I replace it with a script that goes directly to the cli_ext's source code. It fails if I link it to the output binary (processed with pkg).

The pkg's output binary works for linux though. So it seems something is wrong with pkg on (my) mac os X.

I opened an issue in pkg to investigate further what it could be the reason: https://github.com/vercel/pkg/issues/921

The problem was pkg was breaking because I had NODE_OPTIONS env variable with some settings. Thanks for the help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hooopo picture hooopo  路  3Comments

jjangga0214 picture jjangga0214  路  3Comments

coco98 picture coco98  路  3Comments

egislook picture egislook  路  3Comments

EmrysMyrddin picture EmrysMyrddin  路  3Comments