Opencode docker fails to launch in GitLab CI environment #3370

Closed
opened 2026-02-16 17:39:48 -05:00 by yindo · 2 comments
Owner

Originally created by @nagyv on GitHub (Dec 7, 2025).

Description

I'm trying to use OpenCode in GitLab CI for document auto-translation in MR/PR time.

OpenCode version

1.0.134

Steps to reproduce

  1. Set up a free GitLab account + project
  2. Store your OpenCode auth JSON as a masked file-type environment variable with the name OPENCODE_AUTH_JSON
  3. Add the attached .gitlab-ci.yml to your project
  4. Push the code to GitLab

Example .gitlab-ci.yml:

opencode-test:
  stage: test
  image:
    name: ghcr.io/sst/opencode:latest
    entrypoint: [""]
  before_script:
    - mkdir -p ~/.local/share/opencode
    - ln -s $OPENCODE_AUTH_JSON ~/.local/share/opencode/auth.json
  script:
    - opencode run "Who are you?"

Screenshot and/or share link

Logs:

Running with gitlab-runner 18.4.0~pre.246.g71914659 (71914659)
  on green-2.saas-linux-small-amd64.runners-manager.gitlab.com/default ns46NMmJT, system ID: s_85d7af184313
section_start:1765092274:prepare_executor
Preparing the "docker+machine" executor
Using Docker executor with image ghcr.io/sst/opencode:latest ...
Using effective pull policy of [always] for container ghcr.io/sst/opencode:latest
Pulling docker image ghcr.io/sst/opencode:latest ...
Using docker image sha256:7058e719ee58eb29c5cb488e766bafe9c0081cbc2f69c7d3565f72f403e5cc74 for ghcr.io/sst/opencode:latest with digest ghcr.io/sst/opencode@sha256:5aa937e1f5cac0bd6d8232cc908bf22c5d831285d2aa64804789b191622112b6 ...
section_end:1765092280:prepare_executor
section_start:1765092280:prepare_script
Preparing environment
Using effective pull policy of [always] for container sha256:6841d472e36f15cd4dc991bda06b361fb749beaaebf6a6eff4634f3c86050f8f
Running on runner-ns46nmmjt-project-76102130-concurrent-0 via runner-ns46nmmjt-s-l-s-amd64-1765092232-c2beb316...
section_end:1765092282:prepare_script
section_start:1765092282:get_sources
Getting source from Git repository
Gitaly correlation ID: fedbb0a374e9478ab094e327c003a7ab
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/nagyv/fillerissimo/.git/
Created fresh repository.
Checking out 3cbafda3 as detached HEAD (ref is main)...

Skipping Git submodules setup
$ git remote set-url origin "${CI_REPOSITORY_URL}" || echo 'Not a git repository; skipping'
section_end:1765092283:get_sources
section_start:1765092283:step_script
Executing "step_script" stage of the job script
Using effective pull policy of [always] for container ghcr.io/sst/opencode:latest
Using docker image sha256:7058e719ee58eb29c5cb488e766bafe9c0081cbc2f69c7d3565f72f403e5cc74 for ghcr.io/sst/opencode:latest with digest ghcr.io/sst/opencode@sha256:5aa937e1f5cac0bd6d8232cc908bf22c5d831285d2aa64804789b191622112b6 ...
$ mkdir -p ~/.local/share/opencode
$ ln -s $OPENCODE_AUTH_JSON ~/.local/share/opencode/auth.json
$ opencode run "Who are you?"
============================================================
Bun v1.3.3 (274e01c7) Linux x64 (baseline)
Linux Kernel v5.15.154 | musl
CPU: sse42 popcnt avx avx2
Args: "opencode" "--user-agent=opencode/1.0.134" "--" "run" "Who are you?"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(2) jsc shell(8) spawn(3) standalone_executable napi_module_register process_dlopen 
Builtins: "bun:ffi" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node-fetch" 
Elapsed: 2375ms | User: 917ms | Sys: 112ms
RSS: 1.07GB | Peak: 0.20GB | Commit: 1.07GB | Faults: 0 | Machine: 8.34GB

panic(main thread): Segmentation fault at address 0x5F
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.3.3/Ba1274e01cigDz/3/+/B6umgvEi03Xq6sVq2pV+krV2xsV0g0Vo3qV2xsVq2pV+krV2xsVq2pV+krV27qV2xsV8xvVusyVo24Q24nJA2A+F

Illegal instruction (core dumped)
section_end:1765092287:step_script
section_start:1765092287:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1765092287:cleanup_file_variables
ERROR: Job failed: exit code 132

Operating System

No response

Terminal

No response

