t8y2/dbx · error
package not found: %s.%s
Error message
package not found: %s.%s
What it means
xuguPackageSpec looks up a stored package's specification in the system metadata views (case-folded lookup by schema and package name). When no row matches, completion-assisted package member search aborts with this error because there is no package to enumerate members for.
Source
Thrown at agents/drivers/xugu/package_members.go:121
if !rows.Next() {
return "", false, rows.Err()
}
var spec sql.NullString
if err := rows.Scan(&spec); err != nil {
return "", false, err
}
return spec.String, true, nil
}
if spec, found, err := query(xuguPackageSpecSQL, schema, packageName); err != nil || found {
return spec, err
}
if spec, found, err := query(xuguPackageSpecCaseFoldedSQL, schema, packageName, schema, packageName); err != nil {
return "", err
} else if found {
return spec, nil
}
return "", fmt.Errorf("package not found: %s.%s", schema, packageName)
}
func xuguCompletionRequestsRoutines(kinds []string) bool {
if len(kinds) == 0 {
return false
}
for _, kind := range kinds {
switch strings.ToLower(strings.TrimSpace(kind)) {
case "routine", "procedure", "function":
return true
}
}
return false
}
func xuguCompletionRoutineKinds(kinds []string) map[string]bool {
allowed := map[string]bool{}
for _, kind := range kinds {View on GitHub (pinned to c0390bff16)
Solutions
- Check the package exists in the schema with exact (or any-case, lookup is case-folded) name.
- Fully qualify as schema.package and confirm the schema is the one the package was created in.
- Grant the connecting user read access to the package metadata views.
- Refresh/reconnect in case the package was recently dropped or created after the session's metadata cache.
Example fix
// before
xuguPackageSpec("app", "pkg_orders") // package is actually PKG_ORDER
// after
xuguPackageSpec("app", "pkg_order") Defensive patterns
Strategy: validation
Validate before calling
func packageExists(ctx context.Context, q Queryer, schema, pkg string) (bool, error) {
var n int
err := q.QueryRowContext(ctx,
"SELECT COUNT(*) FROM all_packages WHERE owner = ? AND package_name = ?",
schema, pkg).Scan(&n)
return n > 0, err
} Try / catch
spec, err := xuguPackageSpec(schema, pkg)
if err != nil {
if strings.HasPrefix(err.Error(), "package not found: ") {
return nil, fmt.Errorf("no package %s.%s visible to this connection", schema, pkg)
}
return nil, err
} Prevention
- Verify package existence with a catalog query before requesting member completion.
- Keep the connecting user's metadata grants current.
- Refresh metadata after DDL changes (drop/create package) in long-lived sessions.
When it happens
Trigger: Invoking completionAssistantSearchPackageMembers with a schema.packageName that the case-folded lookup query cannot find — package does not exist, is in another schema, or the user cannot see its metadata rows.
Common situations: Autocompletion in a SQL editor against a misspelled package name, connecting with restricted credentials that filter out the package from ALL_PACKAGES-style views, or the package was dropped while the editor session was open.
Related errors
- routine source is not supported for %s connections
- list custom types in schema %q: %w
- failed to locate custom type %s.%s: %w
- failed to read type %s.%s: %w
- failed to read enum values: %w
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/b78d3db28d805042.
Report an issue: GitHub.