Skip to content

Opencode docker fails to launch in GitLab CI environment #5191

Closed

Description

@nagyv

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:

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

�[32;1mSkipping Git submodules setup�[0;m
�[32;1m$ git remote set-url origin "${CI_REPOSITORY_URL}" || echo 'Not a git repository; skipping'�[0;m
section_end:1765092283:get_sources
�[0Ksection_start:1765092283:step_script
�[0K�[0K�[36;1mExecuting "step_script" stage of the job script�[0;m�[0;m
�[0KUsing effective pull policy of [always] for container ghcr.io/sst/opencode:latest�[0;m
�[0KUsing docker image sha256:7058e719ee58eb29c5cb488e766bafe9c0081cbc2f69c7d3565f72f403e5cc74 for ghcr.io/sst/opencode:latest with digest ghcr.io/sst/opencode@sha256:5aa937e1f5cac0bd6d8232cc908bf22c5d831285d2aa64804789b191622112b6 ...�[0;m
�[32;1m$ mkdir -p ~/.local/share/opencode�[0;m
�[32;1m$ ln -s $OPENCODE_AUTH_JSON ~/.local/share/opencode/auth.json�[0;m
�[32;1m$ opencode run "Who are you?"�[0;m
============================================================
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
�[0Ksection_start:1765092287:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1765092287:cleanup_file_variables
�[0K�[31;1mERROR: Job failed: exit code 132�[0;m

Operating System

No response

Terminal

No response

Activity

  1. added
    bugSomething isn't working
    on Dec 7, 2025
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 7, 2025
  3. github-actions commented on Dec 7, 2025

    @github-actions
    Contributor

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

    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).

  4. nagyv commented on Dec 7, 2025

    @nagyv
    ContributorAuthor

    This is indeed a duplicate of #4970

    Downgrading to 1.0.115 makes the given setup work.

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions