Tinkoff / invest-python

Tinkoff Invest Python gRPC client
https://tinkoff.github.io/invest-python/
Apache License 2.0
303 stars 88 forks source link

[Bug] Options(INSTRUMENT_STATUS_ALL): Received message larger than max (4705199 vs. 4194304) #198

Closed dsdante closed 1 year ago

dsdante commented 1 year ago

Что случилось?

При запросе опционов с INSTRUMENT_STATUS_ALL возвращается ошибка Received message larger than max (4705199 vs. 4194304).

В первый раз такой запрос попробовал сегодня днём, всё было ок. Проблема началась где-то час назад.

В Kreya запрос работает нормально.

Воспроизведение

import os
import tinkoff.invest as ti

with ti.Client(os.environ['INVEST_TOKEN']) as client:
    options = client.instruments.options(instrument_status=ti.schemas.InstrumentStatus.INSTRUMENT_STATUS_ALL)

Tinkoff Invest Version

0.2.0-beta47

Python Version

3.10

OS

Linux

Логи

63fce237c678827ff0f2dcef38152a9b Options RESOURCE_EXHAUSTED Received message larger than max (4705199 vs. 4194304)
Traceback (most recent call last):
  File "/home/***/venv/lib/python3.10/site-packages/tinkoff/invest/_errors.py", line 18, in wrapper
    return func(*args, **kwargs)
  File "/home/***/venv/lib/python3.10/site-packages/tinkoff/invest/services.py", line 588, in options
    response, call = self.stub.Options.with_call(
  File "/home/***/venv/lib/python3.10/site-packages/grpc/_channel.py", line 1043, in with_call
    return _end_unary_response_blocking(state, call, True, None)
  File "/home/***/venv/lib/python3.10/site-packages/grpc/_channel.py", line 910, in _end_unary_response_blocking
    raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.RESOURCE_EXHAUSTED
    details = "Received message larger than max (4705199 vs. 4194304)"
    debug_error_string = "UNKNOWN:Error received from peer invest-public-api.tinkoff.ru {created_time:"2023-02-27T20:02:48.888444197+03:00", grpc_status:8, grpc_message:"Received message larger than max (4705199 vs. 4194304)"}"
>

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

Traceback (most recent call last):
  File "/home/***/.config/JetBrains/PyCharmCE2022.3/scratches/scratch_1.py", line 5, in <module>
    options = client.instruments.options(instrument_status=ti.schemas.InstrumentStatus.INSTRUMENT_STATUS_ALL)
  File "/home/***/venv/lib/python3.10/site-packages/tinkoff/invest/_errors.py", line 28, in wrapper
    raise RequestError(
tinkoff.invest.exceptions.RequestError: (<StatusCode.RESOURCE_EXHAUSTED: (8, 'resource exhausted')>, 'Received message larger than max (4705199 vs. 4194304)', Metadata(tracking_id='63fce237c678827ff0f2dcef38152a9b', ratelimit_limit='200, 200;w=60', ratelimit_remaining=199, ratelimit_reset=13, message=None))
irusland commented 1 year ago

@AlexanderVolkovTCS fyi

bkoddo commented 1 year ago

Судя по всему проблема еще актуальна. У меня такая же ошибка.