Voyz / ibeam

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

Ibeam won't login #222

Open IlanKalendarov opened 4 days ago

IlanKalendarov commented 4 days ago

Describe the bug When trying to login I'm getting stuck in an authentication loop Note: for some reason it works on my mac os machine on docker, but on a linux vm in digital ocean it does not work and i get the bellow errors.

Environment IBeam version: latest Docker image or standalone: Docker image

Additional context

2024-11-22 10:38:45,039|I| ############ Starting IBeam version 0.5.5 ############
2024-11-22 10:38:45,042|I| Secrets source: env
2024-11-22 10:38:45,044|I| Health server started at port=5001
2024-11-22 10:38:45,045|I| Configuration:
{'INPUTS_DIR': '/srv/inputs/', 'OUTPUTS_DIR': '/srv/outputs', 'GATEWAY_DIR': '/srv/clientportal.gw', 'CHROME_DRIVER_PATH': '/usr/bin/chromedriver', 'GATEWAY_STARTUP': 30, '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-11-22 10:38:45,046|I| Gateway not found, starting new one...
2024-11-22 10:38:45,048|I| Note that the Gateway log below may display "Open https://localhost:[PORT] to login" - ignore this command.
2024-11-22 10:38:45,049|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-11-22 10:38:45,068|I| Gateway started with pids: [13]
2024-11-22 10:38:45,072|I| Gateway running but not serving yet. Consider increasing IBEAM_GATEWAY_STARTUP timeout. Error: <urlopen error [Errno 111] Connection refused>
2024-11-22 10:38:45,073|I| Gateway connection established
2024-11-22 10:38:45,074|I| Gateway running but not serving yet. Consider increasing IBEAM_GATEWAY_STARTUP timeout. Error: <urlopen error [Errno 111] Connection refused>
2024-11-22 10:38:45,074|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-11-22 10:38:45,075|I| Authentication strategy: "B"
2024-11-22 10:38:45,075|I| No active sessions, logging in...
2024-11-22 10:38:45,076|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
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
 -> 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-11-22 10:38:58,778|I| Gateway auth webpage loaded
2024-11-22 10:38:58,779|I| Login attempt number 1
2024-11-22 10:39:04,388|I| Submitting the form
2024-11-22 10:39:06,140|I| Webpage displayed "Client login succeeds"
2024-11-22 10:39:07,141|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9d7aa550> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="11b64a034b7965f249420573b26b4cf1")>
2024-11-22 10:39:07,225|I| Logging in succeeded
2024-11-22 10:39:07,442|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:39:07,443|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-11-22 10:39:07,444|E| Repeatedly reauthenticating failed 3 times. Killing the Gateway and restarting the authentication process.
2024-11-22 10:39:08,458|I| Starting maintenance with interval 60 seconds
2024-11-22 10:40:08,459|I| Maintenance
2024-11-22 10:40:08,460|I| Gateway not found, starting new one...
2024-11-22 10:40:08,461|I| Note that the Gateway log below may display "Open https://localhost:[PORT] to login" - ignore this command.
2024-11-22 10:40:08,462|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-11-22 10:40:08,497|I| Gateway started with pids: [120]
2024-11-22 10:40:08,500|I| Gateway running but not serving yet. Consider increasing IBEAM_GATEWAY_STARTUP timeout. Error: <urlopen error [Errno 111] Connection refused>
2024-11-22 10:40:08,500|I| Gateway connection established
2024-11-22 10:40:08,504|I| Gateway running but not serving yet. Consider increasing IBEAM_GATEWAY_STARTUP timeout. Error: <urlopen error [Errno 111] Connection refused>
2024-11-22 10:40:08,504|I| Attempt number 2
2024-11-22 10:40:08,507|I| Gateway running but not serving yet. Consider increasing IBEAM_GATEWAY_STARTUP timeout. Error: <urlopen error [Errno 111] Connection refused>
2024-11-22 10:40:08,507|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:40:08,507|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-11-22 10:40:08,508|I| Authentication strategy: "B"
2024-11-22 10:40:08,508|I| No active sessions, logging in...
2024-11-22 10:40:08,508|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
2024-11-22 10:40:10,386|E| Error encountered during authentication 
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 432, in login
    wait_and_identify_trigger = self.load_page(targets, driver, self.base_url, self.route_auth)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/ibeam/src/handlers/login_handler.py", line 395, in load_page
    driver.get(base_url + route_auth)
  File "/opt/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 353, in get
    self.execute(Command.GET, {"url": url})
  File "/opt/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 344, in execute
    self.error_handler.check_response(response)
  File "/opt/venv/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)

  <class 'selenium.common.exceptions.WebDriverException'> Message: unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: chrome-headless-shell=120.0.6099.224)
