t8y2/dbx · error
SHOW DATABASES failed (%v); HiveServer2 metadata fallback fa
Error message
SHOW DATABASES failed (%v); HiveServer2 metadata fallback failed: %w
What it means
listDatabases first tries 'SHOW DATABASES' via direct SQL; if that fails it falls back to the HiveServer2 JDBC metadata API (GetHiveSchemas). This error is produced only when BOTH paths fail, wrapping the original SHOW DATABASES error (%v) and the metadata fallback error (%w). It means the driver could not enumerate databases at all.
Source
Thrown at agents/drivers/argo-go/metadata.go:242
"productVersion": version,
"unquotedIdentifierCase": "mixed",
"quotedIdentifierCase": "mixed",
"driverName": driverName,
"driverVersion": "gohive-v2.1.0",
},
}, nil
}
func (server *server) listDatabases() ([]databaseInfo, error) {
result, err := server.executeQuery(queryOptions{SQL: "SHOW DATABASES", MaxRows: metadataQueryLimit})
if err == nil {
return databaseInfoFromQueryRows(result.Rows), nil
}
metadataResult, metadataErr := server.hiveMetadata(func(ctx context.Context, provider gohive.MetadataProvider) (gohive.MetadataResult, error) {
return provider.GetHiveSchemas(ctx, "%")
})
if metadataErr != nil {
return nil, fmt.Errorf("SHOW DATABASES failed (%v); HiveServer2 metadata fallback failed: %w", err, metadataErr)
}
rows := newHiveMetadataRows(metadataResult)
values := make([]databaseInfo, 0, len(rows.rows))
seen := map[string]bool{}
for _, row := range rows.rows {
name := metadataString(rows.value(row, "TABLE_SCHEM", "SCHEMA_NAME"))
if name == "" || seen[name] {
continue
}
seen[name] = true
values = append(values, databaseInfo{Name: name})
}
sort.Slice(values, func(first, second int) bool { return values[first].Name < values[second].Name })
return values, nil
}
func databaseInfoFromQueryRows(rows [][]any) []databaseInfo {
values := make([]databaseInfo, 0, len(rows))View on GitHub (pinned to c0390bff16)
Solutions
- Re-run SHOW DATABASES manually as the same user to see the root cause error in the (%v) portion.
- Check the user's privileges to list databases/schemas on the HiveServer2 instance.
- Reconnect — the fallback often fails because the underlying session died; test_connection to verify connectivity.
- If SHOW DATABASES is unsupported by the backend, verify this agent targets ArgoDB; use the hive-go driver for vanilla Hive/Kyuubi/Impala.
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-flight: confirm the connection can run trivial queries and the user can list databases.
if _, err := server.executeQuery(queryOptions{SQL: "SELECT 1", MaxRows: 1}); err != nil {
return fmt.Errorf("connection not usable before listing databases: %w", err)
} Try / catch
dbs, err := server.listDatabases()
if err != nil {
var cause error
if errors.As(err, &cause) {
log.Printf("listDatabases failed; wrapped cause: %v", cause)
}
// treat as connectivity/permission problem: surface both causes to the operator
return fmt.Errorf("cannot enumerate databases; check privileges and HiveServer2 health: %w", err)
} Prevention
- Verify the connecting user has privileges to list databases/schemas before building features on top.
- Call test_connection before metadata operations to catch dead sessions early.
- Run SHOW DATABASES manually as the same user when onboarding a new role or service account.
- Use the argo agent only for ArgoDB backends; route vanilla Hive/Kyuubi/Impala to hive-go.
When it happens
Trigger: Calling the 'metadata'/list_databases dispatch method when the server rejects 'SHOW DATABASES' (syntax not supported, insufficient privileges) AND the HiveServer2 GetHiveSchemas metadata call also fails (connection dropped, unsupported catalog, permission denied).
Common situations: Connecting to non-Hive backends (Kyuubi/Impala variants or restricted ArgoDB roles) where SHOW DATABASES is denied; stale connections after HiveServer2 restart; user lacking schema-list privileges; network interruption mid-metadata call.
Related errors
- HiveServer2 metadata failed (%v); %s fallback failed: %w
- HiveServer2 metadata failed (%v); DESCRIBE fallback failed:
- HiveServer2 table comment metadata failed (%v); table listin
- HiveServer2 metadata failed (%v); %s fallback failed: %w
- HiveServer2 table comment metadata failed (%v); table listin
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/ee96d9ea9f1af7da.
Report an issue: GitHub.