Open
Description
Hasura CLI --cli-ext-path
Ignored Bug Report
Version Information
Server Version: v2.48.1
CLI Version (for CLI related issue): v2.48.0
Environment
OSS / self-hosted
node:22.16.0-alpine3.22
What is the current behaviour?
Passing --cli-ext-path
to the Hasura CLI is acknowledged in logs, but the CLI still attempts to execute cli-ext
from a generated subdirectory under/root/.hasura/cli-ext/v2.48.0/cli-ext-*/cli-ext
. instead of the provided path.
What is the expected behaviour?
When specifying --cli-ext-path /usr/local/bin/cli-ext
, the CLI should execute that path instead of trying to access /root/.hasura/cli-ext/v2.48.0/cli-ext-*/cli-ext
.
How to reproduce the issue?
- Build and run a custom
cli-ext
binary. - Run the following command:
hasura metadata apply --cli-ext-path /usr/local/bin/cli-ext --log-level DEBUG
- Observe the logs showing the CLI tries to use a path like
/root/.hasura/cli-ext/v2.48.0/cli-ext-1730425712/cli-ext
instead.
Screenshots or Screencast
DEBU cli-ext: setting up using --cli-ext-path binary
...
error: error in converting sdl to metadata: fork/exec /root/.hasura/cli-ext/v2.48.0/cli-ext-1730425712/cli-ext: no such file or directory
Please provide any traces or logs that could help here.
DEBU cli-ext: setting up using --cli-ext-path binary
...
error: error in converting sdl to metadata: fork/exec /root/.hasura/cli-ext/v2.48.0/cli-ext-1730425712/cli-ext: no such file or directory
Full logs
it says it uses the flag but at the same time go to different path
/hasura-migration-folder # hasura-cli metadata apply --cli-ext-path /usr/local/bin/cli-ext --log-level DEBUG
DEBU global config file exists, verifying contents
DEBU global config is pre-set to &cli.GlobalConfig{UUID:"9500cfc7-2635-48de-908f-92d9d203c9c8", EnableTelemetry:true, ShowUpdateNotification:true, CLIEnvironment:"default"}
DEBU global config: uuid: 9500cfc7-2635-48de-908f-92d9d203c9c8
DEBU global config: enableTelemetry: true
DEBU global config: showUpdateNotification: true
DEBU global config: cliEnvironment: default
DEBU versions: cli: [v2.48.0] server: [v2.48.1]
DEBU compatibility check: [true] compatible CLI and Server
DEBU graphql engine endpoint: http://host.docker.internal:9081
DEBU graphql engine admin_secret: ‹×›
DEBU server: uuid: 71cfd471-cf42-4c98-8570-6b92ae7fc4d6
DEBU cli-ext: setting up using --cli-ext-path binary
DEBU output: command="sdl from"
DEBU telemetry: beamed fields.time=332.366833ms isError=true
DEBU error applying metadata
cannot build actions from project: error parsing metadata
object: actions
file: actions.yaml
error: error in converting sdl to metadata: fork/exec /root/.hasura/cli-ext/v2.48.0/cli-ext-1730425712/cli-ext: no such file or directory: kind="bad input" location="file: /workdir/cli/internal/metadataobject/actions/cli_extension/cli_extension.go, line: 107" ops="[command: hasura metadata apply.RunE commands.MetadataApplyOptions.Run commands.metadataModeDirectoryHandler.Apply commands.errorApplyingMetadata projectmetadata.Handler.V2ApplyMetadata projectmetadata.Handler.BuildJSONMetadata projectmetadata.Handler.buildMetadata projectmetadata.Handler.buildMetadataMap actions.ActionConfig.Build cliextension.Config.ConvertSDLToMetadata]"
FATA[0000] error applying metadata
cannot build actions from project: error parsing metadata
object: actions
file: actions.yaml
error: error in converting sdl to metadata: fork/exec /root/.hasura/cli-ext/v2.48.0/cli-ext-1730425712/cli-ext: no such file or directory:
Any possible solutions/workarounds you're aware of?
None. The number in the path is randomly generated on each execution, so it is not feasible to predict or symlink to it ahead of time.
Keywords
hasura cli, cli-ext, metadata apply, --cli-ext-path ignored, bug, plugin path, fork/exec error