#Issues Building a Dockerfile After v0.18.3

1 messages ยท Page 1 of 1 (latest)

steel hemlock
#

Hi everyone,

I've noticed that after v0.18.3, an error occurs when I build a container from a Dockerfile and pass it to a function from another module.

Example:

Main module:

// Create a base container that builds from a Dockerfile
func (m *NotWorking) BaseContainer() *dagger.Container {
    return dag.Container().Build(
        dag.CurrentModule().Source().Directory("."),
        dagger.ContainerBuildOpts{
            Dockerfile: "./nw.Dockerfile",
        })
}

// Call a function from the other module
func (m *NotWorking) SayHello(ctx context.Context) string {
    ctr := m.BaseContainer()
    out, err := dag.OtherModule().ContainerEcho(ctr).Stdout(ctx)
    if err != nil {
        return "Error calling OtherModule: " + err.Error()
    }
    return out
}

Then, OtherModule has the function defined like this:

func (m *OtherModule) ContainerEcho(ctr dagger.Container) *dagger.Container {
    return ctr.WithExec([]string{"echo", "Hello, World!"})
}

When I run this using dagger call -m git@github.com:JCastillo07/dagger_example.git/not-working@main say-hello it only works for versions < v0.18.3

Here's the error I see when using SSH:

unexpected status 200: get or init client: initialize client: failed to add client resources from ID: failed to add socket from source client ru9q6qk65gncr9d1oerdvyjz8: socket xxh3:e0d8b8180e297a69 not found in other store

failed to return error: get or init client: initialize client: failed to add client resources from ID: failed to add socket from source client ru9q6qk65gncr9d1oerdvyjz8: socket xxh3:e0d8b8180e297a69 not found in other store

original error: get parent name: get or init client: initialize client: failed to add client resources from ID: failed to add socket from source client ru9q6qk65gncr9d1oerdvyjz8: socket xxh3:e0d8b8180e297a69 not found in other store

Here's the public repo with the example to reproduce this error: https://github.com/JCastillo07/dagger_example

Thanks!

GitHub

This repository was created to show an example of a dagger issue with GitHub runners - JCastillo07/dagger_example

amber aurora
amber aurora
#

@steel hemlock can you try removing your dagger engine via docker rm -fv $engine and try again? I can't repro in v0.18.14, your example works ok here

amber aurora
#

^ as you can see, it works there

surreal tide
amber aurora
steel hemlock
amber aurora
#

ok, yes. I was able to repro. Title says that this started happening after v0.18.3!! so yeah.. seems like it has been broken for a while. Let us investigate a bit more tomorrow given that we have to go back quite a bit to understand what caused the breakage ๐Ÿ™

amber aurora
#

also confirmed that v0.18.2 was when this last worked and also that the error also happens even when using compat mode. So something changed between v0.18.2 and v0.18.3 which broke this. We'll have to bisect and find the offending commit ๐Ÿ™

amber aurora
#

running the dagger call with the module described here (#1397307050886828153 message) reproduces the error. Tried to come up with a simpler local repro but couldn't think of anything ๐Ÿค”

amber aurora
#

@surreal tide as mentioned above, seems like for some reason the error seems to be coming from the dag.CurrentModule call. Not sure how worth it is for this specific bug to invest time in pursuing it specially when a big part of the Dockerbuild logic is about to change soon ๐Ÿ‘€