googleapis/mcp-toolbox · error
password is provided without a username. Please provide both
Error message
password is provided without a username. Please provide both a username and password, or leave both fields empty
What it means
Error "password is provided without a username. Please provide both a username and password, or leave both fields empty" thrown in googleapis/mcp-toolbox.
Source
Thrown at internal/sources/cloudsqlmysql/cloud_sql_mysql.go:201
}
return out, nil
}
func getConnectionConfig(ctx context.Context, user, pass string) (string, string, bool, error) {
useIAM := true
// If username and password both provided, use password authentication
if user != "" && pass != "" {
useIAM = false
return user, pass, useIAM, nil
}
// If username is empty, fetch email from ADC
// otherwise, use username as IAM email
if user == "" {
if pass != "" {
return "", "", useIAM, fmt.Errorf("password is provided without a username. Please provide both a username and password, or leave both fields empty")
}
email, err := sources.GetIAMPrincipalEmailFromADC(ctx, "mysql")
if err != nil {
return "", "", useIAM, fmt.Errorf("error getting email from ADC: %v", err)
}
user = email
}
// Pass the user, empty password and useIAM set to true
return user, pass, useIAM, nil
}
func buildDSN(user, pass, driverName, project, region, instance, dbname, userAgent string, useIAM, readOnly bool) string {
connAttrs := fmt.Sprintf("program_name:%s", url.QueryEscape(userAgent))
if readOnly {
connAttrs += ",read_only_connection:true"
}
View on GitHub (pinned to 8cc6e09de2)
When it happens
Trigger: Thrown at internal/sources/cloudsqlmysql/cloud_sql_mysql.go:201 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/ef2ab68da7579a1d.
Report an issue: GitHub.