ibeam icon indicating copy to clipboard operation
ibeam copied to clipboard

Issue with authentication. I have enabled IB key Authentication But when running IBEAM on live account getting the below issue it is working fine on paper account

Open sanju1066 opened this issue 5 months ago • 2 comments

Open https://localhost:5000 to login App demo is available after you login under: https://localhost:5000/demo#/ 2025-07-09 09:34:56,676|I| Gateway connection established 2025-07-09 09:34:57,046|I| NO SESSION Status(running=True, session=False, connected=False, authenticated=False, competing=False, collision=False, session_id=None, server_name=None, server_version=None, expires=None) 2025-07-09 09:34:57,047|I| Authentication strategy: "B" 2025-07-09 09:34:57,047|I| No active sessions, logging in... 2025-07-09 09:34:57,047|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on 2025-07-09 09:35:09,282|I| Gateway auth webpage loaded 2025-07-09 09:35:09,282|I| Login attempt number 1 2025-07-09 09:35:15,183|I| Submitting the form 2025-07-09 09:35:30,548|E| Timeout reached when waiting for authentication. The website seems to not be loaded correctly. Consider increasing IBEAM_PAGE_LOAD_TIMEOUT. Website URL: https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on

Exception: File "/srv/ibeam/ibeam_starter.py", line 181, in success, shutdown, status = client.start_and_authenticate() File "/srv/ibeam/src/gateway_client.py", line 62, in start_and_authenticate success, shutdown, status = self.strategy_handler.try_authenticating(request_retries=request_retries) File "/srv/ibeam/src/handlers/strategy_handler.py", line 85, in try_authenticating return self._authentication_strategy_B(status, request_retries) File "/srv/ibeam/src/handlers/strategy_handler.py", line 140, in _authentication_strategy_B return self._log_in(status) File "/srv/ibeam/src/handlers/strategy_handler.py", line 151, in _log_in success, shutdown = self.login_handler.login() File "/srv/ibeam/src/handlers/login_handler.py", line 504, in login self.handle_timeout_exception(e, targets, driver, website_version, self.route_auth, self.base_url, self.outputs_dir) File "/srv/ibeam/src/handlers/login_handler.py", line 485, in login self.attempt(targets, wait_and_identify_trigger, driver) File "/srv/ibeam/src/handlers/login_handler.py", line 406, in attempt trigger, target = self.step_login(targets, wait_and_identify_trigger, driver, self.secrets_handler.account, self.secrets_handler.password, self.secrets_handler.key, self.presubmit_buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/ibeam/src/handlers/login_handler.py", line 196, in step_login trigger, target = wait_and_identify_trigger( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/ibeam/src/handlers/login_handler.py", line 67, in _wait_and_identify_trigger trigger = WebDriverWait(driver, timeout).until(any_of(*expected_conditions)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.11/site-packages/selenium/webdriver/support/wait.py", line 95, in until raise TimeoutException(message, screen, stacktrace)

<class 'selenium.common.exceptions.TimeoutException'> Message:

sanju1066 avatar Jul 09 '25 09:07 sanju1066

Hi @sanju1066 please attach a more information using the template bug report template, and include full terminal output

Voyz avatar Jul 10 '25 07:07 Voyz

ibeam | 2025-10-29 14:00:18,470|I| ############ Starting IBeam version 0.5.9 ############ ibeam | 2025-10-29 14:00:18,478|I| Secrets source: env ibeam | 2025-10-29 14:00:18,483|I| Health server started at port=5001 ibeam | 2025-10-29 14:00:18,483|I| Configuration:
ibeam | {'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': 2, 'REQUEST_TIMEOUT': 15, 'RESTART_FAILED_SESSIONS': True, 'RESTART_WAIT': 15, 'REAUTHENTICATE_WAIT': 15, 'HEALTH_SERVER_PORT': 5001, 'SECRETS_SOURCE': 'env', 'GCP_SECRETS_URL': None, 'START_ACTIVE': True, 'GATEWAY_BASE_URL': 'https://localhost:5000', 'ROUTE_AUTH': '/sso/Login?forwardTo=22&RL=1&ip2loc=on', 'ROUTE_VALIDATE': '/v1/portal/sso/validate', 'ROUTE_REAUTHENTICATE': '/v1/portal/iserver/reauthenticate?force=true', 'ROUTE_INITIALISE': '/v1/api/iserver/auth/ssodh/init', 'ROUTE_AUTH_STATUS': '/v1/api/iserver/auth/status', 'ROUTE_TICKLE': '/v1/api/tickle', 'ROUTE_LOGOUT': '/v1/api/logout', 'USER_NAME_EL': None, 'PASSWORD_EL': 'NAME@@password', 'SUBMIT_EL': 'CSS_SELECTOR@@.btn.btn-lg.btn-primary', 'ERROR_EL': None, 'SUCCESS_EL_TEXT': 'TAG_NAME@@Client login succeeds', 'LIVE_PAPER_TOGGLE_EL': 'FOR@@label[for=toggle1]', 'USE_PAPER_ACCOUNT': False, 'OAUTH_TIMEOUT': 15, 'PAGE_LOAD_TIMEOUT': 15, 'ERROR_SCREENSHOTS': False, 'MAX_FAILED_AUTH': 5, 'MIN_PRESUBMIT_BUFFER': 5, 'MAX_PRESUBMIT_BUFFER': 30, 'MAX_IMMEDIATE_ATTEMPTS': 10, 'IBKEY_PROMO_EL_CLASS': 'CLASS_NAME@@ibkey-promo-skip', 'AUTHENTICATION_STRATEGY': 'B', 'MAX_STATUS_CHECK_RETRIES': 120, 'MAX_REAUTHENTICATE_RETRIES': 3, 'UI_SCALING': 1.0, 'TWO_FA_EL_ID': 'ID@@twofactbase', 'TWO_FA_NOTIFICATION_EL': 'CLASS_NAME@@login-step-notification', 'TWO_FA_INPUT_EL_ID': 'ID@@xyz-field-bronze-response', 'TWO_FA_HANDLER': None, 'STRICT_TWO_FA_CODE': True, 'TWO_FA_SELECT_EL_ID': 'ID@@xyz-field-bronze-response', 'TWO_FA_SELECT_TARGET': 'IB Key', 'CUSTOM_TWO_FA_HANDLER': 'custom_two_fa_handler.CustomTwoFaHandler'} ibeam | 2025-10-29 14:00:18,484|I| Gateway not found, starting new one... ibeam | 2025-10-29 14:00:18,484|I| Note that the Gateway log below may display "Open https://localhost:[PORT] to login" - ignore this command.
ibeam | 2025-10-29 14:00:18,484|I| Starting Gateway as Linux process with params: ['bash', 'bin/run.sh', 'root/conf.yaml'] ibeam | running
ibeam | runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/* ibeam | config file : root/conf.yaml
ibeam | 2025-10-29 14:00:18,512|I| Gateway started with pids: [11]
ibeam | 2025-10-29 14:00:18,520|I| Cannot ping Gateway. Retrying for another 20 seconds ibeam | 2025-10-29 14:00:19,523|I| Cannot ping Gateway. Retrying for another 19 seconds
ibeam | WARNING: An illegal reflective access operation has occurred ibeam | 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) ibeam | WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
ibeam | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations ibeam | WARNING: All illegal access operations will be denied in a future release
ibeam | -> mount demo on /demo
ibeam | Java Version: 11.0.24 ibeam | **************************************************** ibeam | version: a27ed42161ad96c53e715ca5c5e3e3fa4cff5262 Mon, 24 Apr 2023 15:41:53 -0400
ibeam | **************************************************** ibeam | This is the Client Portal Gateway
ibeam | for any issues, please contact [email protected] ibeam | and include a copy of your logs
ibeam | **************************************************** ibeam | https://www.interactivebrokers.com/api/doc.html ibeam | ****************************************************
ibeam | Open https://localhost:5000 to login
ibeam | App demo is available after you login under: https://localhost:5000/demo#/ ibeam | 2025-10-29 14:00:22,221|I| Gateway connection established ibeam | 2025-10-29 14:00:23,199|I| NO SESSION Status(running=True, session=False, connected=False, authenticated=False, competing=False, collision=False, session_id=None, server_name=None, server_version=None, expires=None) ibeam | 2025-10-29 14:00:23,200|I| Authentication strategy: "B" ibeam | 2025-10-29 14:00:23,200|I| No active sessions, logging in...
ibeam | 2025-10-29 14:00:23,200|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on ibeam | 2025-10-29 14:00:32,488|I| Gateway auth webpage loaded
ibeam | 2025-10-29 14:00:32,489|I| Login attempt number 1 ibeam | 2025-10-29 14:00:37,927|I| Submitting the form
ibeam | 2025-10-29 14:00:48,687|I| Webpage displayed "Client login succeeds" ibeam | 2025-10-29 14:00:49,687|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7d7f246224d0> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="1b026a157bfbf63eab0da80cb7e25e39")> ibeam | 2025-10-29 14:00:49,786|I| Logging in succeeded ibeam | 2025-10-29 14:00:50,459|I| NO SESSION Status(running=True, session=False, connected=False, authenticated=False, competing=False, collision=False, session_id=None, server_name=None, server_version=None, expires=None) ibeam | 2025-10-29 14:00:50,459|E| Repeatedly reauthenticating failed 3 times. Killing the Gateway and restarting the authentication process. ibeam | 2025-10-29 14:00:51,468|I| Starting maintenance with interval 60 seconds ibeam | 2025-10-29 14:01:51,468|I| Maintenance ibeam | 2025-10-29 14:01:51,472|I| Gateway not found, starting new one... ibeam | 2025-10-29 14:01:51,472|I| Note that the Gateway log below may display "Open https://localhost:[PORT] to login" - ignore this command.
ibeam | 2025-10-29 14:01:51,472|I| Starting Gateway as Linux process with params: ['bash', 'bin/run.sh', 'root/conf.yaml'] ibeam | running
ibeam | runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/* ibeam | config file : root/conf.yaml
ibeam | 2025-10-29 14:01:51,504|I| Gateway started with pids: [159]
ibeam | 2025-10-29 14:01:51,506|I| Cannot ping Gateway. Retrying for another 20 seconds ibeam | WARNING: An illegal reflective access operation has occurred
ibeam | 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) ibeam | WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
ibeam | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
ibeam | WARNING: All illegal access operations will be denied in a future release ibeam | 2025-10-29 14:01:52,507|I| Cannot ping Gateway. Retrying for another 19 seconds
ibeam | -> mount demo on /demo ibeam | Java Version: 11.0.24 ibeam | **************************************************** ibeam | version: a27ed42161ad96c53e715ca5c5e3e3fa4cff5262 Mon, 24 Apr 2023 15:41:53 -0400
ibeam | **************************************************** ibeam | This is the Client Portal Gateway
ibeam | for any issues, please contact [email protected]
ibeam | and include a copy of your logs ibeam | ****************************************************
ibeam | https://www.interactivebrokers.com/api/doc.html ibeam | ****************************************************
ibeam | Open https://localhost:5000 to login
ibeam | App demo is available after you login under: https://localhost:5000/demo#/ ibeam | 2025-10-29 14:01:54,889|I| Gateway connection established
ibeam | 2025-10-29 14:01:55,434|I| Attempt number 2 ibeam | 2025-10-29 14:01:55,917|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable ibeam | 2025-10-29 14:01:55,918|I| NO SESSION Status(running=True, session=False, connected=False, authenticated=False, competing=False, collision=False, session_id=None, server_name=None, server_version=None, expires=None)
ibeam | 2025-10-29 14:01:55,918|I| Authentication strategy: "B" ibeam | 2025-10-29 14:01:55,918|I| No active sessions, logging in...
ibeam | 2025-10-29 14:01:55,918|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on ibeam | 2025-10-29 14:02:06,909|I| Gateway auth webpage loaded
ibeam | 2025-10-29 14:02:06,909|I| Login attempt number 1 ibeam | 2025-10-29 14:02:12,323|I| Submitting the form
ibeam | 2025-10-29 14:02:23,942|I| Webpage displayed "Client login succeeds" ibeam | 2025-10-29 14:02:24,942|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7d7f23ea3350> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="e8ea4a106d0ea9530710ddebc9d4a65f")> ibeam | 2025-10-29 14:02:25,051|I| Logging in succeeded ibeam | 2025-10-29 14:02:25,733|I| NO SESSION Status(running=True, session=False, connected=False, authenticated=False, competing=False, collision=False, session_id=None, server_name=None, server_version=None, expires=None) ibeam | 2025-10-29 14:02:25,733|E| Repeatedly reauthenticating failed 3 times. Killing the Gateway and restarting the authentication process.

Hi @Voyz The issue is the login is success but the gateway authentication is failing

sanju1066 avatar Oct 29 '25 14:10 sanju1066