[Bug] Opencode crashes on second run in Termux/Proot distro #2081

Open
opened 2026-02-16 17:34:03 -05:00 by yindo · 7 comments
Owner

Originally created by @Ritusmin325k on GitHub (Oct 13, 2025).

Originally assigned to: @rekram1-node on GitHub.

Describe the bug
Opencode runs fine the first time, but when I try to open it a second time in Termux (any Proot distro), it fails with the following message:

Error: Unexpected error, check log file at /root/.local/share/opencode/log/.log for more details

To Reproduce
Steps to reproduce the behavior:

  1. Install Opencode in Termux with any Proot distro.
  2. Run opencode for the first time — it works normally.
  3. Close Opencode.
  4. Run opencode again.
  5. Observe the unexpected error.

Expected behavior
Opencode should open and run correctly on subsequent launches as well.

Screenshots/Logs
The error log is located at: /root/.local/share/opencode/log/<timestamp>.log
(Attach log content if possible.)

Environment:

  • OS: Termux (any Proot distro)
  • Opencode version: latest version
  • Node/npm version: latest version

Additional context
This issue only occurs on the second and subsequent runs, not on the first launch. It might be related to session, cache, or file handling between runs.

Image
Originally created by @Ritusmin325k on GitHub (Oct 13, 2025). Originally assigned to: @rekram1-node on GitHub. **Describe the bug** Opencode runs fine the first time, but when I try to open it a second time in Termux (any Proot distro), it fails with the following message: Error: Unexpected error, check log file at /root/.local/share/opencode/log/<timestamp>.log for more details **To Reproduce** Steps to reproduce the behavior: 1. Install Opencode in Termux with any Proot distro. 2. Run `opencode` for the first time — it works normally. 3. Close Opencode. 4. Run `opencode` again. 5. Observe the unexpected error. **Expected behavior** Opencode should open and run correctly on subsequent launches as well. **Screenshots/Logs** The error log is located at: `/root/.local/share/opencode/log/<timestamp>.log` (Attach log content if possible.) **Environment:** - OS: Termux (any Proot distro) - Opencode version: latest version - Node/npm version: latest version **Additional context** This issue only occurs on the second and subsequent runs, not on the first launch. It might be related to session, cache, or file handling between runs. <img width="720" height="1600" alt="Image" src="https://github.com/user-attachments/assets/d92001c6-5ecf-4c8b-a689-295cde754dce" />
Author
Owner

@github-actions[bot] commented on GitHub (Oct 13, 2025):

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

  • #387: Very similar "Error: Unexpected error, check log file at" message with detailed logs showing crash patterns
  • #961: General Termux support request indicating ongoing compatibility issues
  • #709: Specific Termux installation and execution problems with error messages about missing files

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

@github-actions[bot] commented on GitHub (Oct 13, 2025): This issue might be a duplicate of existing issues. Please check: - #387: Very similar "Error: Unexpected error, check log file at" message with detailed logs showing crash patterns - #961: General Termux support request indicating ongoing compatibility issues - #709: Specific Termux installation and execution problems with error messages about missing files Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 13, 2025):

Can you show what the error log says? Maybe drop the file if possible?

@rekram1-node commented on GitHub (Oct 13, 2025): Can you show what the error log says? Maybe drop the file if possible?
Author
Owner

@Ritusmin325k commented on GitHub (Oct 14, 2025):

Can you show what the error log says? Maybe drop the file if possible?

Here's the log file
2025-10-14T081251.log

@Ritusmin325k commented on GitHub (Oct 14, 2025): > Can you show what the error log says? Maybe drop the file if possible? Here's the log file [2025-10-14T081251.log](https://github.com/user-attachments/files/22900256/2025-10-14T081251.log)
Author
Owner

@621625 commented on GitHub (Dec 11, 2025):

I also cannot get opencode to run in Termux, neither in vanilla Termux nor proot (arch).

@621625 commented on GitHub (Dec 11, 2025): I also cannot get opencode to run in Termux, neither in vanilla Termux nor proot (arch).
Author
Owner

@michaelphagen commented on GitHub (Jan 6, 2026):

For reference, it seems to run again if you delete ~/.cache/opencode/version. I'm just deleting that before each run

@michaelphagen commented on GitHub (Jan 6, 2026): For reference, it seems to run again if you delete ~/.cache/opencode/version. I'm just deleting that before each run
Author
Owner

@pabloXDXDXD commented on GitHub (Jan 9, 2026):

@michaelphagen I tried and it still doesn't work.

@pabloXDXDXD commented on GitHub (Jan 9, 2026): @michaelphagen I tried and it still doesn't work.
Author
Owner

@danielpcampagna commented on GitHub (Feb 4, 2026):

Also, my first time has taken too long time to start up

@danielpcampagna commented on GitHub (Feb 4, 2026): Also, my first time has taken too long time to start up
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2081