#Stderr? Where'd it go?

1 messages · Page 1 of 1 (latest)

shrewd pelican
#

I have a failing container exec. I see the below error.

step snippet

out, err := ..build query...Exec(dagger.ContainerExecOpts{
            Args: []string{
                "helm",
                "template",
            },
        }).Stderr().Contents(ctx)
log(out)
log(err)

Error

ERRO[0004] input:1: container.from.withMountedDirectory.withWorkdir.exec.stderr.contents process "/_shim helm template" did not complete successfully: exit code: 1

Please visit https://dagger.io/help#go for troubleshooting guidance.

Why can I not get the error from this call to Stderr().Contents() ?

I have to enable full buildkit logging in my dagger client to see the expected output.

// change dagger client to more verbose logging...
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))

Expected output:

#16 helm template
#0 0.113 Error: "helm template" requires at least 1 argument
#0 0.113 
#0 0.113 Usage:  helm template [NAME] [CHART] [flags]
ERRO[0003] input:1: container.from.withMountedDirectory.withWorkdir.exec.stderr.contents process "/_shim helm template" did not complete successfully: exit code: 1
dull zenith
#

there is couple of workarounds to get output of the failed commands.

harsh merlin
#

@shrewd pelican @dull zenith Hey, we just merged a PR yesterday to include stdout/stderr in error returns (without having to enable logging):

https://github.com/dagger/dagger/pull/4161

Will land in the next release, shortly

GitHub

Signed-off-by: Erik Sipsma erik@sipsma.dev
Fixes #3025
I looked a bit into the upcoming build history API in buildkit v0.11 but realized the way its implemented makes it very hard to use for this c...