Voyz / ibeam

IBeam is an authentication and maintenance tool used for the Interactive Brokers Client Portal Web API Gateway.
Apache License 2.0
558 stars 112 forks source link

Issue trying to connect using another port. ie. port 5006 #148

Closed greybox1 closed 7 months ago

greybox1 commented 1 year ago

Hi there

Thank you for your amazing script and contribution to making a IBK gateway... works great when using port 5000 but when I try to use another port such as port 5006 it won't connect automatically using docker. I want to be able to have a few accounts running on different ports. Is this possible?

I can see that it opens the port when I launch the docker https://localhost:5006/sso/Login?forwardTo=22&RL=1&ip2loc=US

I need to log in manually for the gateway to connect

Here is my config.yaml file located in my input folder:

ip2loc: "US" proxyRemoteSsl: true proxyRemoteHost: "https://api.ibkr.com" listenPort: 5006 listenSsl: true svcEnvironment: "v1" sslCert: "vertx.jks" sslPwd: "mywebapi" authDelay: 3000 portalBaseURL: "" serverOptions: blockedThreadCheckInterval: 1000000 eventLoopPoolSize: 20 workerPoolSize: 20 maxWorkerExecuteTime: 100 internalBlockingPoolSize: 20 cors: origin.allowed: "*" allowCredentials: false webApps:

here is my log file