Stacktrace:
#0 0x5e7bd222e233 <unknown>
#1 0x5e7bd1ef80fe <unknown>
#2 0x5e7bd1ef0c66 <unknown>
#3 0x5e7bd1ee2c05 <unknown>
#4 0x5e7bd1ee4660 <unknown>
#5 0x5e7bd1ee312e <unknown>
#6 0x5e7bd1ee1fd7 <unknown>
#7 0x5e7bd1ee1e6c <unknown>
#8 0x5e7bd1ee0943 <unknown>
#9 0x5e7bd1ee0d94 <unknown>
#10 0x5e7bd1efb662 <unknown>
#11 0x5e7bd1f8cc56 <unknown>
#12 0x5e7bd1f6f422 <unknown>
#13 0x5e7bd1f8c680 <unknown>
#14 0x5e7bd1f6f1a3 <unknown>
#15 0x5e7bd1f3413e <unknown>
#16 0x5e7bd1f35712 <unknown>
#17 0x5e7bd2203534 <unknown>
#18 0x5e7bd2206759 <unknown>
#19 0x5e7bd2206238 <unknown>
#20 0x5e7bd2206c05 <unknown>
#21 0x5e7bd21f5abf <unknown>
#22 0x5e7bd2206f8e <unknown>
#23 0x5e7bd21dfc86 <unknown>
#24 0x5e7bd221f3e5 <unknown>
#25 0x5e7bd221f5cb <unknown>
#26 0x5e7bd222d7bf <unknown>
#27 0x729fa5e1bea7 start_thread

2024-11-22 10:40:10,387|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9d423a10> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="b31c401cf8d4cad47fe47be13ede323a")>
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-11-22 10:40:10,941|I| Logging in failed
 -> 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-11-22 10:41:08,458|I| Maintenance
