dagger/dagger · error
get module source subpath: %w
Error message
get module source subpath: %w
What it means
During Python module discovery, a goroutine/errgroup step calls ModSource.SourceSubpath() to learn the module's configured subpath inside its source directory. Failures (connection to the engine, invalid source, engine error) are wrapped as 'get module source subpath' and cancel the whole errgroup.
Source
Thrown at sdk/python/runtime/discovery.go:210
if err := task(ctx, m); err != nil {
return err
}
}
return nil
}
// loadModInfo loads the module's metadata.
func (d *Discovery) loadModInfo(ctx context.Context, m *PythonSdk) error {
eg, gctx := errgroup.WithContext(ctx)
doneSubPath := make(chan struct{})
eg.Go(func() error {
defer close(doneSubPath)
p, err := m.ModSource.SourceSubpath(gctx)
if err != nil {
return fmt.Errorf("get module source subpath: %w", err)
}
d.mu.Lock()
m.SubPath = p
d.mu.Unlock()
return nil
})
eg.Go(func() error {
// m.Source() depends on SubPath
<-doneSubPath
entries, _ := m.Source().Entries(gctx)
d.mu.Lock()
for _, entry := range entries {
d.FileSet[entry] = struct{}{}
}
d.mu.Unlock()
return nil
})View on GitHub (pinned to 82ba2681db)
Solutions
- Read the wrapped inner error for the root cause (e.g. file not found vs RPC failure).
- Verify the module source directory exists and dagger.json's subpath is valid and inside it.
- Re-run from the module root with a fresh engine session.
- If using custom subpath config, correct it with `dagger init` or by editing dagger.json.
Defensive patterns
Strategy: try-catch
Validate before calling
# Shell: confirm the source dir and dagger.json subpath are sane before running
test -d "${MODULE_SOURCE:-.}" && test -f dagger.json || { echo "missing module source/dagger.json"; exit 1; } Try / catch
if err := dagger.Develop(ctx); err != nil {
if strings.Contains(err.Error(), "get module source subpath") {
return fmt.Errorf("check module source dir and dagger.json subpath: %w", err)
}
return err
} Prevention
- Keep the module source directory intact for the lifetime of the session
- Verify dagger.json subpath is inside the source root
- Re-run discovery after moving source directories
When it happens
Trigger: dagger develop / module load on a Python module whose SourceSubpath query fails — typically an engine communication failure, a deleted source directory, or a dagger.json subpath pointing outside the source root.
Common situations: Source directory moved or deleted after the client was created; module configured with an invalid subpath in dagger.json; engine connection dropped mid-discovery.
Related errors
- get module source digest: %w
- no python files found in module source
- no source
- no source
- module provenance: module %q has no source
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/ae1d5cdaff17b2d7.
Report an issue: GitHub.