question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Max retries exceeded

See original GitHub issue
2020-07-20 18:03:27,588 - INFO - Importing playlist ANIIML - We.Animals (2015)...
Traceback (most recent call last):
  File "importer.py", line 235, in <module>
    Importer(spotify_client_, yandex_client_, arguments.ignore).import_all()
  File "importer.py", line 192, in import_all
    item()
  File "importer.py", line 160, in import_playlists
    self._add_items_to_spotify(tracks, self.not_imported[playlist.title], save_tracks_callback, Type.TRACK)
  File "importer.py", line 100, in _add_items_to_spotify
    if item.available:
AttributeError: 'NoneType' object has no attribute 'available'
tu@inspiron3542:~/yandex2spotify$
tu@inspiron3542:~/yandex2spotify$ python3 importer.py -u vlad.turchinskiy@yandex.com -l vlad.turchinskiy@ya.ru -p db6aaeea312a1eeea2afc526051d3591
Traceback (most recent call last):
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connection.py", line 334, in connect
    conn = self._new_conn()
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f427feca2e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tu/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/tu/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f427feca2e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/utils/request.py", line 194, in _request_wrapper
    resp = requests.request(*args, **kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f427feca2e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "importer.py", line 229, in <module>
    yandex_client_ = Client.from_credentials(arguments.login, arguments.password, captcha_callback=proc_captcha)
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/client.py", line 148, in from_credentials
    token = cls(*args, **kwargs).generate_token_by_username_and_password(username, password,
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/client.py", line 118, in __init__
    self.me = self.account_status()
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/client.py", line 34, in wrapper
    result = method(*args, **kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/client.py", line 262, in account_status
    result = self._request.get(url, timeout=timeout, *args, **kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/utils/request.py", line 239, in get
    timeout=timeout, *args, **kwargs)
  File "/home/tu/.local/lib/python3.6/site-packages/yandex_music/utils/request.py", line 198, in _request_wrapper
    raise NetworkError(e)
yandex_music.exceptions.NetworkError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f427feca2e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lemonpaulcommented, Jul 20, 2020

“Collective” doesn’t mean “private” or “public”. It means that more than one user can add tracks in this playlist. There is such feature. Screenshot from 2020-07-20 14-17-40 It relates to this exception:

2020-07-20 18:03:27,588 - INFO - Importing playlist ANIIML - We.Animals (2015)...
Traceback (most recent call last):
  File "importer.py", line 235, in <module>
    Importer(spotify_client_, yandex_client_, arguments.ignore).import_all()
  File "importer.py", line 192, in import_all
    item()
  File "importer.py", line 160, in import_playlists
    self._add_items_to_spotify(tracks, self.not_imported[playlist.title], save_tracks_callback, Type.TRACK)
  File "importer.py", line 100, in _add_items_to_spotify
    if item.available:
AttributeError: 'NoneType' object has no attribute 'available'

But max retries exceeded exception seems like not issue for this project. Maybe for yandex-music-api.

1reaction
vtuucommented, Jul 20, 2020

Anyway this must be correctly handled

Read more comments on GitHub >

github_iconTop Results From Across the Web

Max retries exceeded with URL in requests - Stack Overflow
This happens when you send too many requests to the public IP address of https://itunes.apple.com . It as you can see caused due...
Read more >
(Python) ConnectionError: Max retries exceeded with url
To solve the requests ConnectionError: Max retries exceeded with url, use a `Retry` object and specify how many connection-related errors to retry on...
Read more >
Fix “Max retries exceeded with URL” error in Python ... - LinuxPip
Another way that you can avoid “Max retries exceeded with URL” error, especially when the server is busy handling a huge number of...
Read more >
Fix Requests Max Retries Exceeded With Url in Python
The “Max retries exceeded with url” error is caused by an invalid URL, server overloading, failed SSL verification, unstable internet connection ...
Read more >
max-retries-exceeded exceptions are confusing #1198 - GitHub
In urllib3 it seems the confusing errors can be triggered here via requests. It'd almost be nice to only raise a MaxRetryError when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found