Title: Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) · Issue #29 · oracle/sql-developer-vscode · GitHub
Open Graph Title: Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) · Issue #29 · oracle/sql-developer-vscode
X Title: Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) · Issue #29 · oracle/sql-developer-vscode
Description: Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) Summary On Windows, creating/saving a database connection intermittently (for us, consistently) fails with a "could not be ...
Open Graph Description: Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) Summary On Windows, creating/saving a database connection intermittently (for us, c...
X Description: Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) Summary On Windows, creating/saving a database connection intermittently (for us, c...
Opengraph URL: https://github.com/oracle/sql-developer-vscode/issues/29
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso)","articleBody":"# Saving a connection fails on Windows: `*.temp` connection folder cannot be renamed (open handle on `credentials.sso`)\n\n## Summary\nOn Windows, creating/saving a database connection intermittently (for us, consistently) fails with a \"could not be created\" error. The extension writes the connection into a `\u003cid>.temp` directory under `%APPDATA%\\DBTools\\connections\\` and then tries to rename it to `\u003cid>` (dropping `.temp`). That final rename fails because the extension/its backend still holds an **open file handle on `credentials.sso`** inside that directory, and Windows does not allow renaming a directory that contains a file with an open handle. A moment later the same rename succeeds, which proves it is a timing/handle-release issue inside the extension, not an environment problem.\n\n## Environment\n- Extension: **Oracle SQL Developer for VS Code 26.1.2** (May 2026)\n- OS: **Windows 11 Pro 10.0.26200**\n- Connection type: **Basic** (host / port / service name), with **Save Password** enabled\n- Windows Defender real-time protection: **on**\n- Controlled Folder Access: **off**\n\n## Exact error message\n```\nError: The resource identified by : \u003cCONN_ID> could not be created due to an unexpected error.\nAn unexpected error occurred during the create operation:\nC:\\Users\\\u003cUSER>\\AppData\\Roaming\\DBTools\\connections\\\u003cCONN_ID>.temp ->\nC:\\Users\\\u003cUSER>\\AppData\\Roaming\\DBTools\\connections\\\u003cCONN_ID>.\nEnsure the resource is correctly formed.\n```\n\n## Steps to reproduce\n1. On Windows, open the Oracle panel → **Create Connection**.\n2. Fill in a Basic connection (name, user, password, host, port, service name) and check **Save Password**.\n3. Click **Save** (or **Test** then **Save**).\n4. The error above appears and the connection is **not** added to the tree.\n\n## Observed state on disk\nAfter a failed save, the connections folder contains a leftover directory with the `.temp` suffix, fully populated:\n\n```\n%APPDATA%\\DBTools\\connections\\\n \u003cCONN_ID>.temp\\\n credentials.sso (~409 bytes)\n dbtools.properties\n ojdbc.properties\n```\n\nThe intended target directory (`\u003cCONN_ID>` without `.temp`) does **not** exist — so this is not a \"target already exists\" collision. Retrying the save produces **additional** `*.temp` directories (they accumulate, one per failed attempt).\n\n## Evidence this is NOT an environment / antivirus / permissions issue\n- **Manual rename works**: renaming `\u003cCONN_ID>.temp` → `\u003cCONN_ID>` by hand (PowerShell/Explorer) succeeds immediately, and the connection then shows up correctly after a window reload.\n- **Rapid rename stress test passes 25/25**: a script that, in the exact same `connections` folder, repeatedly does `mkdir \u003cx>.temp` → write a `credentials.sso` + `dbtools.properties` inside → `rename \u003cx>.temp \u003cx>`, 25 times in a tight loop, succeeded **every time** with zero failures. So the OS/AV has no problem renaming these directories (even with a freshly written `credentials.sso` inside).\n- **Controlled Folder Access is disabled**, so it is not blocking the write/rename.\n\nThe only difference between the passing stress test and the failing extension flow is that the extension still has `credentials.sso` open when it issues the rename.\n\n## Likely root cause\nThe connection save sequence appears to be:\n1. Create `\u003cid>.temp\\`\n2. Write `credentials.sso` (secure wallet) + `dbtools.properties` + `ojdbc.properties`\n3. Rename `\u003cid>.temp` → `\u003cid>`\n\nStep 3 is executed before the handle opened in step 2 (the `.sso` wallet, likely written by the bundled `dbtools`/SQLcl Java backend) is closed/flushed. On Windows, `rename`/`MoveFile` on a directory fails with access-denied while any contained file has an open handle. On POSIX this would succeed, which may be why it is Windows-specific.\n\n## Suggested fix\n- Ensure the `credentials.sso` file handle (and any other handle into the `.temp` directory) is fully closed/flushed before issuing the directory rename.\n- Optionally add a short retry-with-backoff around the rename on Windows, and clean up orphaned `*.temp` directories on next save/startup.\n\n## Current workaround\nA small script that finalizes orphaned connection folders by renaming `*.temp` → final name (retrying a few times until the handle is released). This recovers the connection without re-entering its data.\n\n## Impact\nConnections cannot be saved through the UI on affected Windows setups; users must apply a manual workaround after every save, and `*.temp` directories accumulate under `%APPDATA%\\DBTools\\connections\\`.\n","author":{"url":"https://github.com/davidcarosoltel-source","@type":"Person","name":"davidcarosoltel-source"},"datePublished":"2026-06-16T06:26:38Z","url":"https://github.com/oracle/sql-developer-vscode/issues/29"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8efa93f9-b0bb-1c2c-0500-3f93177369c9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90C8:1B5E62:F97E:14ABA:6B042FDD |
| html-safe-nonce | c78f8ea7edeec3c905c52ea579ae8ca452efaf7445fdb46c7311969b2596f51e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEM4OjFCNUU2MjpGOTdFOjE0QUJBOjZCMDQyRkREIiwidmlzaXRvcl9pZCI6IjU3ODc5NDcyNDg5OTQ0OTY0NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 87ab2b4dd2770636fa24fe5788dca1d6caf37d87203ea80233de0d60a8cb56a8 |
| hovercard-subject-tag | issue:4671651044 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/oracle/sql-developer-vscode/29/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e8180d564f93192df2948c7ef7ebee42687363f989dc854d61443af179de2deb/oracle/sql-developer-vscode/issues/29 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e8180d564f93192df2948c7ef7ebee42687363f989dc854d61443af179de2deb/oracle/sql-developer-vscode/issues/29 |
| og:image:alt | Saving a connection fails on Windows: *.temp connection folder cannot be renamed (open handle on credentials.sso) Summary On Windows, creating/saving a database connection intermittently (for us, c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidcarosoltel-source |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/oracle/sql-developer-vscode git https://github.com/oracle/sql-developer-vscode.git |
| octolytics-dimension-user_id | 4430336 |
| octolytics-dimension-user_login | oracle |
| octolytics-dimension-repository_id | 996875857 |
| octolytics-dimension-repository_nwo | oracle/sql-developer-vscode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 996875857 |
| octolytics-dimension-repository_network_root_nwo | oracle/sql-developer-vscode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width