dagger/dagger · error
module requires dagger %s, but you have %s
Error message
module requires dagger %s, but you have %s
What it means
This error means a dagger.json module config declares an SDK version that is not compatible with the currently running Dagger CLI/engine version. checkModuleConfigVersion normalizes the required version and compares it against the CLI's max compatible version; when the module needs a newer (or otherwise incompatible) Dagger release, the CLI refuses to load the module and reports both the required version and the version you actually have.
Source
Thrown at core/modules/config.go:127
}
if err := checkModuleConfigVersion(meta.EngineVersion); err != nil {
return nil, err
}
var modCfg ModuleConfigWithUserFields
if err := json.Unmarshal(src, &modCfg); err != nil {
return nil, fmt.Errorf("failed to decode module config: %w", err)
}
if err := validateLegacyModuleConfigJSON(src); err != nil {
return nil, err
}
return &modCfg, nil
}
func checkModuleConfigVersion(version string) error {
version = engine.NormalizeVersion(version)
if !engine.CheckMaxVersionCompatibility(version, engine.BaseVersion(engine.Version)) {
return fmt.Errorf("module requires dagger %s, but you have %s", version, engine.Version)
}
return nil
}
func MarshalModuleConfigForFilename(modCfg *ModuleConfigWithUserFields, filename string) ([]byte, error) {
return MarshalModuleConfigForFormat(modCfg, ConfigFormatForFilename(filename))
}
func MarshalModuleConfigForFormat(modCfg *ModuleConfigWithUserFields, format ConfigFormat) ([]byte, error) {
var (
out []byte
err error
)
switch format {
case ConfigFormatCurrent:
var buf bytes.Buffer
err = toml.NewEncoder(&buf).
Order(toml.OrderPreserve).View on GitHub (pinned to 82ba2681db)
Solutions
- Upgrade the Dagger CLI to the version (or newer) named in the error message, e.g. run the official install script or your package manager's update
- If upgrading is not possible, lower the module's required version in dagger.json to one compatible with your installed CLI
- Pin a matching dagger version in CI (install the version from the error message) so builds are reproducible
- If the requirement is stale, re-test the module with your current Dagger version and relax the pinned version
Example fix
// dagger.json (before)
{ "sdk": "python", "engineVersion": "v0.15.0" } // CLI is v0.14.x
// after upgrading the CLI: dagger version shows >= v0.15.0, or relax the pin:
{ "sdk": "python", "engineVersion": "v0.14.4" } Defensive patterns
Strategy: validation
Validate before calling
// before loading, compare versions yourself
req := "v0.15.0" // from dagger.json engineVersion
if !engine.CheckMaxVersionCompatibility(engine.NormalizeVersion(req), engine.BaseVersion(engine.Version)) {
fmt.Printf("upgrade dagger CLI to >= %s (you have %s)\n", req, engine.Version)
os.Exit(1)
} Type guard
func isCompatible(required, installed string) bool {
return engine.CheckMaxVersionCompatibility(engine.NormalizeVersion(required), engine.BaseVersion(installed))
} Prevention
- Pin the dagger CLI version in CI to match the module's engineVersion
- Check `dagger version` after any toolchain upgrade
- Keep engineVersion in dagger.json updated together with team-wide CLI upgrades
When it happens
Trigger: Loading any module whose dagger.json sets an sdk version string (e.g. "sdk": "python" with a required engine version, or a pinned engineVersion field) that fails engine.CheckMaxVersionCompatibility against engine.BaseVersion(engine.Version). The check runs in parseCurrentModuleConfigTOML and parseLegacyModuleConfigJSON, so it fires on every module config parse, including legacy JSON configs.
Common situations: A teammate bumped the module's required Dagger version but you haven't upgraded your CLI; cloning a project built against a newer Dagger release; CI runners with a stale dagger binary; switching branches to one that uses a newer SDK/engine requirement.
Related errors
- unknown module config format %q
- failed to decode module config: %w
- cannot unmarshal into nil SDK
- unmarshal sdk as string: %w
- unmarshal sdk as struct: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/80c62d141c652dc4.
Report an issue: GitHub.