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

[Bug]: SSL error when logging in to pavlovia from PsychoPy #5981

Open
1302557841 opened this issue Oct 31, 2023 · 2 comments
Open

[Bug]: SSL error when logging in to pavlovia from PsychoPy #5981

1302557841 opened this issue Oct 31, 2023 · 2 comments
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Comments

@1302557841
Copy link

PsychoPy Version

2023.2.3

What OS are your PsychoPy running on?

Windows 10

Bug Description

An error occurred while logging in
Traceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\connection.py", line 364, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\connection.py", line 501, in connect_tls_proxy
socket = ssl_wrap_socket(
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\util\ssl
.py", line 453, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\util\ssl
.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Program Files\PsychoPy\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Program Files\PsychoPy\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Program Files\PsychoPy\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Program Files\PsychoPy\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='gitlab.pavlovia.org', port=443): Max retries exceeded with url: /api/v4/user (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui_base.py", line 128, in checkForLoginURL
pavlovia.login(self.tokenInfo['token'])
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 110, in login
currentSession.setToken(token)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 399, in setToken
self.startSession(token)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 425, in startSession
self.gitlab.auth()
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py", line 257, in auth
self.user = self._objects.CurrentUserManager(self).get()
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\exceptions.py", line 304, in wrapped_f
return f(*args, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\mixins.py", line 146, in get
server_data = self.gitlab.http_get(self.path, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py", line 662, in http_get
result = self.http_request(
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py", line 594, in http_request
result = self.session.send(prepped, timeout=timeout, **settings)
File "C:\Program Files\PsychoPy\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='gitlab.pavlovia.org', port=443): Max retries exceeded with url: /api/v4/user (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)')))

Expected Behaviour

An error occurred while logging in

Steps to Reproduce

  1. logging
    2.success
    3.An error occurred while logging in
    ...

Additional context

No response

@1302557841 1302557841 added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Oct 31, 2023
@peircej
Copy link
Member

peircej commented Feb 14, 2024

We've seen this from a small minority of users, usually at US government institutions or similar. Is that the case for you too? We are actively exploring solutions by using different methods to connect with pavlovia, but I'm not sure what those solutions will be yet

@peircej peircej changed the title [Bug]: An error occurred while logging in [Bug]: SSL error when logging in to pavlovia from PsychoPy Feb 14, 2024
@peircej
Copy link
Member

peircej commented Feb 19, 2024

OK, we've tracked down 2 issues:

  1. some users need to adapt the certificates file that comes with Python to include their own institutional web certificate
  2. some users need to use a web proxy

At the moment (1) requires a change to the cacert.pem file that is packaged with PsychoPy (or with Python certifi if you use your own installation). That obviously needs doing each time you install PsychoPy and needs admin privs to change, so we'll work on adding something to the PsychoPy preferences so that it can be done just once per user and not requiring admin rights

For (2) the psychopy preference setting already exists (to add your institution proxy server address, in the Connections tab) but we hadn't previously been using that in the connection to gitlab and that is now resolved to be released in the 2024.1.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.
Projects
None yet
Development

No branches or pull requests

2 participants