#Service start never returns with v0.15.x

1 messages · Page 1 of 1 (latest)

fresh vault
#

In a test I spawn a container asService to test against it. Until dagger v0.14.9 it worked fine, starting with v0.15.0 it gets stuck on service.Start(ctx) and the test never finishes:

// The `test` command creates and starts a vault server instance, creates a new secret and reads it afterwards.
func (m *Tests) Test(ctx context.Context) (error) {
  secretPath := "/secret/test"
  secretKey := fmt.Sprintf("%x", (md5.Sum([]byte(time.Now().String()))))[0:8]
  secretValue := "expected"
  service := m.vaultServer()
  service.Start(ctx)
  endpoint, err := service.Endpoint(ctx)

Full source: https://github.com/puzzle/dagger-module-vault-kv/blob/main/tests/main.go#L26

Do you have any idea why things are different now?

GitHub

Contribute to puzzle/dagger-module-vault-kv development by creating an account on GitHub.

fresh vault
#

Solved - found the breaking change:

Container.asService now uses the command specified by withDefaultArgs instead of the last withExec command

mystic finch
#

@fresh vault upgrading to v0.15.2 will fix this

#

as we released a patch that addresses this issue for backwards compatible services

fresh vault
mystic finch
# fresh vault <@336241811179962368> Sadly, I can not confirm this. It is with v0.15.2 when I f...

interesting.. just tried this reallly quick in v0.15.2 and seems to be working ok for me:

package main

import (
    "dagger/lala/internal/dagger"
)

type Lala struct{}

// Returns lines that match a pattern in the files of the provided Directory

func (m *Lala) Vault() *dagger.Service {
    return dag.Container().
        From("hashicorp/vault:1.17.3").
        WithEnvVariable("VAULT_DEV_LISTEN_ADDRESS", "0.0.0.0:8200").
        WithExposedPort(8200).
        AsService()
}

dagger call vault up

#

as you can see, I'm not using any WithDefaultArgs or WithExec commands

hasty oxide
#

@mystic finch I think the two of you are just talking past each other a bit.
@fresh vault changed from a last WithExec() to WithDefaultArgs here: (https://github.com/puzzle/dagger-module-vault-kv/commit/aaff9219d62ad53bee1145b70d665848ba565cdf).

Which is relevant to their 0.14 -> 0.15.2 upgrade, since no longer support the last WithExec()'s args as the args to the AsService() (since 0.15.0, https://github.com/dagger/dagger/blob/main/CHANGELOG.md#v0150---2024-12-11)

Additionally, Marcos is referring to an issue that hit 0.15.1 users that was fixed in 0.15.2. But since you're coming from 0.14, that doesn't apply here.