Skip to content

fix: resolve nginx shared memory error and missing join import#58

Merged
dwgx merged 1 commit intodwgx:masterfrom
abwuge:master
Apr 25, 2026
Merged

fix: resolve nginx shared memory error and missing join import#58
dwgx merged 1 commit intodwgx:masterfrom
abwuge:master

Conversation

@abwuge
Copy link
Copy Markdown
Contributor

@abwuge abwuge commented Apr 25, 2026

改了什么 / What changed

  • nginx.confupstream windsurf_backend 块中添加 zone 指令,分配共享内存区域
  • src/config.js 顶部补充 import { join } from 'path'; 语句

为什么 / Why

修复部署后所有 Windsurf 相关容器(windsurf-lb 和三个 windsurfapi-windsurf-api 副本)持续重启的问题。

  • Nginx:当 upstream 中使用 server … resolve 动态解析后端地址时,Nginx 要求通过 zone 指令显式分配共享内存,否则报错 resolving names at run time requires upstream … to be in shared memory
  • API 服务config.js 中直接使用了 join(),但未从 path 模块导入,导致 ReferenceError: join is not defined,进程启动失败

这么简单的问题,难道没人用docker吗?

测试 / Testing

docker-compose up --build -d后所有容器状态正常,不再处于 Restarting 循环

Checklist

  • 代码风格和现有文件一致 / Code style matches existing files
  • 没有引入 npm 依赖 / No new npm dependencies (project is zero-dep)
  • 涉及 LS binary 协议改动时 在 PR 描述里注明字段号来源 / If touching LS protocol, document field-number source in the PR description
  • 涉及 dashboard UI 用 App.confirm / App.prompt 不用浏览器原生 alert/confirm / Uses App.confirm / App.prompt, not native dialogs (if dashboard)

Copilot AI review requested due to automatic review settings April 25, 2026 11:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes deployment-time container restart loops by addressing two startup errors: Nginx upstream DNS re-resolution requiring shared memory, and a missing join() import in the Node config.

Changes:

  • Add an Nginx zone to the upstream windsurf_backend block to enable runtime DNS resolution with resolve.
  • Import join from path in src/config.js to prevent ReferenceError: join is not defined.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/config.js Adds missing join import used to build replica-isolated dataDir.
nginx.conf Adds shared-memory zone required for server ... resolve in upstream.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nginx.conf
# or we rely on ip_hash for generic load balancing if behind a single reverse proxy.
server windsurf-api:3003 resolve;
zone windsurf_backend_zone 64k;
server windsurf-api:3003 resolve;
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server windsurf-api:3003 resolve; line is indented with a tab while the rest of this file uses spaces. Please switch this to the same space indentation as surrounding directives to keep formatting consistent and avoid mixed whitespace in nginx.conf.

Suggested change
server windsurf-api:3003 resolve;
server windsurf-api:3003 resolve;

Copilot uses AI. Check for mistakes.
@dwgx
Copy link
Copy Markdown
Owner

dwgx commented Apr 25, 2026

谢谢你!!

@dwgx dwgx merged commit 770ad7e into dwgx:master Apr 25, 2026
dwgx added a commit that referenced this pull request Apr 25, 2026
…ly-zhang to S+

- baily-zhang PR #61 (Opus 4.7 multimodal context bloat) — third major
  contribution after #36 and #45, now de-facto maintainer of the
  reuse-fingerprint / trajectory-offset machinery
- abwuge PR #58 (docker/nginx deploy fix) — first-time contributor,
  +3/-2 surgical, unblocked the docker-compose Restart loop
- aict666 PR #54 (tool preamble slimming + redact marker 6th-gen U+2026
  ellipsis + identity coverage extension) — fourth major contribution
- aict666 PR #53 (redact marker shell-safety regression) — second
  contribution, was missing from the prior credits update
- baily-zhang upgraded from S to S+ (parity with aict666)
@dwgx
Copy link
Copy Markdown
Owner

dwgx commented Apr 25, 2026

合了 部到 US 主 VPS 了 v2.0.4 + commit 770ad7e

@abwuge 首次贡献就解了部署死锁 surgical 漂亮 +3 / -2 没多一行
nginx shared memory zone + config.js 漏 import 两处都是真 production blocker docker-compose 起不来确实是没人用 docker(笑)—— 之前主要是裸跑 pm2 + vps-exec.py 的工作流

dashboard credits 加上你了 B+ 级
那句"这么简单的问题,难道没人用 docker 吗?" 我没删 留作纪念

后面如果有兴趣再玩玩 deploy 链或者 dashboard UI 随时来

dwgx added a commit that referenced this pull request Apr 25, 2026
The Pages site at dwgx.github.io/WindsurfAPI/ had only 4 names listed
in the footer (dd373156, colin1112a, motto1, youfak). 8 contributors
were missing from the public site even though most of them landed
S+/S level fixes (aict666 #44/#51/#53/#54, baily-zhang #36/#45/#61,
smeinecke #43, abwuge #58).

Adds a dedicated `#contributors` section before the footer with one
card per contributor: avatar, GitHub link, weight badge (S+/S/A+/A/B+),
PR list, and a one-paragraph 繁體中文 description of what each fix
actually solved. Cards reuse the existing panel-card warm/coral
palette to fit the site's aesthetic.

Footer one-liner is also expanded to all 8 names ordered by weight,
with a "完整名單 ↑" anchor back to the new section.

CSS additions: contrib-grid, contrib-card, contrib-avatar,
contrib-weight + 5 weight-tier classes (-S-plus, -S, -A-plus, -A,
-B-plus). All gradient/hover behaviour matches the existing
panel-card styling.
dwgx added a commit that referenced this pull request Apr 25, 2026
baily-zhang's fourth landed PR (#36 / #45 / #61 / #62) — adding the
PR #62 entry to the dashboard credits panel as a separate card so
the inline-script regression-test win is visible alongside the
cascade-reuse machinery work.

v2.0.5 covers everything since 2.0.4:
- aict666 #54 tool preamble slim + redact U+2026
- abwuge #58 docker/nginx deploy fix
- baily #61 Opus 4.7 multimodal context bloat
- baily #62 dashboard escape regression
- own commits: empty-message validator, internal_error backoff,
  upstream_transient_error category, Opus 4.6 reuse widening,
  /v1/responses endpoint for Codex CLI compatibility (#56, #63)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants