opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Open code Amd64 Linux appimage fails to launch.

Open DevenBL opened this issue 4 months ago • 14 comments

Description

./opencode-desktop-linux-amd64.AppImage 
"Wayland session detected; forcing X11 backend to avoid compositor protocol errors. Set OC_ALLOW_WAYLAND=1 to keep native Wayland."
Gtk-Message: 14:53:43.126: Failed to load module "canberra-gtk-module"
Gtk-Message: 14:53:43.127: Failed to load module "canberra-gtk-module"
error: Script not found "serve"
Image

Output from copy paste: [STDERR] error: Script not found "serve"

OpenCode version

v1.0.201

Steps to reproduce

run opencode from the terminal ./opencode-desktop-linux-amd64.AppImage

Screenshot and/or share link

Image

Operating System

Gentoo Linux

Terminal

GNOME Terminal

DevenBL avatar Dec 25 '25 19:12 DevenBL

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

  • #5461: Fedora 42 crash to desktop - Similar GTK module loading failure (canberra-gtk-module) and GTK backend initialization errors
  • #6163: Critical regression in OpenCode 1.0.201 - Same version (v1.0.201) with Wayland/X11 backend issues on Linux
  • #5683: Blank screen on opencode desktop on Linux - Desktop app launch failure on Ubuntu
  • #5613: Empty screen on launch - Desktop/TUI blank screen on startup

These issues all relate to Linux desktop/AppImage launch failures, GTK module loading, and Wayland/X11 integration problems. Given that multiple issues mention v1.0.201 as a regression point, this might be worth investigating as a version-specific regression.

Feel free to ignore if your specific case requires unique debugging.

github-actions[bot] avatar Dec 25 '25 19:12 github-actions[bot]

I'm getting the same serve not found error, albeit in a slightly different fashion:

[STDERR] (eval):1: can't change option: zle
[STDERR] (eval):1: can't change option: zle
[STDERR] error: Script not found "serve"

Running: Arch / Wayland / KDE / zsh

lukelukes avatar Dec 25 '25 20:12 lukelukes

These issues all relate to Linux desktop/AppImage launch failures, GTK module loading, and Wayland/X11 integration problems. Given that multiple issues mention v1.0.201 as a regression point, this might be worth investigating as a version-specific regression.

Feel free to ignore if your specific case requires unique debugging.

Tested on v1.0.203 and v1.0.191 Results in the same behavior. It is not version specific.

DevenBL avatar Dec 27 '25 03:12 DevenBL

This issue exists also on version 1.0.185. The appimage created here for version 1.0.185 : https://github.com/pkgforge-dev/opencode-AppImage-Enhanced/releases/tag/1.0.185-1%402025-12-23_1766505110 does not have this problem and runs ok.

plirof avatar Dec 27 '25 21:12 plirof

I'm getting this error too, on Arch (btw). I extracted the AppImage file and ran the opencode-cli binary in squashfs-root/bin/ and it seems that it's just a bun binary not the actual opencode cli binary.

Image

cravenceiling avatar Dec 28 '25 23:12 cravenceiling

In the appimage I replaced /root/bin/OpenCode with the opencode that you can find in eg opencode-linux-x64-baseline_v1.0.204.tar.gz and it worked.

plirof avatar Dec 29 '25 07:12 plirof

In the appimage I replaced /root/bin/OpenCode with the opencode that you can find in eg opencode-linux-x64-baseline_v1.0.204.tar.gz and it worked.

I tried to port it on version 1.0.218 but was unsuccessful. What version is your AppImage?

DonKongPaPa avatar Dec 31 '25 03:12 DonKongPaPa

I did an --appimage-extract and then recreated the appimage with the modification above. I don't know appimage version.

plirof avatar Dec 31 '25 21:12 plirof

@DonKongPaPa I was able to run the desktop app in Arch Linux doing this:

  1. Download the latest version of the appimage (v1.0.223 right now)
wget https://github.com/sst/opencode/releases/download/v1.0.223/opencode-desktop-linux-amd64.AppImage
  1. Extract the appimage
