Open partakpavel opened 1 month ago
have the same thing after 2 weeks of active work
any solution here?
Hey @partakpavel @podoliako thanks for your patience, I was travelling over the past few weeks 🙏
Can you try the solution proposed here and let me know if it helps:
https://github.com/Voyz/ibeam/issues/185#issuecomment-2122919775
IBEAM_TWO_FA_EL_ID=ID@@xyz-field-silver-response
IBEAM_TWO_FA_INPUT_EL_ID=ID@@xyz-field-silver-response
Hi guys!
At the end we started to use OAuth for institutional clients
@podoliako Did you get access to OAuth 2.0? Can you tell me how you did it? Thank you!
@Voyz Getting an error when trying iBeam. Maybe the html/css is broken? Here is the error:
Website URL: https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
Exception:
File "/srv/ibeam/ibeam_starter.py", line 172, in
<class 'selenium.common.exceptions.TimeoutException'> Message:
@jetsondavis-genesis thanks for sharing this. Can you indicate if this persists if you try the solution I propose in my previous reply?
Hi, on my credentials I cant logging. Getting this log. Where is the issue?
Java Version: 11.0.24
version: a27ed42161ad96c53e715ca5c5e3e3fa4cff5262 Mon, 24 Apr 2023 15:41:53 -0400
This is the Client Portal Gateway for any issues, please contact api@ibkr.com and include a copy of your logs
https://www.interactivebrokers.com/api/doc.html
Open https://localhost:5000 to login App demo is available after you login under: https://localhost:5000/demo#/ 2024-10-02 14:48:16,287|I| Gateway connection established 2024-10-02 14:48:16,523|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) 2024-10-02 14:48:16,524|I| Authentication strategy: "B" 2024-10-02 14:48:16,524|I| No active sessions, logging in... 2024-10-02 14:48:16,524|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on 2024-10-02 14:48:25,119|I| Gateway auth webpage loaded 2024-10-02 14:48:25,119|I| Login attempt number 1 2024-10-02 14:48:31,327|I| Submitting the form 2024-10-02 14:48:46,729|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x707025cbfad0> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="f5cb48e9830074883cf8100a8627c353")> 2024-10-02 14:48:46,729|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 172, 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 466, 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 447, in login
self.attempt(targets, wait_and_identify_trigger, driver)
File "/srv/ibeam/src/handlers/login_handler.py", line 371, 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 188, 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:
2024-10-02 14:48:46,808|I| Logging in failed 2024-10-02 14:48:46,814|I| Starting maintenance with interval 60 seconds 2024-10-02 14:49:46,815|I| Maintenance 2024-10-02 14:49:46,949|I| Attempt number 2 2024-10-02 14:49:47,052|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable 2024-10-02 14:49:47,053|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) 2024-10-02 14:49:47,053|I| Authentication strategy: "B" 2024-10-02 14:49:47,056|I| No active sessions, logging in... 2024-10-02 14:49:47,056|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on 2024-10-02 14:49:54,517|I| Gateway auth webpage loaded 2024-10-02 14:49:54,518|I| Login attempt number 1 2024-10-02 14:50:00,263|I| Submitting the form 2024-10-02 14:50:16,302|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 "/usr/local/lib/python3.11/threading.py", line 995, in _bootstrap self._bootstrap_inner() File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/usr/local/lib/python3.11/threading.py", line 975, in run self._target(*self._args, self._kwargs) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 83, in _worker work_item.run() File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) File "/opt/venv/lib/python3.11/site-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(job.args, job.kwargs) File "/srv/ibeam/src/gateway_client.py", line 115, in _maintenance success, shutdown, status = self.start_and_authenticate(request_retries=self.request_retries) 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 466, 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 447, in login self.attempt(targets, wait_and_identify_trigger, driver) File "/srv/ibeam/src/handlers/login_handler.py", line 371, 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 188, 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:
2024-10-02 14:50:16,302|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x70702752ebd0> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="768904609676a02df11acddec9c7cbe8")> 2024-10-02 14:50:16,385|I| Logging in failed 2024-10-02 14:50:46,815|I| Maintenance 2024-10-02 14:50:46,958|I| Attempt number 2 2024-10-02 14:50:47,134|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable 2024-10-02 14:50:47,134|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) 2024-10-02 14:50:47,134|I| Authentication strategy: "B" 2024-10-02 14:50:47,134|I| No active sessions, logging in... 2024-10-02 14:50:47,134|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on 2024-10-02 14:50:55,004|I| Gateway auth webpage loaded 2024-10-02 14:50:55,004|I| Login attempt number 1 2024-10-02 14:51:00,739|I| Submitting the form 2024-10-02 14:51:16,489|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 "/usr/local/lib/python3.11/threading.py", line 995, in _bootstrap self._bootstrap_inner() File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/usr/local/lib/python3.11/threading.py", line 975, in run self._target(*self._args, self._kwargs) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 83, in _worker work_item.run() File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) File "/opt/venv/lib/python3.11/site-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(job.args, job.kwargs) File "/srv/ibeam/src/gateway_client.py", line 115, in _maintenance success, shutdown, status = self.start_and_authenticate(request_retries=self.request_retries) 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 466, 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 447, in login self.attempt(targets, wait_and_identify_trigger, driver) File "/srv/ibeam/src/handlers/login_handler.py", line 371, 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 188, 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:
2024-10-02 14:51:16,490|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x70702540ef10> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="c94c4527e328294acfabd7ce7aeb1faa")> 2024-10-02 14:51:16,594|I| Logging in failed ^C root@ibkr20:~/ibeam_project# docker stop ibeam ^C root@ibkr20:~/ibeam_project# docker rm ibeam ibeam root@ibkr20:~/ibeam_project# docker run --env IBEAM_ACCOUNT=partakpavel --env IBEAM_PASSWORD=301ws24P1 -p 5000:5000 voyz/ibeam 2024-10-02 14:52:21,154|I| ############ Starting IBeam version 0.5.5 ############ 2024-10-02 14:52:21,159|I| Secrets source: env 2024-10-02 14:52:21,161|I| Health server started at port=5001 2024-10-02 14:52:21,162|I| Configuration: {'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', '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@@chlginput', 'TWO_FA_HANDLER': None, 'STRICT_TWO_FA_CODE': True, 'TWO_FA_SELECT_EL_ID': 'ID@@sf_select', 'TWO_FA_SELECT_TARGET': 'IB Key', 'CUSTOM_TWO_FA_HANDLER': 'custom_two_fa_handler.CustomTwoFaHandler'} 2024-10-02 14:52:21,163|I| Gateway not found, starting new one... 2024-10-02 14:52:21,164|I| Note that the Gateway log below may display "Open https://localhost:[PORT] to login" - ignore this command. 2024-10-02 14:52:21,164|I| Starting Gateway as Linux process with params: ['bash', 'bin/run.sh', 'root/conf.yaml'] running
runtime path : root:dist/ibgroup.web.core.iblink.router.clientportal.gw.jar:build/lib/runtime/* config file : root/conf.yaml 2024-10-02 14:52:21,172|I| Gateway started with pids: [13] 2024-10-02 14:52:21,175|I| Cannot ping Gateway. Retrying for another 20 seconds WARNING: An illegal reflective access operation has occurred 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) WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2024-10-02 14:52:22,179|I| Cannot ping Gateway. Retrying for another 19 seconds -> mount demo on /demo Java Version: 11.0.24
version: a27ed42161ad96c53e715ca5c5e3e3fa4cff5262 Mon, 24 Apr 2023 15:41:53 -0400
This is the Client Portal Gateway for any issues, please contact api@ibkr.com and include a copy of your logs
https://www.interactivebrokers.com/api/doc.html
Open https://localhost:5000 to login App demo is available after you login under: https://localhost:5000/demo#/ 2024-10-02 14:52:23,969|I| Gateway connection established 2024-10-02 14:52:24,122|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) 2024-10-02 14:52:24,122|I| Authentication strategy: "B" 2024-10-02 14:52:24,122|I| No active sessions, logging in... 2024-10-02 14:52:24,122|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on 2024-10-02 14:52:33,347|I| Gateway auth webpage loaded 2024-10-02 14:52:33,348|I| Login attempt number 1 2024-10-02 14:52:38,992|I| Submitting the form 2024-10-02 14:52:54,392|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x71b728718810> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="32083793aa131fe5f2e8df423a6cec7a")> 2024-10-02 14:52:54,392|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 172, 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 466, 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 447, in login
self.attempt(targets, wait_and_identify_trigger, driver)
File "/srv/ibeam/src/handlers/login_handler.py", line 371, 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 188, 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:
2024-10-02 14:52:54,452|I| Logging in failed 2024-10-02 14:52:54,456|I| Starting maintenance with interval 60 seconds