-
Describe the bugThe docker image runs well, the terminal logs no errors as far as I have seen (I will attach a log just in case). But when I do a "curl -X GET "localhost:$port", the command hangs. I am sure I am using the right port as when I mistake the live for the paper port (or vice versa), the command returns an error. Note: I am using a custom image, but it is based on the latest stable with the only difference being that I installed curl for healthcheck purposes. I may be missing something really simple, perhaps something firewall related? I haven't touched firewall settings. But I just can't figure it out. Any help would be appreciated. .env: I build the project with 'docker compose up' ExpectedThe second package is a python app that calls the TWS API. I need the ib-gateway to make the api available so the healthcheck passes and the app connects to the API. Container logslogs.txt## Versions Please complete the following information:
Additional contextAdd any other context about the problem here. What have you tried and failed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, not shure what's your expectation, why would I just did a quick test on my running TWS instance and ports are working. if you need a healthcheck(which just is telling you that the port is open, but not that is actually working) you can use that this is how it would look like on ib-gateway with the port down (ibgateway is not running) something like this to have it working as a docker healthcheck HEALTHCHECK --interval=30m --timeout=15s --start-period=10s \
CMD timeout 1 bash -c '</dev/tcp/0.0.0.0/4001 && echo "TWS API up" || echo "TWS API down"' || echo "Connection timeout" take into account that any disconnection to IBKR server farm will not be reported by this health check. I use ib_async and disconnectedEvent to keep TWS api connectivity. hope this helps |
Beta Was this translation helpful? Give feedback.
-
Hm, yeah thanks for the healthcheck, I could see it being useful. And thanks for the answer, I figured it out. I wasn't managing my connection IDs correctly. |
Beta Was this translation helpful? Give feedback.
Hi,
not shure what's your expectation, why would
"curl -X GET "localhost:$port/v1/api/one/user"
work, this is not a RESTfull API.I just did a quick test on my running TWS instance and ports are working.
if you need a healthcheck(which just is telling you that the port is open, but not that is actually working) you can use that
this is how it would look like on ib-gateway with the port down (ibgateway is not running)
something like this to have it working as a docker healthcheck
take into account that any …