googleapis/mcp-toolbox · error

when using an OCI driver, use `tnsAdmin` to specify…

Error message

when using an OCI driver, use `tnsAdmin` to specify credentials file location instead

What it means

The OCI driver resolves credentials via tnsAdmin, so a walletLocation is not applicable; when walletLocation is set together with UseOCI true, validate returns this message telling the user to switch to tnsAdmin.

Solutions

  1. Rename walletLocation to tnsAdmin in the config
  2. Or set useOCI: false if you actually want the non-OCI driver with walletLocation
  3. Ensure only one wallet-style field remains after the change

Example fix

// before
kind: oracle
useOCI: true
walletLocation: /wallets/orcl
// after
kind: oracle
useOCI: true
tnsAdmin: /wallets/orcl
Defensive patterns

Strategy: validation

Validate before calling

func ociWalletOK(cfg map[string]any) bool {
    _, wl := cfg["walletLocation"]
    oci, _ := cfg["useOCI"].(bool)
    return !wl || !oci
}

Prevention

When it happens

Trigger: Oracle config has useOCI: true and walletLocation set at the same time.

Common situations: Migrating a non-OCI config to OCI by flipping useOCI without renaming walletLocation to tnsAdmin.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/f4f7eaa50270926f. Report an issue: GitHub.

Appendix: source

Thrown at internal/sources/oracle/oracle.go:93

	}
	if hasHostService {
		connectionMethods++
	}

	if connectionMethods == 0 {
		return fmt.Errorf("must provide one of: 'tns_alias', 'connection_string', or both 'host' and 'service_name'")
	}

	if connectionMethods > 1 {
		return fmt.Errorf("provide only one connection method: 'tns_alias', 'connection_string', or 'host'+'service_name'")
	}

	if hasTnsAdmin && !c.UseOCI {
		return fmt.Errorf("`tnsAdmin` can only be used when `UseOCI` is true, or use `walletLocation` instead")
	}

	if hasWallet && c.UseOCI {
		return fmt.Errorf("when using an OCI driver, use `tnsAdmin` to specify credentials file location instead")
	}

	return nil
}

func (r Config) SourceConfigType() string {
	return SourceType
}

func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {
	db, err := initOracleConnection(ctx, tracer, r)
	if err != nil {
		return nil, fmt.Errorf("unable to create Oracle connection: %w", err)
	}

	err = db.PingContext(ctx)
	if err != nil {
		db.Close()

View on GitHub (pinned to 8cc6e09de2)