{"record":{"id":"f4f7eaa50270926f","repo":"googleapis/mcp-toolbox","slug":"when-using-an-oci-driver-use-tnsadmin-to-specif","errorCode":null,"errorMessage":"when using an OCI driver, use `tnsAdmin` to specify credentials file location instead","messagePattern":"when using an OCI driver, use `tnsAdmin` to specify credentials file location instead","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/oracle/oracle.go","lineNumber":93,"sourceCode":"\t}\n\tif hasHostService {\n\t\tconnectionMethods++\n\t}\n\n\tif connectionMethods == 0 {\n\t\treturn fmt.Errorf(\"must provide one of: 'tns_alias', 'connection_string', or both 'host' and 'service_name'\")\n\t}\n\n\tif connectionMethods > 1 {\n\t\treturn fmt.Errorf(\"provide only one connection method: 'tns_alias', 'connection_string', or 'host'+'service_name'\")\n\t}\n\n\tif hasTnsAdmin && !c.UseOCI {\n\t\treturn fmt.Errorf(\"`tnsAdmin` can only be used when `UseOCI` is true, or use `walletLocation` instead\")\n\t}\n\n\tif hasWallet && c.UseOCI {\n\t\treturn fmt.Errorf(\"when using an OCI driver, use `tnsAdmin` to specify credentials file location instead\")\n\t}\n\n\treturn nil\n}\n\nfunc (r Config) SourceConfigType() string {\n\treturn SourceType\n}\n\nfunc (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {\n\tdb, err := initOracleConnection(ctx, tracer, r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create Oracle connection: %w\", err)\n\t}\n\n\terr = db.PingContext(ctx)\n\tif err != nil {\n\t\tdb.Close()","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/oracle/oracle.go#L75-L111","documentation":"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.","triggerScenarios":"Oracle config has useOCI: true and walletLocation set at the same time.","commonSituations":"Migrating a non-OCI config to OCI by flipping useOCI without renaming walletLocation to tnsAdmin.","solutions":["Rename walletLocation to tnsAdmin in the config","Or set useOCI: false if you actually want the non-OCI driver with walletLocation","Ensure only one wallet-style field remains after the change"],"exampleFix":"// before\nkind: oracle\nuseOCI: true\nwalletLocation: /wallets/orcl\n// after\nkind: oracle\nuseOCI: true\ntnsAdmin: /wallets/orcl","handlingStrategy":"validation","validationCode":"func ociWalletOK(cfg map[string]any) bool {\n    _, wl := cfg[\"walletLocation\"]\n    oci, _ := cfg[\"useOCI\"].(bool)\n    return !wl || !oci\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When enabling useOCI, rename walletLocation to tnsAdmin","Keep only one wallet field per config","Search configs for walletLocation when migrating to OCI","Test wallet-based connections after driver-mode changes"],"tags":["configuration","oracle","wallet","oci"],"backgroundTag":"wallet-config-mismatch","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}