Error opening file for writing #3613

Open
opened 2026-02-16 17:40:52 -05:00 by yindo · 3 comments
Owner

Originally created by @PierrunoYT on GitHub (Dec 17, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Image
Originally created by @PierrunoYT on GitHub (Dec 17, 2025). Originally assigned to: @adamdotdevin on GitHub. <img width="653" height="459" alt="Image" src="https://github.com/user-attachments/assets/85b95b83-f418-42c2-87a1-272b6fa64681" />
yindo added the windowsweb labels 2026-02-16 17:40:52 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 17, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4374: File system operations fail on windows with azure provider
  • #729: Opencode in linux cannot access tools or create files
  • #3902: File edits not applied - shows diff output only without modifying files
  • #5362: Write Tool includes metadata in output and created filecontent

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 17, 2025): This issue might be a duplicate of existing issues. Please check: - #4374: File system operations fail on windows with azure provider - #729: Opencode in linux cannot access tools or create files - #3902: File edits not applied - shows diff output only without modifying files - #5362: Write Tool includes metadata in output and created filecontent Feel free to ignore if none of these address your specific case.
Author
Owner

@peteretelej commented on GitHub (Dec 19, 2025):

This is an issue impacting upgrade of OpenCode Desktop on Windows.
All the upgrade flows will fail with: Error opening file for writing: with the AppData path for opencode-cli.exe. The impacted flows being: automated update directly on the app itself, or directly installing the new setup to upgrade, or re-installing)

The cause seems to be that those flows don't properly uninstall the existing instance before attempting to add the new one.

Workaround: Uninstall OpenCode using Control Panel and install the new version (download from https://opencode.ai/download) (should clear the previous binaries and allow them to be replaced)

Another option would be to kill the running opencode-cli.exe instance. You'll find the older version running on your Task Manager (but it's called "Bun", you can search for "opencode" in processes to get the correct one. Killing this, will unblock the update if you select Retry.

Actual fix may need a review of the upgrade flow to properly cleanup the existing resources.

@peteretelej commented on GitHub (Dec 19, 2025): This is an issue impacting upgrade of OpenCode Desktop on Windows. All the upgrade flows will fail with: `Error opening file for writing:` with the AppData path for opencode-cli.exe. The impacted flows being: automated update directly on the app itself, or directly installing the new setup to upgrade, or re-installing) The cause seems to be that those flows don't properly uninstall the existing instance before attempting to add the new one. **Workaround**: Uninstall OpenCode using Control Panel and install the new version (download from https://opencode.ai/download) (should clear the previous binaries and allow them to be replaced) Another option would be to kill the running opencode-cli.exe instance. You'll find the older version running on your Task Manager (but it's called "Bun", you can search for "opencode" in processes to get the correct one. Killing this, will unblock the update if you select Retry. Actual fix may need a review of the upgrade flow to properly cleanup the existing resources.
Author
Owner

@rekram1-node commented on GitHub (Dec 19, 2025):

Working through a bunch of windows things, we hope to get this to better state real soon for yall, thanks!

@rekram1-node commented on GitHub (Dec 19, 2025): Working through a bunch of windows things, we hope to get this to better state real soon for yall, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3613