Originally created by @nagyv on GitHub (Dec 7, 2025). ### Description I'm trying to use OpenCode in GitLab CI for document auto-translation in MR/PR time. ### OpenCode version 1.0.134 ### Steps to reproduce 1. Set up a free GitLab account + project 2. Store your OpenCode auth JSON as a masked file-type environment variable with the name `OPENCODE_AUTH_JSON` 3. Add the attached .gitlab-ci.yml to your project 4. Push the code to GitLab Example .gitlab-ci.yml: ``` opencode-test: stage: test image: name: ghcr.io/sst/opencode:latest entrypoint: [""] before_script: - mkdir -p ~/.local/share/opencode - ln -s $OPENCODE_AUTH_JSON ~/.local/share/opencode/auth.json script: - opencode run "Who are you?" ``` ### Screenshot and/or share link Logs: ``` Running with gitlab-runner 18.4.0~pre.246.g71914659 (71914659)  on green-2.saas-linux-small-amd64.runners-manager.gitlab.com/default ns46NMmJT, system ID: s_85d7af184313 section_start:1765092274:prepare_executor Preparing the "docker+machine" executor Using Docker executor with image ghcr.io/sst/opencode:latest ... Using effective pull policy of [always] for container ghcr.io/sst/opencode:latest Pulling docker image ghcr.io/sst/opencode:latest ... Using docker image sha256:7058e719ee58eb29c5cb488e766bafe9c0081cbc2f69c7d3565f72f403e5cc74 for ghcr.io/sst/opencode:latest with digest ghcr.io/sst/opencode@sha256:5aa937e1f5cac0bd6d8232cc908bf22c5d831285d2aa64804789b191622112b6 ... section_end:1765092280:prepare_executor section_start:1765092280:prepare_script Preparing environment Using effective pull policy of [always] for container sha256:6841d472e36f15cd4dc991bda06b361fb749beaaebf6a6eff4634f3c86050f8f Running on runner-ns46nmmjt-project-76102130-concurrent-0 via runner-ns46nmmjt-s-l-s-amd64-1765092232-c2beb316... section_end:1765092282:prepare_script section_start:1765092282:get_sources Getting source from Git repository Gitaly correlation ID: fedbb0a374e9478ab094e327c003a7ab Fetching changes with git depth set to 20... Initialized empty Git repository in /builds/nagyv/fillerissimo/.git/ Created fresh repository. Checking out 3cbafda3 as detached HEAD (ref is main)... Skipping Git submodules setup $ git remote set-url origin "${CI_REPOSITORY_URL}" || echo 'Not a git repository; skipping' section_end:1765092283:get_sources section_start:1765092283:step_script Executing "step_script" stage of the job script Using effective pull policy of [always] for container ghcr.io/sst/opencode:latest Using docker image sha256:7058e719ee58eb29c5cb488e766bafe9c0081cbc2f69c7d3565f72f403e5cc74 for ghcr.io/sst/opencode:latest with digest ghcr.io/sst/opencode@sha256:5aa937e1f5cac0bd6d8232cc908bf22c5d831285d2aa64804789b191622112b6 ... $ mkdir -p ~/.local/share/opencode $ ln -s $OPENCODE_AUTH_JSON ~/.local/share/opencode/auth.json $ opencode run "Who are you?" ============================================================ Bun v1.3.3 (274e01c7) Linux x64 (baseline) Linux Kernel v5.15.154 | musl CPU: sse42 popcnt avx avx2 Args: "opencode" "--user-agent=opencode/1.0.134" "--" "run" "Who are you?" Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(2) jsc shell(8) spawn(3) standalone_executable napi_module_register process_dlopen Builtins: "bun:ffi" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node-fetch" Elapsed: 2375ms | User: 917ms | Sys: 112ms RSS: 1.07GB | Peak: 0.20GB | Commit: 1.07GB | Faults: 0 | Machine: 8.34GB panic(main thread): Segmentation fault at address 0x5F oh no: Bun has crashed. This indicates a bug in Bun, not your code. To send a redacted crash report to Bun's team, please file a GitHub issue using the link below: https://bun.report/1.3.3/Ba1274e01cigDz/3/+/B6umgvEi03Xq6sVq2pV+krV2xsV0g0Vo3qV2xsVq2pV+krV2xsVq2pV+krV27qV2xsV8xvVusyVo24Q24nJA2A+F Illegal instruction (core dumped) section_end:1765092287:step_script section_start:1765092287:cleanup_file_variables Cleaning up project directory and file based variables section_end:1765092287:cleanup_file_variables ERROR: Job failed: exit code 132 ``` ### Operating System _No response_ ### Terminal _No response_
yindo added the opentuibug labels 2026-02-16 17:39:48 -05:00
yindo closed this issue 2026-02-16 17:39:49 -05:00
Author
Owner

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

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

  • #4970: Since opencode 1.0.116 no longer able to run binary as it crashes with bun seg fault (similar Bun segmentation fault issue)
  • #5175: can not start opencode on ubuntu /tmp does not allow execution of .so (container/restricted environment issues with shared library execution)
  • #4605: OpenTUI appears to not be respecting setting TMPDIR when starting up, leading to failure to initialize OpenTUI library (similar initialization failure in restricted environments)
  • #4794: Crashes on Windows (related Bun segmentation fault)

Feel free to ignore if none of these address your specific case. The core issue appears to be related to Bun's handling of shared libraries in restricted container environments (such as GitLab CI).

@github-actions[bot] commented on GitHub (Dec 7, 2025): This issue might be a duplicate of existing issues. Please check: - #4970: Since opencode 1.0.116 no longer able to run binary as it crashes with bun seg fault (similar Bun segmentation fault issue) - #5175: can not start opencode on ubuntu /tmp does not allow execution of .so (container/restricted environment issues with shared library execution) - #4605: OpenTUI appears to not be respecting setting TMPDIR when starting up, leading to failure to initialize OpenTUI library (similar initialization failure in restricted environments) - #4794: Crashes on Windows (related Bun segmentation fault) Feel free to ignore if none of these address your specific case. The core issue appears to be related to Bun's handling of shared libraries in restricted container environments (such as GitLab CI).
Author
Owner

@nagyv commented on GitHub (Dec 7, 2025):

This is indeed a duplicate of https://github.com/sst/opencode/issues/4970

Downgrading to 1.0.115 makes the given setup work.

Closing.

@nagyv commented on GitHub (Dec 7, 2025): This is indeed a duplicate of https://github.com/sst/opencode/issues/4970 Downgrading to 1.0.115 makes the given setup work. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3370