-
I'm running the docker-compose on a Linode server using Ubuntu. I think I've followed the README.md file correctly, but when I try to make an API request to the server, I get the error:
Here's my docker-compose.yml name: algo-trader
services:
ib-gateway:
restart: always
build:
context: ./latest
tags:
- "ghcr.io/gnzsnz/ib-gateway:latest"
image: ghcr.io/gnzsnz/ib-gateway:latest
environment:
TWS_USERID: ${TWS_USERID}
TWS_PASSWORD: ${TWS_PASSWORD}
TRADING_MODE: ${TRADING_MODE:-paper}
TWS_USERID_PAPER: ${TWS_USERID_PAPER:-}
TWS_PASSWORD_PAPER: ${TWS_PASSWORD_PAPER:-}
TWS_SETTINGS_PATH: ${TWS_SETTINGS_PATH:-}
TWS_ACCEPT_INCOMING: ${TWS_ACCEPT_INCOMING:-manual}
READ_ONLY_API: ${READ_ONLY_API:-}
VNC_SERVER_PASSWORD: ${VNC_SERVER_PASSWORD:-}
TWOFA_TIMEOUT_ACTION: ${TWOFA_TIMEOUT_ACTION:-exit}
BYPASS_WARNING: ${BYPASS_WARNING:-}
AUTO_RESTART_TIME: ${AUTO_RESTART_TIME:-}
AUTO_LOGOFF_TIME: ${AUTO_LOGOFF_TIME:-}
TWS_COLD_RESTART: ${TWS_COLD_RESTART:-}
SAVE_TWS_SETTINGS: ${SAVE_TWS_SETTINGS:-}
RELOGIN_AFTER_TWOFA_TIMEOUT: ${RELOGIN_AFTER_TWOFA_TIMEOUT:-no}
TWOFA_EXIT_INTERVAL: ${TWOFA_EXIT_INTERVAL:-60}
TWOFA_DEVICE: ${TWOFA_DEVICE:-}
EXISTING_SESSION_DETECTED_ACTION: ${EXISTING_SESSION_DETECTED_ACTION:-primary}
ALLOW_BLIND_TRADING: ${ALLOW_BLIND_TRADING:-no}
TIME_ZONE: ${TIME_ZONE:-Etc/UTC}
TZ: ${TIME_ZONE:-Etc/UTC}
CUSTOM_CONFIG: ${CUSTOM_CONFIG:-NO}
JAVA_HEAP_SIZE: ${JAVA_HEAP_SIZE:-}
SSH_TUNNEL: ${SSH_TUNNEL:-}
SSH_OPTIONS: ${SSH_OPTIONS:-}
SSH_ALIVE_INTERVAL: ${SSH_ALIVE_INTERVAL:-}
SSH_ALIVE_COUNT: ${SSH_ALIVE_COUNT:-}
SSH_PASSPHRASE: ${SSH_PASSPHRASE:-}
SSH_REMOTE_PORT: ${SSH_REMOTE_PORT:-}
SSH_USER_TUNNEL: ${SSH_USER_TUNNEL:-}
SSH_RESTART: ${SSH_RESTART:-}
SSH_VNC_PORT: ${SSH_VNC_PORT:-}
# volumes:
# - ${PWD}/jts.ini:/home/ibgateway/Jts/jts.ini
# - ${PWD}/config.ini:/home/ibgateway/ibc/config.ini
# - ${PWD}/tws_settings/:${TWS_SETTINGS_PATH:-/home/ibgateway/Jts}
# - ${PWD}/ssh/:/home/ibgateway/.ssh
ports:
- "4001:4003"
- "4002:4004"
- "5900:5900" The only thing I changed in the docker-compose.yml file was to open the ports up for testing. (I will make it secure, once I can at least make some succesful API calls) Here's my .env file:
Only thing I changed in this file is my username and password. Here's the startup logs with a few failed API request attempts at the end:
The logs say "IBC: Login has completed", so it "should" be authenticated. However when I try to make a network request externally to e.g.: GET But why am I getting this error? On my the requesting side the error message I get is: The request only goes through with https, if I try http, it just hangs forever and doesn't seem to reach the server. What do I need to do to be able to make a request to this API externally? I did notice in the logs it says: When connecting to the docker directly, and trying to run a curl to localhost, I get a similar error:
Any help figuring this out would be much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@gnzsnz any idea why I might be getting a "Connection reset by peer" error? I've been trying to solve this for a few days now. |
Beta Was this translation helpful? Give feedback.
-
your docker image is working fine. as you stated logging is successful "IBC: Login has completed". you are trying to connect to ibgateway using a REST call. this is not going to work. you need to use TWS API |
Beta Was this translation helpful? Give feedback.
your docker image is working fine. as you stated logging is successful "IBC: Login has completed".
you are trying to connect to ibgateway using a REST call. this is not going to work. you need to use TWS API