ibeam icon indicating copy to clipboard operation
ibeam copied to clipboard

502 Bad Gateway error

Open sylver911 opened this issue 5 months ago • 4 comments

Hello!

I am trying to deploy IBeam on a Railway.app container. I am trying to access the app through a public domain but I am still getting error 502.

HTTP/1.1 502 Bad Gateway
Content-Length: 109
Content-Type: application/json
Server: railway-edge
X-Railway-Edge: railway/us-east4-eqdc4a
X-Railway-Fallback: true
X-Railway-Request-Id: ovJr5fgkRe2eoqJrCx5-qw
Date: Sat, 26 Jul 2025 12:42:10 GMT

{"status":"error","code":502,"message":"Application failed to respond","request_id":"ovJr5fgkRe2eoqJrCx5-qw"}

The app is visible through port 5000, othervise I would get 404 error. Can you please help me what can the problem be? I can access port 5001, health check port without any problem, but I can't access to 5000.

Thank you very much!

sylver911 avatar Jul 26 '25 12:07 sylver911

I've tried deploying IBeam on Digitalocean, but the same issue happened. Did the same on Railway and I couldn't connect to it externally. Reaching the /v1/api/tickle endpoint internally (localhost) on doctl succeed, but from a curl site or from my computer it says Access denied. And I'm sure the same issue happened on Railway, but Railway's proxy simply respond with 502.

My conf.yaml ips section:

Image

At the last line I allowed every IP address. Proof for reading my conf.yaml:

Image

On doctl I strictly followed Cloud Deployment steps. I'm out of ideas what goes wrong and why I get Access denied. Please help me, Voyz!

EDIT

I've figured out that the wildcard IP address doesn't work for ips-allown. On DigitalOcean I added my own IP address so I could reach it from outside. However, neither the 0.0.0.0 nor the 0.0.0.0/0 wildcard IP address works, it won't let me connect from anywhere. Is there a good solution to this? Railway documentation says I have to host application on 0.0.0.0, otherwise I can't reach it. Is there a way to host on 0.0.0.0? Thanks!

sylver911 avatar Jul 27 '25 10:07 sylver911

Hey @sylver911 sorry for the issues you're running into. Without having access to your cloud setup it's hard for me to evaluate it. It sounds like some possibly some firewall issues?

As for the Access Denied - this is a common error. You can read more about it here: https://github.com/Voyz/ibeam/wiki/Troubleshooting#access-denied Make sure that whatever IP you're trying to make requests from (eg. your dev machine's IP if you're trying to make calls from it) is added to ips/allow in conf.yaml.

Indeed it seems that '0.0.0.0' is ignored by Gateway, ie. you need to specify the IPs from which you communicate explicitly.

Voyz avatar Jul 30 '25 09:07 Voyz

Hey Voyz! Thank you very much for your reply. I was convinced that IBeam and Docker controlled gateway access, not cloud hosting. I managed to install it through DigitalOcean, but I had to enter the exact IP address. Railway.app seems to translate the IP address using internal proxy solutions, so I have no idea what IP address the gateway will ultimately receive. Is there any way to find out from the log what address the Access denied message is coming from? Also, do you have any information on whether conf.yaml and the gateway can handle IPV6?

In the worst case, I'll just use two hosting services :D

sylver911 avatar Aug 03 '25 10:08 sylver911

Railway.app seems to translate the IP address using internal proxy solutions, so I have no idea what IP address the gateway will ultimately receive.

Hmm, that's a problem. Then I'd suggest you either check out IBind with OAuth 1.0a, or talk to IBKR support about how to solve this.

Is there any way to find out from the log what address the Access denied message is coming from?

No, sorry. IBeam doesn't serve as a proxy of any sort, the requests go directly to the Gateway. There are logs in the clientportal.gw directory - if you log into the container you may find the request sources there, but I'm not sure.

Also, do you have any information on whether conf.yaml and the gateway can handle IPV6?

No, sorry, never had this come up before. Talk to their support and let me know if you find out 👍

Voyz avatar Aug 04 '25 08:08 Voyz