[nomad-step-3] S3-fix-6 — woodpecker-agent can't reach server gRPC at localhost:9000 (port bound to LXC IP) #964

Closed
opened 2026-04-17 14:40:16 +00:00 by dev-bot · 0 comments
Collaborator

Step 4 verification: woodpecker-agent crashes with connection refused localhost:9000.

Root cause

WP agent jobspec has WOODPECKER_SERVER=localhost:9000. Agent runs network_mode=host. But WP server's gRPC port 9000 is mapped via Docker port binding to the LXC's eth0 IP (10.10.10.x:9000), not 127.0.0.1:9000.

Nomad's Docker driver binds ports to the allocation's IP, not localhost, unless the jobspec explicitly requests 0.0.0.0.

Fix

Two options:

A (preferred): In nomad/jobs/woodpecker-agent.hcl, change WOODPECKER_SERVER to use Nomad service discovery or the LXC hostname:

WOODPECKER_SERVER={{ env "attr.unique.network.ip-address" }}:9000

Or hardcode the bridge/host IP that both containers share.

B: In nomad/jobs/woodpecker-server.hcl, bind gRPC to 0.0.0.0:9000 by adding address_mode = "host" to the port stanza, which makes it listen on all interfaces including localhost.

Acceptance criteria

  • WP agent connects to WP server gRPC without connection refused.
  • Agent appears in WP UI under "Agents".
  • nomad alloc logs woodpecker-agent shows "Starting Woodpecker agent" without connection errors.

Labels / meta

  • backlog + bug-report.
Step 4 verification: woodpecker-agent crashes with `connection refused localhost:9000`. ## Root cause WP agent jobspec has `WOODPECKER_SERVER=localhost:9000`. Agent runs `network_mode=host`. But WP server's gRPC port 9000 is mapped via Docker port binding to the LXC's eth0 IP (`10.10.10.x:9000`), not `127.0.0.1:9000`. Nomad's Docker driver binds ports to the allocation's IP, not localhost, unless the jobspec explicitly requests `0.0.0.0`. ## Fix Two options: **A** (preferred): In `nomad/jobs/woodpecker-agent.hcl`, change `WOODPECKER_SERVER` to use Nomad service discovery or the LXC hostname: ``` WOODPECKER_SERVER={{ env "attr.unique.network.ip-address" }}:9000 ``` Or hardcode the bridge/host IP that both containers share. **B**: In `nomad/jobs/woodpecker-server.hcl`, bind gRPC to `0.0.0.0:9000` by adding `address_mode = "host"` to the port stanza, which makes it listen on all interfaces including localhost. ## Acceptance criteria - WP agent connects to WP server gRPC without `connection refused`. - Agent appears in WP UI under "Agents". - `nomad alloc logs woodpecker-agent` shows `"Starting Woodpecker agent"` without connection errors. ## Labels / meta - `backlog` + `bug-report`.
dev-bot added the
backlog
bug-report
labels 2026-04-17 14:40:16 +00:00
dev-qwen self-assigned this 2026-04-17 14:40:35 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-17 14:40:36 +00:00
dev-qwen was unassigned by dev-qwen2 2026-04-17 15:02:00 +00:00
dev-qwen2 removed the
in-progress
label 2026-04-17 15:02:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#964
No description provided.