Cannot open terminal from opencode web #3620

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

Originally created by @dejan-vasic on GitHub (Dec 17, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Description

:~$ opencode web

                                  
  █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█
  █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀
  ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀     ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀

  Web interface:      http://127.0.0.1:34305/
Failed to load lib 71 | Set BUN_PTY_LIB or ensure one of these paths contains the file.`);
72 | }
73 | var libPath = resolveLibPath();
74 | var lib;
75 | try {
76 |   lib = dlopen(libPath, {
             ^
error: Failed to open library "/tmp/.1ebbff7e77fcfd7a-00000001.so": /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /tmp/.1ebbff7e77fcfd7a-00000001.so)
 syscall: "dlopen",
   errno: 0,
    code: "ERR_DLOPEN_FAILED"

      at dlopen (bun:ffi:345:28)
      at <anonymous> (../../node_modules/.bun/bun-pty@0.4.2/node_modules/bun-pty/dist/index.js:76:9)
      at <anonymous> (/$bunfs/root/src/index.js:28:48)
      at <anonymous> (src/pty/index.ts:36:23)

^C
:~$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.11) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

OpenCode version

1.0.164

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

WSL

Terminal

No response

Originally created by @dejan-vasic on GitHub (Dec 17, 2025). Originally assigned to: @adamdotdevin on GitHub. ### Description ```bash :~$ opencode web   █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█ █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ Web interface: http://127.0.0.1:34305/ Failed to load lib 71 | Set BUN_PTY_LIB or ensure one of these paths contains the file.`); 72 | } 73 | var libPath = resolveLibPath(); 74 | var lib; 75 | try { 76 | lib = dlopen(libPath, { ^ error: Failed to open library "/tmp/.1ebbff7e77fcfd7a-00000001.so": /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /tmp/.1ebbff7e77fcfd7a-00000001.so) syscall: "dlopen", errno: 0, code: "ERR_DLOPEN_FAILED" at dlopen (bun:ffi:345:28) at <anonymous> (../../node_modules/.bun/bun-pty@0.4.2/node_modules/bun-pty/dist/index.js:76:9) at <anonymous> (/$bunfs/root/src/index.js:28:48) at <anonymous> (src/pty/index.ts:36:23) ^C :~$ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3.11) 2.35 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. ``` ### OpenCode version 1.0.164 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System WSL ### Terminal _No response_
yindo added the bugweb labels 2026-02-16 17:40:54 -05:00
Author
Owner

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

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

  • #3045: GLIBC_2.25 Required -> Need An Alternative
  • #4908: GLIBC_2.18' not found (required by opencode)

These issues also report similar GLIBC version compatibility errors on older Linux systems. The root cause appears to be that OpenCode (or its dependencies like bun-pty) is compiled against a newer version of GLIBC than what's available on your system.

Feel free to ignore if your specific case involves the PTY library loading within the web interface, which may be a distinct issue.

@github-actions[bot] commented on GitHub (Dec 17, 2025): This issue might be a duplicate of existing issues. Please check: - #3045: GLIBC_2.25 Required -> Need An Alternative - #4908: GLIBC_2.18' not found (required by opencode) These issues also report similar GLIBC version compatibility errors on older Linux systems. The root cause appears to be that OpenCode (or its dependencies like bun-pty) is compiled against a newer version of GLIBC than what's available on your system. Feel free to ignore if your specific case involves the PTY library loading within the web interface, which may be a distinct issue.
Author
Owner

@remorses commented on GitHub (Dec 30, 2025):

This is a GLIBC version mismatch in bun-pty. The library was built on Ubuntu 24.04 (GLIBC 2.39) but the system has an older version.

Fix PR: https://github.com/sursaone/bun-pty/pull/23

This switches the build to ubuntu-20.04 (GLIBC 2.31) for broader compatibility.

@remorses commented on GitHub (Dec 30, 2025): This is a GLIBC version mismatch in bun-pty. The library was built on Ubuntu 24.04 (GLIBC 2.39) but the system has an older version. Fix PR: https://github.com/sursaone/bun-pty/pull/23 This switches the build to ubuntu-20.04 (GLIBC 2.31) for broader compatibility.
Author
Owner

@Material-Scientist commented on GitHub (Jan 8, 2026):

Still facing this issue on the latest docker image when trying to toggle the terminal in opencode web:

INFO  2026-01-08T17:42:36 +137ms service=default version=1.1.6 args=["--port=3000","--hostname=0.0.0.0","--print-logs","--log-level=DEBUG"] opencode
INFO  2026-01-08T17:42:36 +1ms service=config path=/root/.config/opencode/config.json loading
INFO  2026-01-08T17:42:36 +1ms service=config path=/root/.config/opencode/opencode.json loading
INFO  2026-01-08T17:42:36 +12ms service=config path=/root/.config/opencode/opencode.jsonc loading
ERROR 2026-01-08T17:43:06 +29808ms service=default e=undefined is not an object (evaluating 'array3.length') rejection
ERROR 2026-01-08T17:43:06 +1ms service=default TypeError: undefined is not an object (evaluating 'array3.length')
Failed to load lib  99 | // biome-ignore lint/suspicious/noExplicitAny: <explanation>
100 | let lib: any;
101 | 
102 | // try to load the lib, if it fails log the error
103 | try {
104 | 	lib = dlopen(libPath, {
             ^
error: Failed to open library "/tmp/.fd98d2bfe5febbfc-00000001.so": Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/.fd98d2bfe5febbfc-00000001.so)
 syscall: "dlopen",
   errno: 0,
    code: "ERR_DLOPEN_FAILED"

      at dlopen (bun:ffi:345:28)
      at <anonymous> (../../node_modules/.bun/bun-pty@0.4.4/node_modules/bun-pty/src/terminal.ts:104:8)
      at <anonymous> (/$bunfs/root/src/cli/cmd/tui/worker.js:28:48)
      at <anonymous> (../../node_modules/.bun/bun-pty@0.4.4/node_modules/bun-pty/src/index.ts:6:1)
      at <anonymous> (/$bunfs/root/src/cli/cmd/tui/worker.js:28:48)
      at <anonymous> (src/pty/index.ts:19:23)

Nomad job:

job "opencode" {
  group "opencode" {
    network {
      mode = "bridge"
      port "envoy-metrics" {}
      port "plannotator" {
        static = 9999
        to = 9999
      }
    }
    volume "opencode" {
      type            = "csi"
      read_only       = false
      source          = "opencode"
      access_mode     = "single-node-writer"
      attachment_mode = "file-system"
    }    
    constraint {
      attribute = "${attr.unique.hostname}"
      operator  = "regexp"
      value     = "SMTRL-P05"
    }
    service {
      name     = "opencode"
      port     = "3000"
      meta {
        envoy_metrics_port = "${NOMAD_HOST_PORT_envoy_metrics}" # make envoy metrics port available in Consul
      }
      tags = [
				"traefik.http.routers.opencode.middlewares=https-headers@file",
      ]
      connect {
        sidecar_service {
          proxy {
            transparent_proxy {
              exclude_outbound_ports = [53,8600,443]
              exclude_outbound_cidrs = ["172.26.64.0/20","127.0.0.0/8"]
            }
            expose {
              path {
                path = "/metrics"
                protocol = "http"
                local_path_port = 9102
                listener_port = "envoy-metrics"
              }
            }
          }
        }
      }
      check {
        expose = true
        type     = "http"
        path     = "/global/health"
        interval = "15s"
        timeout  = "1s"
      }
    }
    task "opencode" {
      driver = "docker"
      config {
        image = "ghcr.io/anomalyco/opencode" # latest
        #command = "serve"
        args = [
          "--port=3000",
          "--hostname=0.0.0.0",
          "--print-logs",
          "--log-level=DEBUG"
          #"--mdns=true"
        ]
        volumes = [
          "local/custom-config.json:/root/.config/opencode/opencode.json",
          "local/AGENTS.md:/root/.config/opencode/AGENTS.md",
        ]
      }
      volume_mount {
        volume      = "opencode"
        destination = "/root/.local/share/opencode/storage"
        read_only = false
      }      
      resources {
        cpu = 1024
        memory = 1024
        memory_max = 4096
      }
      template {
        destination = "local/custom-config.json"
        data = <<EOH
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@plannotator/opencode@latest"],
	"mcp": {
    "web-search": {
      "type": "remote",
      "url": "http://n8n.virtual.consul/mcp/8cc2af19-111a-45a5-a282-1548f1ea2892",
      "enabled": true
    }
  },
  "provider": {
    "llama.cpp": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "llama-server (local)",
      "options": {
        "baseURL": "http://local-ai.virtual.consul/v1"
      },
      "models": {
        "gpt-oss-120b-GGUF": {
          "id": "gpt-oss-120b-GGUF",
          "name": "gpt-oss-120b-GGUF",
          "tool_call": true,
          "reasoning": true,
          "limit": {
            "context": 128000,
            "output": 65536
          }
        },
				"Qwen3-8B-128k-GGUF": {
          "id": "Qwen3-8B-128k-GGUF",
          "name": "Qwen3-8B-128k-GGUF",
          "tool_call": true,
          "reasoning": false,
          "limit": {
            "context": 128000,
            "output": 65536
          }
        },
      }
    }
  },
  "model": "llama-server/gpt-oss-120b-GGUF",
  "agent": {
    "build": {
      "description": "Default coding mode with only Opencode tools.",
      "tools": {
        "read": true,
        "write": true,
        "edit": true,
        "bash": true,
        "grep": true,
        "glob": true,
        "list": true,
        "webfetch": true,
        "patch": true,
        "todoread": true,
        "todowrite": true,
        "submit_plan": true
      },
      "prompt": "{file:./AGENTS.md}"
    }
  },
  "instructions": ["AGENTS.md"]
}        
EOH        
      }
      template {
        destination = "local/AGENTS.md"
        data = <<EOH
# Tooling rules for Opencode
- Use Opencode tools only: read, write, edit, list, glob, grep, webfetch, bash, task, todowrite, todoread, submit_plan.
- Do NOT call non-existent tools like Repo_browser.*.
- Prefer `edit` for modifying existing files; use `read` to inspect before editing.
- For any search engine use, utilize the web-search MCP server.
EOH        
      }
      template {
        destination = "secrets/.env"
        env = true
        data = <<EOH
PLANNOTATOR_PORT=9999
PLANNOTATOR_REMOTE=1
#OPENCODE_CONFIG=/path/to/my/custom-config.json
#HTTPS_PROXY=http://username:{{ key "secrets/firecrawl/proxy.pw" }}@192.168.178.87:3128
#https_proxy=http://username:{{ key "secrets/firecrawl/proxy.pw" }}@192.168.178.87:3128        
EOH
      }
    }
  }
}
@Material-Scientist commented on GitHub (Jan 8, 2026): Still facing this issue on the latest docker image when trying to toggle the terminal in opencode web: ``` INFO 2026-01-08T17:42:36 +137ms service=default version=1.1.6 args=["--port=3000","--hostname=0.0.0.0","--print-logs","--log-level=DEBUG"] opencode INFO 2026-01-08T17:42:36 +1ms service=config path=/root/.config/opencode/config.json loading INFO 2026-01-08T17:42:36 +1ms service=config path=/root/.config/opencode/opencode.json loading INFO 2026-01-08T17:42:36 +12ms service=config path=/root/.config/opencode/opencode.jsonc loading ERROR 2026-01-08T17:43:06 +29808ms service=default e=undefined is not an object (evaluating 'array3.length') rejection ERROR 2026-01-08T17:43:06 +1ms service=default TypeError: undefined is not an object (evaluating 'array3.length') Failed to load lib 99 | // biome-ignore lint/suspicious/noExplicitAny: <explanation> 100 | let lib: any; 101 | 102 | // try to load the lib, if it fails log the error 103 | try { 104 | lib = dlopen(libPath, { ^ error: Failed to open library "/tmp/.fd98d2bfe5febbfc-00000001.so": Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /tmp/.fd98d2bfe5febbfc-00000001.so) syscall: "dlopen", errno: 0, code: "ERR_DLOPEN_FAILED" at dlopen (bun:ffi:345:28) at <anonymous> (../../node_modules/.bun/bun-pty@0.4.4/node_modules/bun-pty/src/terminal.ts:104:8) at <anonymous> (/$bunfs/root/src/cli/cmd/tui/worker.js:28:48) at <anonymous> (../../node_modules/.bun/bun-pty@0.4.4/node_modules/bun-pty/src/index.ts:6:1) at <anonymous> (/$bunfs/root/src/cli/cmd/tui/worker.js:28:48) at <anonymous> (src/pty/index.ts:19:23) ``` Nomad job: ```hcl job "opencode" { group "opencode" { network { mode = "bridge" port "envoy-metrics" {} port "plannotator" { static = 9999 to = 9999 } } volume "opencode" { type = "csi" read_only = false source = "opencode" access_mode = "single-node-writer" attachment_mode = "file-system" } constraint { attribute = "${attr.unique.hostname}" operator = "regexp" value = "SMTRL-P05" } service { name = "opencode" port = "3000" meta { envoy_metrics_port = "${NOMAD_HOST_PORT_envoy_metrics}" # make envoy metrics port available in Consul } tags = [ "traefik.http.routers.opencode.middlewares=https-headers@file", ] connect { sidecar_service { proxy { transparent_proxy { exclude_outbound_ports = [53,8600,443] exclude_outbound_cidrs = ["172.26.64.0/20","127.0.0.0/8"] } expose { path { path = "/metrics" protocol = "http" local_path_port = 9102 listener_port = "envoy-metrics" } } } } } check { expose = true type = "http" path = "/global/health" interval = "15s" timeout = "1s" } } task "opencode" { driver = "docker" config { image = "ghcr.io/anomalyco/opencode" # latest #command = "serve" args = [ "--port=3000", "--hostname=0.0.0.0", "--print-logs", "--log-level=DEBUG" #"--mdns=true" ] volumes = [ "local/custom-config.json:/root/.config/opencode/opencode.json", "local/AGENTS.md:/root/.config/opencode/AGENTS.md", ] } volume_mount { volume = "opencode" destination = "/root/.local/share/opencode/storage" read_only = false } resources { cpu = 1024 memory = 1024 memory_max = 4096 } template { destination = "local/custom-config.json" data = <<EOH { "$schema": "https://opencode.ai/config.json", "plugin": ["@plannotator/opencode@latest"], "mcp": { "web-search": { "type": "remote", "url": "http://n8n.virtual.consul/mcp/8cc2af19-111a-45a5-a282-1548f1ea2892", "enabled": true } }, "provider": { "llama.cpp": { "npm": "@ai-sdk/openai-compatible", "name": "llama-server (local)", "options": { "baseURL": "http://local-ai.virtual.consul/v1" }, "models": { "gpt-oss-120b-GGUF": { "id": "gpt-oss-120b-GGUF", "name": "gpt-oss-120b-GGUF", "tool_call": true, "reasoning": true, "limit": { "context": 128000, "output": 65536 } }, "Qwen3-8B-128k-GGUF": { "id": "Qwen3-8B-128k-GGUF", "name": "Qwen3-8B-128k-GGUF", "tool_call": true, "reasoning": false, "limit": { "context": 128000, "output": 65536 } }, } } }, "model": "llama-server/gpt-oss-120b-GGUF", "agent": { "build": { "description": "Default coding mode with only Opencode tools.", "tools": { "read": true, "write": true, "edit": true, "bash": true, "grep": true, "glob": true, "list": true, "webfetch": true, "patch": true, "todoread": true, "todowrite": true, "submit_plan": true }, "prompt": "{file:./AGENTS.md}" } }, "instructions": ["AGENTS.md"] } EOH } template { destination = "local/AGENTS.md" data = <<EOH # Tooling rules for Opencode - Use Opencode tools only: read, write, edit, list, glob, grep, webfetch, bash, task, todowrite, todoread, submit_plan. - Do NOT call non-existent tools like Repo_browser.*. - Prefer `edit` for modifying existing files; use `read` to inspect before editing. - For any search engine use, utilize the web-search MCP server. EOH } template { destination = "secrets/.env" env = true data = <<EOH PLANNOTATOR_PORT=9999 PLANNOTATOR_REMOTE=1 #OPENCODE_CONFIG=/path/to/my/custom-config.json #HTTPS_PROXY=http://username:{{ key "secrets/firecrawl/proxy.pw" }}@192.168.178.87:3128 #https_proxy=http://username:{{ key "secrets/firecrawl/proxy.pw" }}@192.168.178.87:3128 EOH } } } } ```
Author
Owner

@remixer-dec commented on GitHub (Feb 16, 2026):

issue still exists, for desktop app as well

probably related to opencode official docker image being an alpine image:
__tls_get_addr: symbol not found
getauxval: symbol not found
gnu_get_libc_version: symbol not found

@remixer-dec commented on GitHub (Feb 16, 2026): issue still exists, for desktop app as well probably related to opencode official docker image being an alpine image: __tls_get_addr: symbol not found getauxval: symbol not found gnu_get_libc_version: symbol not found
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3620