./opencode-desktop-linux-amd64.AppImage --appimage-extract
  1. Change the binary opencode-cli in AppDir/shared/bin with your own binary
cd AppDir/shared/bin
rm opencode-cli
ln -s ~/.opencode/bin/opencode opencode-cli

You could also download the latest binary and use it here

wget https://github.com/sst/opencode/releases/download/v1.0.223/opencode-linux-x64.tar.gz
  1. Run inside AppDir/shared/bin
./OpenCode

I wasn't able to rebuild the appimage even after replacing both opencode-cli binaries in AppDir/bin/ and AppDir/shared/bin/.

cc @rekram1-node

cravenceiling avatar Jan 02 '26 18:01 cravenceiling

m@m-HP-Z440-Workstation:~/Desktop/opencode/AppDir/shared/bin$ AppDir/shared/bin bash: AppDir/shared/bin: No such file or directory m@m-HP-Z440-Workstation:~/Desktop/opencode/AppDir/shared/bin$ cd AppDir/shared/bin bash: cd: AppDir/shared/bin: No such file or directory m@m-HP-Z440-Workstation:~/Desktop/opencode/AppDir/shared/bin$ /OpenCode bash: /OpenCode: No such file or directory m@m-HP-Z440-Workstation:~/Desktop/opencode/AppDir/shared/bin$ ls MiniBrowser opencode-cli WebKitGPUProcess WebKitWebProcess OpenCode opencode-linux-x64.tar.gz WebKitNetworkProcess m@m-HP-Z440-Workstation:~/Desktop/opencode/AppDir/shared/bin$ .//OpenCode bash: /home/m/Desktop/opencode/AppDir/shared/bin/opencode-cli: No such file or directory Received Exit Server not running m@m-HP-Z440-Workstation:~/Desktop/opencode/AppDir/shared/bin$

kmnnmk212-source avatar Jan 04 '26 20:01 kmnnmk212-source

Mostly leaving this here for my future self, but in case anyone else runs into this, the solution to fix it yourself is to download

  • app image opencode-desktop-linux-amd64.AppImage
  • desktop app deb version opencode-desktop-linux-amd64.deb

and then extract appImage

chmod +x opencode-desktop-linux-amd64.AppImage

./opencode-desktop-linux-amd64.AppImage --appimage-extract

now extract deb for desktop executable (ar is not a typo)

ar -x ./opencode-desktop-linux-amd64.deb

tar -xzf data.tar.gz

copy binaries from deb to appImage

cp ./usr/bin/OpenCode ./AppDir/bin/OpenCode
cp ./usr/bin/OpenCode ./AppDir/shared/bin/OpenCode
cp ./usr/bin/opencode-cli ./AppDir/bin/opencode-cli
cp ./usr/bin/opencode-cli ./AppDir/shared/bin/opencode-cli

repackage the appImage

appimagetool ./AppDir

This should result in a working appImage

NikiSkaarup avatar Jan 05 '26 05:01 NikiSkaarup

As has been mentioned it appears that the AppImage's opencode-cli binary is Bun itself, rather than the CLI which is built with Bun. From what I can tell the deb and rpm packages are correct.

Brendonovich avatar Jan 06 '26 09:01 Brendonovich

Yes, the ELF strip step removes the actual application code. From my limited research this is the offending code: https://github.com/tauri-apps/tauri/blob/feat/truly-portable-appimage/crates/tauri-bundler/src/bundle/linux/appimage/sharun.rs#L172

Here was Opus 4.5's explanation:

Bun's `--compile` feature creates standalone executables by:
1. Building a standard ELF binary (the Bun runtime)
2. **Appending** compiled JavaScript bytecode after the ELF data
3. Adding a `---- Bun! ----` trailer signature

When `strip` runs, it:
1. Parses the ELF headers
2. Removes debug symbols
3. **Truncates the file** at the end of ELF sections
4. Destroys the appended Bun bytecode

lukelukes avatar Jan 06 '26 09:01 lukelukes

Hi, a few weeks ago I got requested to package opencode here

The server not found error is a bigger issue related to bun, which I had to fix this way

Samueru-sama avatar Jan 09 '26 10:01 Samueru-sama