Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccxt.base.errors.RequestTimeout #10217

Closed
Reeshark opened this issue May 16, 2024 · 1 comment
Closed

ccxt.base.errors.RequestTimeout #10217

Reeshark opened this issue May 16, 2024 · 1 comment
Labels
Question Questions - will be closed after some period of inactivity.

Comments

@Reeshark
Copy link

I'm sure my proxy is able to access the "https://api.binance.com/api/v3/exchangeInfo". Both "curl -x 127.0.0.1:7777 https://api.binance.com/api/v3/exchangeInfocurl" and enter the url directly on browse are work.

But when I execute "freqtrade backtesting -c user_data\config2.json --strategy Strategy001'":

2024-05-17 01:02:20,910 - freqtrade - INFO - freqtrade 2024.4
2024-05-17 01:02:20,912 - freqtrade.configuration.load_config - INFO - Using config: user_data\config2.json ...
2024-05-17 01:02:20,913 - freqtrade.loggers - INFO - Verbosity set to 0
2024-05-17 01:02:20,913 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 20 ...
2024-05-17 01:02:20,913 - freqtrade.configuration.configuration - INFO - Using user-data directory: D:\Trade\freqtrade\user_data ...
2024-05-17 01:02:20,914 - freqtrade.configuration.configuration - INFO - Using data directory: D:\Trade\freqtrade\user_data\data\binance ...
2024-05-17 01:02:20,914 - freqtrade.configuration.configuration - INFO - Parameter --cache=day detected ...
2024-05-17 01:02:20,914 - freqtrade.exchange.check_exchange - INFO - Checking exchange...
2024-05-17 01:02:20,922 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2024-05-17 01:02:20,922 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2024-05-17 01:02:20,922 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2024-05-17 01:02:20,924 - freqtrade.commands.optimize_commands - INFO - Starting freqtrade in Backtesting mode
2024-05-17 01:02:20,925 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2024-05-17 01:02:20,925 - freqtrade.exchange.exchange - INFO - Using CCXT 4.3.21
2024-05-17 01:02:20,925 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-05-17 01:02:20,932 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'swap'}}
2024-05-17 01:02:20,939 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2024-05-17 01:02:30,953 - freqtrade.exchange.exchange - ERROR - Unable to initialize markets.
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connection.py", line 198, in _new_conn
sock = connection.create_connection(
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
socket.timeout: timed out

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

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connectionpool.py", line 793, in urlopen
response = self._make_request(
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request
raise new_e
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connectionpool.py", line 1099, in _validate_conn
conn.connect()
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connection.py", line 616, in connect
self.sock = sock = self._new_conn()
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connection.py", line 207, in _new_conn
raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x000002AAC04C8B20>, 'Connection to api.binance.com timed out. (connect timeout=10.0)')

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

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen
retries = retries.increment(
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v3/exchangeInfo (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000002AAC04C8B20>, 'Connection to api.binance.com timed out. (connect timeout=10.0)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\base\exchange.py", line 619, in fetch
response = self.session.request(
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\requests\adapters.py", line 507, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.binance.com', port=443): Max retries exceeded with url: /api/v3/exchangeInfo (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000002AAC04C8B20>, 'Connection to api.binance.com timed out. (connect timeout=10.0)'))

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

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\freqtrade\exchange\exchange.py", line 493, in _load_markets
self._markets = self._api.load_markets(params={})
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\base\exchange.py", line 1534, in load_markets
markets = self.fetch_markets(params)
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\binance.py", line 2818, in fetch_markets
promisesRaw.append(self.publicGetExchangeInfo(params))
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\base\types.py", line 35, in unbound_method
return _self.request(self.path, self.api, self.method, params, config=self.config)
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\binance.py", line 10322, in request
response = self.fetch2(path, api, method, params, headers, body, config)
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\base\exchange.py", line 3678, in fetch2
return self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "C:\ProgramData\Anaconda3\envs\freqtrade\lib\site-packages\ccxt\base\exchange.py", line 649, in fetch
raise RequestTimeout(details) from e
ccxt.base.errors.RequestTimeout: binance GET https://api.binance.com/api/v3/exchangeInfo
2024-05-17 01:02:30,960 - freqtrade - ERROR - Could not load markets, therefore cannot start. Please investigate the above error for more details.

How can I revise my config to solve this issue?

@Reeshark Reeshark added the Triage Needed Issues yet to verify label May 16, 2024
@xmatthias xmatthias added Question Questions - will be closed after some period of inactivity. and removed Triage Needed Issues yet to verify labels May 16, 2024
@xmatthias
Copy link
Member

xmatthias commented May 16, 2024

Please get used to filling out the issue template. Those who frequently omit the template may have their issues closed without comment.
We're asking some very basic questions - by deleting the issue template, you're explicitly choosing not to answer our questions.

Filling out the template helps reduce our workload, and we greatly appreciate that.


there's no sign of a proxy being used in the logs - yet you mention a proxy being used (which doesn't seem to be configured).
it seems like the system your bot is running on is not able to connect to binance (or has no internet at all, that's not immediately clear).

If you expect the bot to use a proxy - please refer to the documentation on how to configure one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Questions - will be closed after some period of inactivity.
Projects
None yet
Development

No branches or pull requests

2 participants