2024-11-22 10:41:09,382|I| Attempt number 2
2024-11-22 10:41:09,784|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:41:09,786|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-11-22 10:41:09,787|I| Authentication strategy: "B"
2024-11-22 10:41:09,788|I| No active sessions, logging in...
2024-11-22 10:41:09,788|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
2024-11-22 10:41:18,671|I| Gateway auth webpage loaded
2024-11-22 10:41:18,671|I| Login attempt number 1
2024-11-22 10:41:24,296|I| Submitting the form
2024-11-22 10:41:25,377|I| Webpage displayed "Client login succeeds"
2024-11-22 10:41:26,378|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9d426010> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="a4263a56913c701e40124b333b833544")>
2024-11-22 10:41:26,474|I| Logging in succeeded
2024-11-22 10:41:34,292|I| AUTHENTICATED Status(running=True, session=True, connected=True, authenticated=True, competing=False, collision=False, session_id='802c549bd5250b3fd0945c61c7516c7b', server_name='JifZ26091', server_version='Build 10.32.1a, Nov 18, 2024 6:12:24 PM', expires=600000)
2024-11-22 10:41:44,140|I| Gateway running and authenticated, session id: 802c549bd5250b3fd0945c61c7516c7b, server name: JifZ26091
2024-11-22 10:42:08,460|I| Maintenance
2024-11-22 10:42:18,554|E| IBKR service unavailable: "HTTP Error 503: Service Unavailable". It seems IBKR servers are not ready to handle requests. We may need to wait until the servers are ready.
2024-11-22 10:42:18,556|I| Attempt number 2
2024-11-22 10:42:28,632|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:42:28,632|E| IBKR service unavailable: "HTTP Error 503: Service Unavailable". It seems IBKR servers are not ready to handle requests. We may need to wait until the servers are ready.
2024-11-22 10:42:28,633|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-11-22 10:42:28,633|I| Authentication strategy: "B"
2024-11-22 10:42:28,633|I| No active sessions, logging in...
2024-11-22 10:42:28,633|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
2024-11-22 10:42:37,246|I| Gateway auth webpage loaded
2024-11-22 10:42:37,247|I| Login attempt number 1
2024-11-22 10:42:42,840|I| Submitting the form
2024-11-22 10:42:44,544|I| Webpage displayed "Client login succeeds"
2024-11-22 10:42:45,545|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9d78b190> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="9826697cfe272eea49fd51c7fd5adc7e")>
2024-11-22 10:42:45,673|I| Logging in succeeded
2024-11-22 10:42:45,762|I| AUTHENTICATED Status(running=True, session=True, connected=True, authenticated=True, competing=False, collision=False, session_id='635f0b8f67c6e9510091644d617ddf17', server_name='JifZ26091', server_version='Build 10.32.1a, Nov 18, 2024 6:12:24 PM', expires=527434)
2024-11-22 10:42:45,871|I| Gateway running and authenticated, session id: 635f0b8f67c6e9510091644d617ddf17, server name: JifZ26091
2024-11-22 10:43:08,458|I| Maintenance
2024-11-22 10:43:08,538|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:43:08,542|I| Attempt number 2
2024-11-22 10:43:08,654|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:43:08,654|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:43:08,655|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-11-22 10:43:08,655|I| Authentication strategy: "B"
2024-11-22 10:43:08,655|I| No active sessions, logging in...
2024-11-22 10:43:08,655|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
2024-11-22 10:43:16,512|I| Gateway auth webpage loaded
2024-11-22 10:43:16,512|I| Login attempt number 1
2024-11-22 10:43:22,199|I| Submitting the form
2024-11-22 10:43:23,122|I| Webpage displayed "Client login succeeds"
2024-11-22 10:43:24,122|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9d499f50> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="631b6d45cf502ab4c18fbd77df88e6a7")>
2024-11-22 10:43:24,217|I| Logging in succeeded
2024-11-22 10:43:24,442|I| AUTHENTICATED Status(running=True, session=True, connected=True, authenticated=True, competing=False, collision=False, session_id='635f0b8f67c6e9510091644d617ddf17', server_name='JifZ26091', server_version='Build 10.32.1a, Nov 18, 2024 6:12:24 PM', expires=488747)
2024-11-22 10:43:24,811|I| Gateway running and authenticated, session id: 635f0b8f67c6e9510091644d617ddf17, server name: JifZ26091
2024-11-22 10:44:08,459|I| Maintenance
2024-11-22 10:44:18,510|I| Attempt number 2
2024-11-22 10:44:18,510|E| IBKR service unavailable: "HTTP Error 503: Service Unavailable". It seems IBKR servers are not ready to handle requests. We may need to wait until the servers are ready.
2024-11-22 10:44:28,560|E| IBKR service unavailable: "HTTP Error 503: Service Unavailable". It seems IBKR servers are not ready to handle requests. We may need to wait until the servers are ready.
2024-11-22 10:44:28,563|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:44:28,563|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-11-22 10:44:28,563|I| Authentication strategy: "B"
2024-11-22 10:44:28,563|I| No active sessions, logging in...
2024-11-22 10:44:28,564|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
2024-11-22 10:44:36,902|I| Gateway auth webpage loaded
2024-11-22 10:44:36,902|I| Login attempt number 1
2024-11-22 10:44:42,534|I| Submitting the form
2024-11-22 10:44:43,608|I| Webpage displayed "Client login succeeds"
2024-11-22 10:44:44,609|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9f12a950> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="5003dafe03d29bcd8f11b03a0532a87c")>
2024-11-22 10:44:44,691|I| Logging in succeeded
2024-11-22 10:44:46,365|I| AUTHENTICATED Status(running=True, session=True, connected=True, authenticated=True, competing=False, collision=False, session_id='635f0b8f67c6e9510091644d617ddf17', server_name='JifZ26091', server_version='Build 10.32.1a, Nov 18, 2024 6:12:24 PM', expires=406825)
2024-11-22 10:44:55,457|I| Gateway running and authenticated, session id: 635f0b8f67c6e9510091644d617ddf17, server name: JifZ26091
2024-11-22 10:45:08,458|I| Maintenance
2024-11-22 10:45:08,602|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:45:08,604|I| Attempt number 2
2024-11-22 10:45:08,688|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:45:08,688|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:45:08,690|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-11-22 10:45:08,690|I| Authentication strategy: "B"
2024-11-22 10:45:08,691|I| No active sessions, logging in...
2024-11-22 10:45:08,691|I| Loading auth webpage at https://localhost:5000/sso/Login?forwardTo=22&RL=1&ip2loc=on
2024-11-22 10:45:16,665|I| Gateway auth webpage loaded
2024-11-22 10:45:16,665|I| Login attempt number 1
2024-11-22 10:45:22,240|I| Submitting the form
2024-11-22 10:45:23,336|I| Webpage displayed "Client login succeeds"
2024-11-22 10:45:24,338|I| Cleaning up the resources. Display: <pyvirtualdisplay.display.Display object at 0x7daa9d56d110> | Driver: <selenium.webdriver.chrome.webdriver.WebDriver (session="4e05330cb963bf952ddc77ba23496939")>
2024-11-22 10:45:24,421|I| Logging in succeeded
2024-11-22 10:45:24,481|I| AUTHENTICATED Status(running=True, session=True, connected=True, authenticated=True, competing=False, collision=False, session_id='635f0b8f67c6e9510091644d617ddf17', server_name='JifZ26091', server_version='Build 10.32.1a, Nov 18, 2024 6:12:24 PM', expires=368713)
2024-11-22 10:45:24,539|I| Gateway running and authenticated, session id: 635f0b8f67c6e9510091644d617ddf17, server name: JifZ26091
2024-11-22 10:46:08,458|I| Maintenance
2024-11-22 10:46:16,583|I| Gateway running and authenticated, session id: 635f0b8f67c6e9510091644d617ddf17, server name: JifZ26091
2024-11-22 10:47:08,459|I| Maintenance
2024-11-22 10:47:08,545|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:47:08,547|I| Attempt number 2
2024-11-22 10:47:08,609|E| IBKR server error: "HTTP Error 500: Internal Server Error". One of reasons for this error is IBKR server restart.
2024-11-22 10:47:08,610|I| Max request retries reached after 2 attempts. Consider increasing the retries by setting IBEAM_REQUEST_RETRIES environment variable
2024-11-22 10:47:08,612|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)

It did work for a few days but know I just get this loop.

Voyz commented 12 hours ago

Hi @IlanKalendarov - can you indicate if it still happens?

This line:

IBKR service unavailable: "HTTP Error 503: Service Unavailable". It seems IBKR servers are not ready to handle requests. We may need to wait until the servers are ready.

Indicates that this most likely was caused by IBKR, possibly server restarts or maintenance.

IlanKalendarov commented 3 hours ago

That behavior seems to occur every few hours, which is unusual. I didn’t have it while using TWS.