13 days ago
My Node.js service cannot make outbound HTTPS calls to api.anthropic.com. I get a "Connection error" at Anthropic.makeRequest on every attempt. Works perfectly locally. API key is valid with $19 credits. I'm on the Hobby plan.
Project: resplendent-gratitude
Service: future-proof-marketing
Repo: github.com/FinnShortman/future-proof-marketing
Error in logs:
Error handling message: Connection error. Error: Connection error.
at Anthropic.makeRequest (/app/node_modules/@anthropic-ai/sdk/core.js:337:19)
at async generateReply (/app/claude.js:41:20)
Local environment works fine. Railway deployment fails 100% of the time. Please check if outbound HTTPS is being blocked on this service.
Pinned Solution
13 days ago
okay can you run this inside your railway service via railway cli ssh:
curl -v https://api.anthropic.com
that command will show where the connection is dying
6 Replies
Status changed to Open Railway • 13 days ago
0x5b62656e5d
Try enabling IPv6 outbound in your service settings.
13 days ago
Thanks, already tried enabling Outbound IPv6 in service settings and redeployed — same connection error persists. The error is specifically at Anthropic.makeRequest in the SDK, suggesting the TCP connection to api.anthropic.com is being refused or timing out before any response.
13 days ago
Hello finnshortman,
what version of @anthropic-ai/sdk are you on and does the error happen instantly or after a timeout?
domehane
Hello **finnshortman,** what version of `@anthropic-ai/sdk` are you on and does the error happen instantly or after a timeout?
13 days ago
Hi, SDK version is @anthropic-ai/sdk 0.39.0. The error happens instantly — same timestamp as the incoming message, no timeout delay. The error is: 'Connection error. Error: Connection error. at Anthropic.makeRequest (/app/node_modules/@anthropic-ai/sdk/core.js:337:19)'. Works perfectly locally, fails 100% of the time on Railway.
13 days ago
okay can you run this inside your railway service via railway cli ssh:
curl -v https://api.anthropic.com
that command will show where the connection is dying
domehane
okay can you run this inside your railway service via railway cli ssh: `curl -v https://api.anthropic.com` that command will show where the connection is dying
13 days ago
Legend! The SSH diagnostic was the key — found 3 hidden newline characters appended to my Anthropic API key in Railway's variables. Deleted the key, generated a new one, pasted it clean and it works perfectly. Thanks so much for your help!
Status changed to Open brody • 11 days ago
Status changed to Solved brody • 11 days ago

