GithubHelp home page GithubHelp logo

Comments (16)

ctb avatar ctb commented on July 22, 2024 1

from osfclient.

theoutlander avatar theoutlander commented on July 22, 2024 1

@nkmeyers I fixed this issue by running:

pip install pyopenssl

On OSX, the issue is related to python using the system OpenSSL which happens to be an outdated version.

Several people have faced this issue and there are a few things to try as listed on psf/requests#3006. In most cases, the above should solve the issue.

Here is another thread related to a similar issue: psf/requests#3391.

from osfclient.

ctb avatar ctb commented on July 22, 2024 1

Ran into this again, pip install pyopenssl fixed it!

from osfclient.

ctb avatar ctb commented on July 22, 2024

from osfclient.

nkmeyers avatar nkmeyers commented on July 22, 2024

duh, I think I remember this old frustrater now, I'll piddle around w upgrading ssl but that's going to be an awkward fix to bake in to the osf-cli requirements for end-users so we may want another way around it? and in meantime I'll try it from a different terminal too.

from osfclient.

ctb avatar ctb commented on July 22, 2024

from osfclient.

nkmeyers avatar nkmeyers commented on July 22, 2024

okay I'm still on 2.7.13, I'll give that a go first! thx!

from osfclient.

benlindsay avatar benlindsay commented on July 22, 2024

I'm on python 3.6 now, and I got a similar error as above. Here's what I saw while recursively uploading a directory:

Traceback (most recent call last):
  File "/home/lindsb/usr/miniconda/lib/python3.6/site-packages/requests/packages/urlli
b3/contrib/pyopenssl.py", line 438, in wrap_socket
    cnx.do_handshake()
  File "/home/lindsb/usr/miniconda/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1
638, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/home/lindsb/usr/miniconda/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1
371, in _raise_ssl_error
    raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')

During handling of the above exception, another exception occurred:

And a few more similar errors showed up "during handling of the above exception". The error message didn't say what file it had an issue with, so I don't know how far the upload got before failing...

from osfclient.

betatim avatar betatim commented on July 22, 2024

Also a Mac @benlindsay? Could you post the version of your OS. On my 10.11.16 (El capitan) it seems to work, at least I can't reproduce this. Another thing I can think of is: did you install openssl via brew?

from osfclient.

betatim avatar betatim commented on July 22, 2024

A few results from googling:

They point to the TLS handshake not working. Either because the server is doing weird things or a proxy :-/

from osfclient.

benlindsay avatar benlindsay commented on July 22, 2024

I'm on a campus research cluster with a lot of out-of-date software where I don't have root access. The result of uname -a is Linux rrlogin.internal 2.6.18-416.el5 #1 SMP Fri Oct 28 08:39:39 CDT 2016 x86_64 x86_64 x86_64 GNU/Linux and the result of lsb_release -a is

LSB Version:       :core-3.1-amd64:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-noarch
Distributor ID:	   ScientificSL
Description:	   Scientific Linux SL release 5.5 (Boron)
Release:           5.5
Codename:	   Boron

from osfclient.

betatim avatar betatim commented on July 22, 2024

Let's collect a bit more data till we can figure out what the pattern is. If we figure out how to solve this -> solve it. Otherwise probably a good idea to catch this exception and print a useful message (once we know what that message should be)

from osfclient.

betatim avatar betatim commented on July 22, 2024

I have openssl 1.0.2l on my mac, who can offer an earlier one that works?

Proposed error message: "Please update your version of openssl to at least version X"

from osfclient.

benlindsay avatar benlindsay commented on July 22, 2024

I also have openssl 1.0.21 on my linux machine, so I don't think it's simply an openssl version issue. I'd guess that it has something to do with other old software that I don't have downloaded via Anaconda. My python modules are up-to-date.

from osfclient.

saurabhpilot avatar saurabhpilot commented on July 22, 2024

Not able to resolve with above solutions

r = requests.post(url=url,headers=headers,data=json.dumps(Data),verify=False)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/requests/api.py", line 112, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='172.16.76.172', port=443): Max retries exceeded with url: /tssm/onboard-tenant (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),))

from osfclient.

heiniovason avatar heiniovason commented on July 22, 2024

As @theoutlander and @ctb 'pip install pyopenssl' did the trick for me as well.

I had to make 30.000 requests asap., but I couldn't avoid being cut for by or the other SSL- or other connection error exception. If I was lucky the app ran 5 min without throwing an exception, and being cut off.
If I did added a sleep(0.5) before each request I was almost sure of not being cut off from this specific web service. Also added retry logic if I got an exception and with overhead jazz code to get things working reliably which I would rather not spend time doing.

After installing pyopenssl I've been starring like a happy child at console outputs :)

Environment is Python 3.5.2, and I'm using the requests library.

from osfclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.