Skip to content

Tickler error sometimes #115

@oleg-d

Description

@oleg-d

Describe Enhancement

Sometimes I will see a Tickler error in the logs, looks like some timeout is happening. Is there something I need to be calling on a regular basis?

For my health check I already call self.client.initialize_brokerage_session(compete=True) every 60 mins, but on average about once a night i will see this tickler error occurred when I check in the morning as the app is left running in a VPS.

Should i be calling self.client.tickle() ?

2025-06-12 00:06:21,238|E| Tickler error:
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1032, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1075, in _bootstrap_inner
    self.run()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\client\ibkr_utils.py", line 568, in _worker
    _LOGGER.error(f'Tickler error: {exception_to_string(e)}')
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\client\ibkr_utils.py", line 563, in _worker
    self._client.tickle()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\client\ibkr_client_mixins\session_mixin.py", line 49, in tickle
    return self.post('tickle', log=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\base\rest_client.py", line 156, in post
    return self.request(method='POST', endpoint=path, base_url=base_url, extra_headers=extra_headers, json=params, log=log)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\base\rest_client.py", line 200, in request
    return self._request(method, endpoint, base_url, extra_headers, log, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\client\ibkr_client.py", line 123, in _request
    return super()._request(method, endpoint, base_url, extra_headers, log, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\base\rest_client.py", line 241, in _request
    raise TimeoutError(f'{self}: Reached max retries ({self._max_retries}) for {method} {url} {kwargs}') from e

  <class 'TimeoutError'> IbkrClient: Reached max retries (3) for POST https://api.ibkr.com/v1/api/tickle {}

The below exception was the direct cause of the above exception:

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\ibind\base\rest_client.py", line 235, in _request
    response = request_function(method, url, verify=self.cacert, headers=headers, timeout=self._timeout, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\adapters.py", line 713, in send
    raise ReadTimeout(e, request=request)

  <class 'requests.exceptions.ReadTimeout'> HTTPSConnectionPool(host='api.ibkr.com', port=443): Read timed out. (read timeout=10)

Context

It doesnt seem to affect the IBKR connection really as even after the tickler error connection is either restored or still remains valid as I can check PnL through my app for example.

Possible Implementation

Your Environment

  • IBind version: 0.1.14
  • Python version (e.g. 3.10): 3.12
  • Authentication method (Gateway, IBeam or OAuth): OAuth
  • Operating System and version: Windows Server 2022
  • Link to your project/code (if public)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions