Skip to content

fix(PIX-154): add TLS for Upstash Redis connections in worker and queue#1

Open
apsisvictor-sys wants to merge 2 commits intomainfrom
fix/PIX-154-worker-redis-tls
Open

fix(PIX-154): add TLS for Upstash Redis connections in worker and queue#1
apsisvictor-sys wants to merge 2 commits intomainfrom
fix/PIX-154-worker-redis-tls

Conversation

@apsisvictor-sys
Copy link
Copy Markdown
Owner

Problem

The neuroforge-worker Railway service was showing continuous ECONNRESET errors. Root cause: IORedis and BullMQ connections were configured with plain TCP (host/port/password) but Upstash Redis only accepts TLS connections (rediss:// scheme).

Fix

Added tls: {} to all IORedis and BullMQ Queue connection option objects in:

  • src/infrastructure/jobs/worker.ts — BullMQ Worker connectionOptions
  • src/infrastructure/jobs/redis-job-queue.tsgetOrCreateRedisConnection(), Queue inline options, createRedisClient()

This fixes the ECONNRESET loop and allows the worker to connect to Upstash Redis over TLS.

Verified

  • Worker deployment on Railway currently running but all logs are ECONNRESET — this fix will resolve that on next deploy
  • redis-health.ts uses createRedisClient() — also fixed transitively

Railway project: Neuroforge — service: neuroforge-worker
Paperclip task: PIX-154

apsisvictor-sys and others added 2 commits March 25, 2026 13:52
Upstash Redis requires TLS connections (rediss:// scheme). Added tls: {}
to BullMQ worker connectionOptions to fix ECONNRESET errors on Railway.

Co-Authored-By: Paperclip <[email protected]>
Added tls: {} to all IORedis and BullMQ Queue connection options.
Upstash requires TLS; without it all connections get ECONNRESET.
Fixes worker, queue producer, and health check paths.

Co-Authored-By: Paperclip <[email protected]>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontend Ready Ready Preview, Comment Mar 25, 2026 11:54am

@railway-app
Copy link
Copy Markdown

railway-app bot commented Mar 25, 2026

🚅 Deployed to the neuroforge-pr-1 environment in neuroforge

Service Status Web Updated (UTC)
neuroforge-worker ✅ Success (View Logs) Mar 25, 2026 at 11:56 am
neuroforge-backend ✅ Success (View Logs) Web Mar 25, 2026 at 11:56 am
1 service not affected by this PR
  • neuroforge-postgres

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6acdc5be49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

host,
port,
password,
tls: {},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make TLS optional for non-Upstash Redis deployments

This change forces tls: {} on all Redis connections (getOrCreateRedisConnection, BullMQ queue connection, createRedisClient, and worker connection options), which turns every connection into TLS-only. The repository still includes a default deploy path that wires REDIS_HOST/REDIS_PORT from Railway RAILWAY_TCP_PROXY_* values (scripts/deploy/railway-provision-and-deploy.sh), so environments that are still plain TCP will regress from working to handshake failures, breaking queue enqueue/worker startup. Gate TLS with an explicit setting (or URL scheme) instead of hardcoding it for all Redis backends.

Useful? React with 👍 / 👎.

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