vitessio/vitess · error
package %s is not under %s
Error message
package %s is not under %s
What it means
ci-config's pkgDir maps a package import path from the CI config into a directory under the repo root by stripping the module prefix (e.g. vitess.io/vitess/). If the import path doesn't start with that prefix, it cannot be resolved to a directory and this error is returned. It guards against misconfigured package entries in the CI config.
Source
Thrown at go/tools/ci-config/check.go:112
sort.Strings(names)
for _, name := range names {
if prev, ok := firstSeen[name]; ok {
problems = append(problems, fmt.Sprintf("duplicate entry %q defined in both %s and %s", name, prev, path))
} else {
firstSeen[name] = path
}
entries = append(entries, entry{configFile: path, name: name, test: config.Tests[name]})
}
}
return entries, problems
}
// pkgDir maps a package import path from a config entry to a directory
// under root.
func pkgDir(root, importPath string) (string, error) {
rel, ok := strings.CutPrefix(importPath, modulePrefix)
if !ok {
return "", fmt.Errorf("package %s is not under %s", importPath, modulePrefix)
}
return filepath.Join(root, filepath.FromSlash(rel)), nil
}
// listTests returns the names of all top-level test functions declared in
// the *_test.go files of dir, sorted and deduplicated. It mirrors how cmd/go
// discovers tests (isTestFunc/isTest in cmd/go/internal/load/test.go):
// internal and external test packages both count, TestMain(m *testing.M) is
// the test entrypoint rather than a test, and a TestMain(t *testing.T) is a
// regular test. Build constraints are deliberately ignored: CI runs on
// linux, and a tag-guarded orphan still deserves triage.
func listTests(dir string) ([]string, error) {
dirEntries, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
fset := token.NewFileSet()
seen := make(map[string]bool)View on GitHub (pinned to 01a25a7d17)
Solutions
- Check the import path in the config entry and ensure it starts with the Vitess module prefix (vitess.io/vitess/)
- Fix typos (e.g. vitessio vs vitess.io) and remove any paths belonging to external modules
- Use a relative package path under go/ if the tool expects paths relative to root instead of full imports
- Verify by running the ci-config tool locally after the edit
Example fix
// before (config entry) package: go/vt/vtgate/... // after package: vitess.io/vitess/go/vt/vtgate/...
Defensive patterns
Strategy: validation
Validate before calling
const modulePrefix = "vitess.io/vitess/"
func validatePkgEntry(importPath string) error {
if !strings.HasPrefix(importPath, modulePrefix) {
return fmt.Errorf("config entry %q must start with %q", importPath, modulePrefix)
}
return nil
} Try / catch
dir, err := pkgDir(root, importPath)
if err != nil {
return fmt.Errorf("fix ci config entry %q: %w", importPath, err)
} Prevention
- Always write config package entries as full vitess.io/vitess/... import paths
- Never reference packages from other modules in CI config entries
- Run the ci-config tool locally before committing workflow/config changes
When it happens
Trigger: A config entry in .github/workflows or the ci-config input lists a package import path that does not begin with the module's prefix — e.g. `golang.org/x/tools/...`, a typo like `vitessio/vitess/go/vt/...`, or an absolute file path instead of an import path.
Common situations: Editing go/test/endtoend or workflow CI config and typing the import path by hand; adding a package from a dependency module instead of the vitess module; renaming the module path without updating config entries.
Related errors
- range %d should be >= %d
- UnescapeID err: invalid input identifier '%s'
- unknown handling name %s
- failed to generate vtgate consul datacenter from template: %
- failed to parse vtgate FQDN template %s: %w
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/ba1a0987dbf69746.
Report an issue: GitHub.