Skip to content

fix: correct shard manager address format for 0.0.0.0 binding - #3

Open
railway-app[bot] wants to merge 11 commits into
prod-pinfrom
railway/code-change-rBkm-q
Open

fix: correct shard manager address format for 0.0.0.0 binding#3
railway-app[bot] wants to merge 11 commits into
prod-pinfrom
railway/code-change-rBkm-q

Conversation

@railway-app

@railway-app railway-app Bot commented May 6, 2026

Copy link
Copy Markdown

Problem

The shard manager was failing to start with a ParseError because RunnerAddress.make() was called with an object {host: "0.0.0.0", port: 8080}, but the function expects two separate positional arguments — a string host and a number port.

Solution

Changed RunnerAddress.make({host: "0.0.0.0", port: 8080}) to RunnerAddress.make("0.0.0.0", 8080) in apps/web-cluster/src/shard-manager.ts, matching the same call signature already used correctly in runner/index.ts. This binds the shard manager to all interfaces on port 8080, making it reachable from the workflow runner container.

Changes

  • Modified apps/web-cluster/src/shard-manager.ts

Generated by Railway

Mudit-Lal and others added 11 commits May 6, 2026 11:10
Railway's Buildkit rejects `# syntax=docker.io/docker/dockerfile:1`. Default frontend works fine for this multi-stage build.
Railway sub-directory deploys (rootDirectory=apps/media-server) need the
standalone Dockerfile whose COPY paths are relative to apps/media-server,
not the root Dockerfile that expects repo-root paths.
Railway's Railpack builder rejects `--mount=type=cache,id=pnpm,...` without
a cacheKey prefix on the id. Dropping the cache mount; build is slower but
correct.
Same Railway Railpack constraint as apps/web/Dockerfile — id=pnpm without
cacheKey prefix is rejected.
…full command

Railway's startCommand exec's the literal string and does NOT append to a
Docker ENTRYPOINT. With `ENTRYPOINT ["deno", "run", "--allow-all"]` Railway
tries to run the startCommand as a file path, getting "permission denied".

Removing ENTRYPOINT means startCommand becomes the CMD via shell, so
`deno run --allow-all src/runner/index.ts` works as expected.
Railway's startCommand fights with multi-word commands (treats whole string
as executable path). Switching strategy: hardcode CMD in Dockerfile to invoke
deno + ${CLUSTER_ENTRY}. Each service sets CLUSTER_ENTRY env var (default =
runner) so no startCommand override needed.
…er Dockerfile

Railway's startCommand override mechanism keeps fighting multi-word commands
on this Deno-based image. Hardcoding the CMD per Dockerfile sidesteps the
fight entirely. This Dockerfile is now Runner-only; ShardManager gets its
own Dockerfile.shard-manager.
Variant of apps/web-cluster/Dockerfile whose only difference is the final
CMD points at src/shard-manager.ts instead of src/runner/index.ts.
post-deploy.ts merges publishConfig into the deployed package.json. Without
publishConfig.exports, the deployed package keeps `exports: "./src/index.ts"`
and Deno tries to load TS source from node_modules, hitting
ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING and crashing the runner.

Mirroring the pattern @cap/database uses.
Effect Cluster's NodeClusterShardManagerSocket layerSocketServer binds to
config.shardManagerAddress (default localhost:8080). With Cap upstream's
SST infra they set SHARD_MANAGER_HOST=0.0.0.0 env var to override, but
that mapping isn't reliably resolving on Railway. Hardcoding the bind
address in shardingConfig works regardless of env-var conventions.
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.

1 participant