garden
garden copied to clipboard
Crash: Custom commands cause crash in `garden dev` shell: Missing cli argument in custom command wrapper.
Garden Bonsai (0.13) Bug
Current Behavior
Custom commands that use gardenCommand
do not work in dev mode and throw an error:
Missing cli argument in custom command wrapper.
This is a bug. Please report it!
Expected behavior
Custom garden commands should work just fine in dev mode.
Reproducible example
Workaround
Use following commands.garden.yml
and try to run c
in dev mode.
kind: Command
name: echo
description:
short: Just echo a string
exec:
command:
- sh
- -c
- echo "hello world"
---
kind: Command
name: c
description:
short: Run validate cmd
gardenCommand:
- validate
garden version
: 0.13.2
Draft PR for this: https://github.com/garden-io/garden/pull/4679
However, that doesn't address the issue properly and breaks the rendering of logs in dev REPL. The custom command wrapper performs a full run of garden command via GardenCli.run() and that initializes the logger multiple times. This needs to be addressed more carefully.
Until this is fixed, the workaround is to use custom garden command outside dev mode.
Might be related to https://github.com/garden-io/garden/issues/4116
I hit this bug.
Error: Missing cli argument in custom command wrapper.
at CustomCommandWrapper.action (/snapshot/pkg/core/build/src/commands/custom.js:164:23)
at /snapshot/pkg/core/build/src/commands/base.js:213:41
at async /snapshot/pkg/core/build/src/util/open-telemetry/spans.js:46:20
We have a custom uproot
command that behaves like delete services
used to (it doesn't remove PersistentVolumeClaim
s); I tried running the command from the interactive console (launched by garden deploy
— the deploy was completed).