2023-07-01 14:30:24 2023-07-01 18:30:24,362|I| ############ Starting IBeam version 0.4.5 ############ 2023-07-01 14:30:24 2023-07-01 18:30:24,365|I| Custom conf.yaml found and will be used by the Gateway 2023-07-01 14:30:24 2023-07-01 18:30:24,401|I| Secrets source: env 2023-07-01 14:30:24 2023-07-01 18:30:24,403|I| Health server started at port=5001 2023-07-01 14:30:24 2023-07-01 18:30:24,403|I| Environment variable configuration: 2023-07-01 14:30:24 {'INPUTS_DIR': '/srv/inputs/', 'OUTPUTS_DIR': '/srv/outputs', 'GATEWAY_DIR': '/srv/clientportal.gw', 'CHROME_DRIVER_PATH': '/usr/bin/chromedriver', 'GATEWAY_STARTUP': 20, 'GATEWAY_PROCESS_MATCH': 'ibgroup.web.core.clientportal.gw.GatewayStart', 'MAINTENANCE_INTERVAL': 60, 'SPAWN_NEW_PROCESSES': False, 'LOG_LEVEL': 'INFO', 'LOG_TO_FILE': True, 'LOG_FORMAT': '%(asctime)s|%(levelname)-.1s| %(message)s', 'REQUEST_RETRIES': 1, 'REQUEST_TIMEOUT': 15, 'RESTART_FAILED_SESSIONS': True, 'RESTART_WAIT': 15, 'IBEAM_HEALTH_SERVER_PORT': 5001, 'GATEWAY_BASE_URL': 'https://localhost:5000', 'ROUTE_AUTH': '/sso/Login?forwardTo=22&RL=1&ip2loc=on', 'ROUTE_USER': '/v1/api/one/user', 'ROUTE_VALIDATE': '/v1/portal/sso/validate', 'ROUTE_REAUTHENTICATE': '/v1/portal/iserver/reauthenticate?force=true', 'ROUTE_AUTH_STATUS': '/v1/api/iserver/auth/status', 'ROUTE_TICKLE': '/v1/api/tickle', 'ROUTE_LOGOUT': '/v1/api/logout', 'USER_NAME_EL': None, 'PASSWORD_EL': 'password', 'SUBMIT_EL': 'button.btn.btn-lg.btn-primary', 'ERROR_EL': None, 'SUCCESS_EL_TEXT': 'Client login succeeds', 'OAUTH_TIMEOUT': 15, 'PAGE_LOAD_TIMEOUT': 15, 'ERROR_SCREENSHOTS': False, 'MAX_FAILED_AUTH': 5, 'MAX_IMMEDIATE_ATTEMPTS': 10, 'IBKEY_PROMO_EL_CLASS': 'ibkey-promo-skip', 'TWO_FA_EL_ID': 'twofactbase', 'TWO_FA_NOTIFICATION_EL': 'login-step-notification', 'TWO_FA_INPUT_EL_ID': 'chlginput', 'TWO_FA_HANDLER': None, 'STRICT_TWO_FA_CODE': True, 'TWO_FA_SELECT_EL_ID': 'sf_select', 'TWO_FA_SELECT_TARGET': 'IB Key'} 2023-07-01 14:30:24 2023-07-01 18:30:24,403|I| Gateway not found, starting new one... 2023-07-01 14:30:24 2023-07-01 18:30:24,403|I| Note that the Gateway log below may display "Open https://localhost:5000 to login" - ignore this command. 2023-07-01 14:30:24 2023-07-01 18:30:24,404|I| Starting Gateway as Linux process with params: ['bash', 'bin/run.sh', 'root/conf.yaml'] 2023-07-01 13:04:59 running
2023-07-01 13:04:59 runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/* 2023-07-01 13:04:59 config file : root/conf.yaml 2023-07-01 13:05:00 -> mount demo on /demo 2023-07-01 13:05:00 Java Version: 11.0.18 2023-07-01 13:05:00 **** 2023-07-01 13:05:00 version: 485dc2d762781c4ff3954ac4fb66a9469a1405f7 Mon, 20 Mar 2023 14:39:35 -0400 2023-07-01 13:05:00 **** 2023-07-01 13:05:00 This is the Client Portal Gateway 2023-07-01 13:05:00 for any issues, please contact api@ibkr.com 2023-07-01 13:05:00 and include a copy of your logs 2023-07-01 13:05:00 **** 2023-07-01 13:05:00 https://www.interactivebrokers.com/api/doc.html 2023-07-01 13:05:00 **** 2023-07-01 13:05:00 Open https://localhost:5006 to login 2023-07-01 13:05:00 App demo is available after you login under: https://localhost:5006/demo#/ 2023-07-01 14:30:24 running
2023-07-01 14:30:24 runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/* 2023-07-01 14:30:24 config file : root/conf.yaml 2023-07-01 14:30:25 -> mount demo on /demo 2023-07-01 14:30:25 Java Version: 11.0.18 2023-07-01 14:30:25 **** 2023-07-01 14:30:25 version: 485dc2d762781c4ff3954ac4fb66a9469a1405f7 Mon, 20 Mar 2023 14:39:35 -0400 2023-07-01 14:30:25 **** 2023-07-01 14:30:25 This is the Client Portal Gateway 2023-07-01 14:30:25 for any issues, please contact api@ibkr.com 2023-07-01 14:30:25 and include a copy of your logs 2023-07-01 14:30:25 **** 2023-07-01 14:30:25 https://www.interactivebrokers.com/api/doc.html 2023-07-01 14:30:25 **** 2023-07-01 14:30:25 Open https://localhost:5006 to login 2023-07-01 14:30:25 App demo is available after you login under: https://localhost:5006/demo#/ 2023-07-01 14:30:24 WARNING: An illegal reflective access operation has occurred 2023-07-01 14:30:24 WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/srv/clientportal.gw/build/lib/runtime/netty-common-4.1.15.Final.jar) to constructor java.nio.DirectByteBuffer(long,int) 2023-07-01 14:30:24 WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil 2023-07-01 14:30:24 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations 2023-07-01 14:30:24 WARNING: All illegal access operations will be denied in a future release 2023-07-01 14:30:25 2023-07-01 18:30:25,405|I| Gateway started with pid: 13 2023-07-01 14:30:25 2023-07-01 18:30:25,406|I| Cannot ping Gateway. Retrying for another 20 seconds 2023-07-01 14:30:26 2023-07-01 18:30:26,407|I| Cannot ping Gateway. Retrying for another 19 seconds 2023-07-01 14:30:27 2023-07-01 18:30:27,408|I| Cannot ping Gateway. Retrying for another 18 seconds 2023-07-01 14:30:28 2023-07-01 18:30:28,410|I| Cannot ping Gateway. Retrying for another 17 seconds 2023-07-01 14:30:29 2023-07-01 18:30:29,411|I| Cannot ping Gateway. Retrying for another 16 seconds 2023-07-01 14:30:30 2023-07-01 18:30:30,413|I| Cannot ping Gateway. Retrying for another 15 seconds 2023-07-01 14:30:31 2023-07-01 18:30:31,414|I| Cannot ping Gateway. Retrying for another 14 seconds 2023-07-01 14:30:32 2023-07-01 18:30:32,415|I| Cannot ping Gateway. Retrying for another 13 seconds 2023-07-01 14:30:33 2023-07-01 18:30:33,416|I| Cannot ping Gateway. Retrying for another 12 seconds 2023-07-01 14:30:34 2023-07-01 18:30:34,418|I| Cannot ping Gateway. Retrying for another 11 seconds 2023-07-01 14:30:35 2023-07-01 18:30:35,419|I| Cannot ping Gateway. Retrying for another 10 seconds 2023-07-01 14:30:36 2023-07-01 18:30:36,420|I| Cannot ping Gateway. Retrying for another 9 seconds 2023-07-01 14:30:37 2023-07-01 18:30:37,421|I| Cannot ping Gateway. Retrying for another 8 seconds 2023-07-01 14:30:38 2023-07-01 18:30:38,422|I| Cannot ping Gateway. Retrying for another 7 seconds 2023-07-01 14:30:39 2023-07-01 18:30:39,423|I| Cannot ping Gateway. Retrying for another 6 seconds 2023-07-01 14:30:40 2023-07-01 18:30:40,424|I| Cannot ping Gateway. Retrying for another 5 seconds 2023-07-01 14:30:41 2023-07-01 18:30:41,425|I| Cannot ping Gateway. Retrying for another 4 seconds 2023-07-01 14:30:42 2023-07-01 18:30:42,426|I| Cannot ping Gateway. Retrying for another 3 seconds 2023-07-01 14:30:43 2023-07-01 18:30:43,427|I| Cannot ping Gateway. Retrying for another 2 seconds 2023-07-01 14:30:44 2023-07-01 18:30:44,429|I| Cannot ping Gateway. Retrying for another 1 seconds 2023-07-01 14:30:45 2023-07-01 18:30:45,429|E| Gateway process found but cannot establish a connection with the Gateway 2023-07-01 14:30:45 2023-07-01 18:30:45,430|E| Cannot communicate with the Gateway. Consider increasing IBEAM_GATEWAY_STARTUP 2023-07-01 14:30:45 2023-07-01 18:30:45,434|I| Starting maintenance with interval 60 seconds 2023-07-01 14:31:45 2023-07-01 18:31:45,435|I| Maintenance 2023-07-01 14:31:45 2023-07-01 18:31:45,437|E| Cannot communicate with the Gateway. Consider increasing IBEAM_GATEWAY_STARTUP 2023-07-01 14:32:45 2023-07-01 18:32:45,435|I| Maintenance 2023-07-01 14:32:45 2023-07-01 18:32:45,437|E| Cannot communicate with the Gateway. Consider increasing IBEAM_GATEWAY_STARTUP 2023-07-01 14:33:45 2023-07-01 18:33:45,435|I| Maintenance

what does this do ? portalBaseURL: "" couldn't find much on this parameter.

Should I put the config.yaml in the root folder or in the input folder? Not sure what I am doing wrong.

Thanks!!

Michael

Voyz commented 1 year ago

hey @greybox1 welcome to IBeam and thanks for your kind words 😊 Also thanks for describing your issue in detail 👍

You've correctly modified the conf.yaml file to start the Gateway on 5006.

However, the IBEAM_GATEWAY_BASE_URL env var is set to https://localhost:5000/. If you've changed the Gateway port, you need to tell IBeam about that so that it knows how to communicate.

Change that value to whatever port you're aiming to use, and let me know if that helped.

greybox1 commented 1 year ago

Hi Voyz thank you for this great info. Working great on my desktop locally.

Can this run Docker on an Ubuntu server instead of my desktop?

How can I test https://localhost:5006/v1/api/iserver/auth/status

I see it's connecting but I can't seem to be able to test the connection

Thanks!

Michael

2023-07-03_01h07_03
Voyz commented 1 year ago

glad to hear @greybox1 👍

Can this run Docker on an Ubuntu server instead of my desktop?

Yes, it can

How can I test https://localhost:5006/v1/api/iserver/auth/status

Just call it from curl, you can see the example calls in the WiKi documentation

Let me know if that works

Voyz commented 7 months ago

I'm going to close this issue due to inactivity. Thanks for your contribution and please feel free to request a reopen if you'd like to continue the discussion 👍