#Cache issues started with 0.3.12

1 messages · Page 1 of 1 (latest)

steady charm
#

My use case is to use dagger in tests, my environment is docker-in-docker, i copied some ideas from internal/mage/util but now i have some issues like this:

from "dagger":

EOF: 2023/02/10 09:35:34 http2: server connection error from localhost: connection error: PROTOCOL_ERROR
Error: failed to solve: unknown cache exporter: "dagger"

from buidlkit

time="2023-02-10T09:13:45Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = unknown cache exporter: "dagger""

I started dagger-engine in this way:

docker run --net=host -d --restart always --name dagger-engine.ci --privileged ghcr.io/dagger/engine:v0.3.12

I know there is an environment variable called _EXPERIMENTAL_DAGGER_CACHE_CONFIG.

hushed nexus
steady charm
# hushed nexus Hi Alvise, Good to see you back 😇 Can you please try to remove all instances of...

In my dind environment (vscode devcontainer) i can run my tests; what i am trying to do is to test my dagger packages like "dagger in dagger". For example i create a function to check quality of code that use dagger and i want to run tests in this way: ```func (u Universe) test(ctx context.Context, race bool) error {
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
return err
}
defer client.Close()

sshKey, ok := os.LookupEnv("SSH_KEY")

if !ok {
    return errors.New("ssh key must be provided")
}

client = client.Pipeline("universe").Pipeline("test")

cgoEnabledEnv := "0"
args := []string{"go", "test", "-p", "16", "-v", "-count=1"}
if race {
    args = append(args, "-race", "-timeout=1h")
    cgoEnabledEnv = "1"
}
args = append(args, "./...")

output, err := util.GoBase(client).
    WithMountedDirectory("/app", util.Repository(client)). // need all the source for extension tests
    WithWorkdir("/app").
    WithEnvVariable("CGO_ENABLED", cgoEnabledEnv).
    WithMountedDirectory("/root/.docker", util.HostDockerDir(client)).
    WithEnvVariable("SSH_KEY", sshKey).
    WithExec(args).
    // WithExec([]string{"go", "test", "-v", "./..."}).
    Stdout(ctx)

if err != nil {
    return err
}
fmt.Println(output)
return nil

}```

#

Dagger team use mage dagger:dev in github action, but even in this case tests can start but they failed due to dagger exporter

steady charm
#

Sure, i changed my wslconfig just yesterday, let me check

hushed nexus
#

<== this one sorry

steady charm
#

Stopping dagger-engine container the error is quite different

#

In my local env i can do this: ```docker run --net=host -d --restart always --name dagger-engine.ci --privileged ghcr.io/dagger/engine:v0.3.12

export _EXPERIMENTAL_DAGGER_CLI_BIN=$(which dagger)
export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-container://dagger-engine.ci
go test -v ./...```

#

but mage universe:test does not work

grand kayak
#

@steady charm did you verify your dagger CLI is also v0.3.12?

#

does it also happen if you let the SDK run the dagger engine for you?

steady kestrel
#

The new cache backend was merged after the 0.3.12 release, so if you are seeing that behavior your CLI is most likely a build off our main branch, let us know if that’s not the case though

grand kayak
#

@steady kestrel opened an issue to track this in case there's an action item in our event to warn users about this: https://github.com/dagger/dagger/issues/4583. Couldn't find an opened one but I might missed it 🙏. Feel free to close if it's a dupe

steady charm
#

Hi, this morning i destroy and recreate my dev environment and it started working. I built dagger cli from main, when i saw the error i switched to tagged version, i don't know what really happened. I saw the new remote cache code, for now i can recreate from the beginning.