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.

AttributeError 'SSLSocket' object has not attribute 'connection'

See original GitHub issue

I am attempting to make a simple call via boto3 to get parameters from the SSM store. However, when I make a basic call, I am consistently running into an internal boto3 error. Not sure if boto3 is broken or if I am just doing something wrong…

import boto3

region = 'us-east-1'
session = boto3.Session(region_name = region, profile_name = 'custom')
ssm = session.client('ssm')

test = ssm.get_parameters(Name = '/location/to/desired/params', WithDecryption=True)

This is consistently providing the following error after the last line:

Traceback (most recent call last):

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\httpsession.py", line 263, in send
    chunked=self._chunked(request.headers),

  File "C:\Users\me\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 677, in urlopen
    chunked=chunked,

  File "C:\Users\me\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)

  File "C:\Users\me\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 978, in _validate_conn
    conn.connect()

  File "C:\Users\me\Anaconda3\lib\site-packages\urllib3\connection.py", line 371, in connect
    ssl_context=context,

  File "C:\Users\me\Anaconda3\lib\site-packages\snowflake\connector\ssl_wrap_socket.py", line 404, in ssl_wrap_socket_with_ocsp
    ).validate(server_hostname, ret.connection)

AttributeError: 'SSLSocket' object has no attribute 'connection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "<ipython-input-11-e49109764d13>", line 7, in <module>
    test = ssm.get_parameter(Name='/location/to/data/ssm',  WithDecryption=True)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\client.py", line 337, in _api_call
    return self._make_api_call(operation_name, kwargs)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\client.py", line 643, in _make_api_call
    operation_model, request_dict, request_context)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\client.py", line 662, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\endpoint.py", line 137, in _send_request
    success_response, exception):

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\endpoint.py", line 256, in _needs_retry
    caught_exception=caught_exception, request_dict=request_dict)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\hooks.py", line 211, in _emit
    response = handler(**kwargs)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\retryhandler.py", line 183, in __call__
    if self._checker(attempts, response, caught_exception):

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\retryhandler.py", line 251, in __call__
    caught_exception)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\retryhandler.py", line 269, in _should_retry
    return self._checker(attempt_number, response, caught_exception)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\retryhandler.py", line 317, in __call__
    caught_exception)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\retryhandler.py", line 223, in __call__
    attempt_number, caught_exception)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\retryhandler.py", line 359, in _check_caught_exception
    raise caught_exception

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\endpoint.py", line 200, in _do_get_response
    http_response = self._send(request)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\endpoint.py", line 269, in _send
    return self.http_session.send(request)

  File "C:\Users\me\Anaconda3\lib\site-packages\botocore\httpsession.py", line 299, in send
    raise HTTPClientError(error=e)

HTTPClientError: An HTTP Client raised an unhandled exception: 'SSLSocket' object has no attribute 'connection'

I did try upgrading boto3 and I am still having the error. Note I am running this in Spyder.

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
WolVeczcommented, Nov 20, 2020

yeah snowflake connector is an embarrasment… still seing this issue every week 😄

It is truly one of the worst packages I have used to-date. Lets hope they rebuild their package with all that fresh IPO money they just got.

2reactions
swetashrecommented, Sep 4, 2020

@WolVecz - Thank you for your post. It looks like the error is coming from snowflake connector. Are you suing snowflake connector in your code ? I found some issue in snowflake github repo which might help: https://github.com/snowflakedb/snowflake-connector-python/issues/324

It looks like an issue with snowflake connector rather than boto3. I would recommend checking their github repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'SSLSocket' object has no attribute 'connection ...
SNOW-172208 : AttributeError: 'SSLSocket' object has no attribute 'connection' while running test on Airflow #335.
Read more >
python 3.x - Error with Python3 to connect to snowflake ...
I am trying to install it on Ubuntu OS and trying to connect to snowflake, but it gives the error AttributeError: 'SSLSocket' object...
Read more >
Failed to execute:'SSLSocket' object has no attribute 'conn
I am trying to install it on Ubuntu OS and trying to connect to snowflake, but it gives the error AttributeError: 'SSLSocket' object...
Read more >
Having 'SSLSocket' object has no attribute 'connection' issue
the dbt package runs fine yesterday. but today suddenly has this issue. saying 'SSLSocket' object has no attribute 'connection'.
Read more >
[PYTHON-2320] Jython SSL + poll fails with AttributeError
It's no longer possible to reliably connect to Atlas clusters with Jython ... AttributeError: 'SSLSocket' object has no attribute 'channel' ...
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