Error when I click the log in to Pavlovia button

This is my first time using PsychoPy. I have just created a Pavlovia account, and there is an unhandled internal error when I click the button “log in to Pavlovia”. A window popped up with the following details. I am using the v2022.1.2 version. Could anyone help? Thanks!

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 109, in login
if currentSession.user is not None:
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 415, in user
self._user = User(self.gitlab.user.username)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 152, in init
self.id = int(self.info[‘gitlabId’])
KeyError: ‘gitlabId’

Hi, have you tried closing the application and relogged in?

Yes, I tried… and the error still remains… :frowning: I used two computers to try, and the results were the same.

This is a tricky one to track down as I can’t replicate the error; what the error essentially means is that, when PsychoPy looks up your username on Pavlovia, the value it gets back doesn’t include a GitLab ID, which it needs to log you in.

This won’t fix the problem, but if you open the file C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py in Coder and scroll to line 152, just above you could add this:

            assert 'gitlabId' in self.info, (
                f"Could not retrieve user info, server returned:\n"
                f"{self.info}"
            )

Which will give a more informative error message telling you what actually was received from the server.