10 months ago
i connect to the nextjs server with ```railway ssh``` command and then run wget command to http://core.railway.internal:3001 and get connection refused error.
Pinned Solution
10 months ago
yes i see ur /proc/net/tcp output 100 % confirms the problem: the Hono server is listening only on IPv4 (00000000:0BB9 = 0.0.0.0:3001).
copy and paste this into your Hono "core" service)
If you are using @hono/node-server (most common for Hono on Node):
typeScript
import { serve } from '@hono/node-server'
import { app } from './app' // your hono app
serve({
fetch: app.fetch,
port: Number(process.env.PORT) || 3001,
hostname: '::', // ← this forces IPv6 + IPv4 dual-stack
})If you are using hono/bun (Bun.serve):
typeScript
Bun.serve({
fetch: app.fetch,
port: Number(process.env.PORT) || 3001,
hostname: '::', // ← critical line
})push and redeploy and lmk the result !
6 Replies
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Request for Database Export Assistance - Migration from Railway
- 🧵 502 and 403 errors in stable deployments
- 🧵 Production site is not working
If you find the answer from one of these, please let us know by solving the thread!
10 months ago
can you railway ssh into the core service (the hono one) while it’s running, and paste the output of this command:
ss -tuln | grep 3001
(or netstat -tuln | grep 3001 if ss is not available)
and also tett m does curl http://127.0.0.1:3001 (or wget -O- http://localhost:3001) work inside the same core container?
bytekeim
can you railway ssh into the core service (the hono one) while it’s running, and paste the output of this command: **ss -tuln | grep 3001** (or **netstat -tuln | grep 3001** if ss is not available) and also tett m does `curl http://127.0.0.1:3001` (or `wget -O- http://localhost:3001`) work inside the same core container?
10 months ago
there is no ss, netstat, curl or wget installed on railway service. but i found alternative:
cat /proc/net/tcp | grep "0BB9"
0: 00000000:0BB9 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 2161798467 1 000000001b1769e7 100 0 0 10 0
📌In simple English
This line means:
“There is a TCP socket listening on 0.0.0.0:3001, in LISTEN state, owned by UID 0.”
Instead of curl or wget, i do the following instruction:
node -e "
require('http').get('http://localhost:3001/health', r => {
r.on('data', d => process.stdout.write(d));
});
"
{"status":"ok","service":"auth"}
10 months ago
yes i see ur /proc/net/tcp output 100 % confirms the problem: the Hono server is listening only on IPv4 (00000000:0BB9 = 0.0.0.0:3001).
copy and paste this into your Hono "core" service)
If you are using @hono/node-server (most common for Hono on Node):
typeScript
import { serve } from '@hono/node-server'
import { app } from './app' // your hono app
serve({
fetch: app.fetch,
port: Number(process.env.PORT) || 3001,
hostname: '::', // ← this forces IPv6 + IPv4 dual-stack
})If you are using hono/bun (Bun.serve):
typeScript
Bun.serve({
fetch: app.fetch,
port: Number(process.env.PORT) || 3001,
hostname: '::', // ← critical line
})push and redeploy and lmk the result !
bytekeim
yes i see ur /proc/net/tcp output 100 % confirms the problem: the Hono server is listening only on IPv4 (00000000:0BB9 = 0.0.0.0:3001). copy and paste this into your Hono "core" service) If you are using @hono/node-server (most common for Hono on Node): typeScript ``` import { serve } from '@hono/node-server' import { app } from './app' // your hono app serve({ fetch: app.fetch, port: Number(process.env.PORT) || 3001, hostname: '::', // ← this forces IPv6 + IPv4 dual-stack }) ``` If you are using hono/bun (Bun.serve): typeScript ``` Bun.serve({ fetch: app.fetch, port: Number(process.env.PORT) || 3001, hostname: '::', // ← critical line }) ``` push and redeploy and lmk the result !
10 months ago
its work. thanks
Status changed to Solved uxuz • 10 months ago