googleapis/mcp-toolbox · error

unable to get Cloud SQL connection config: %w

Error message

unable to get Cloud SQL connection config: %w

What it means

Error "unable to get Cloud SQL connection config: %w" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/sources/cloudsqlmysql/cloud_sql_mysql.go:251

		pass,
		driverName,
		project,
		region,
		instance,
		dbname,
		connAttrs,
	)
}

func initCloudSQLMySQLConnectionPool(ctx context.Context, tracer trace.Tracer, name, project, region, instance, ipType, user, pass, dbname string, readOnly bool) (*sql.DB, error) {
	//nolint:all // Reassigned ctx
	ctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)
	defer span.End()

	// Configure the driver to connect to the database
	user, pass, useIAM, err := getConnectionConfig(ctx, user, pass)
	if err != nil {
		return nil, fmt.Errorf("unable to get Cloud SQL connection config: %w", err)
	}

	// Create a new dialer with options
	userAgent, err := util.UserAgentFromContext(ctx)
	if err != nil {
		return nil, err
	}
	opts, err := sources.GetCloudSQLOpts(ipType, userAgent, useIAM)
	if err != nil {
		return nil, err
	}

	// Use a unique driver name based on the source name.
	driverName := fmt.Sprintf("cloudsql-mysql-%s", name)

	if !slices.Contains(sql.Drivers(), driverName) {
		if _, err := mysql.RegisterDriver(driverName, opts...); err != nil {
			return nil, fmt.Errorf("unable to register driver: %w", err)

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/sources/cloudsqlmysql/cloud_sql_mysql.go:251 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/820149b47b301897. Report an issue: GitHub.