# PsychoPy unhandled internal error - invalid\_grant

**URL:** <https://discourse.psychopy.org/t/psychopy-unhandled-internal-error-invalid-grant/47877>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [September 11, 2026, 3:50pm UTC](https://discourse.psychopy.org/t/psychopy-unhandled-internal-error-invalid-grant/47877 "2026-09-11T15:50:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amccarter](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@amccarter](https://discourse.psychopy.org/u/amccarter)\
**Post date:** [September 11, 2026, 3:50pm UTC](https://discourse.psychopy.org/t/psychopy-unhandled-internal-error-invalid-grant/47877/1 "2026-09-11T15:50:30Z")

</div>

**OS** : Win11  
**PsychoPy version** : 2026.2.3  
**Standard Standalone Installation?** y  
**URL of experiment:** [Pavlovia](https://pavlovia.org/amccarter/E2D1)  
**Do you want it to also run locally?** no  
**What are you trying to achieve?:** sync project with Pavlovia

**What did you try to make it work?:** It had been working fine. I have successfully synced this project several times. This time, I got an invalid\_grant internal error. In some googling, it seemed like an SSH key would help. I went through the process of making one of those and added it to my Pavlovia gitlab. I closed PsychoPy and re-opened, but the issue is continuing. I tried to log into Pavlovia in PsychoPy, but the same error shows up for that. I saw someone suggest trying it from a hotspot instead of through the university wifi. The same error message appears when I try connected via hotspot.

**Link to the most relevant existing thread you have found:** [Cannot log in to Pavlovia from PsychoPy](https://discourse.psychopy.org/t/cannot-log-in-to-pavlovia-from-psychopy/46749)

**What specifically went wrong when you tried that?:**  
Traceback (most recent call last):  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\_app\builder\builder.py”, line 1654, in onPavloviaSync  
self.fileExport(htmlPath=htmlPath)  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\_app\builder\builder.py”, line 942, in fileExport  
self.app.showCoder(fileList=[exportPath])  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\_app\_psychopyApp.py”, line 871, in showCoder  
self.coder.fileOpen(filename=file)  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\_app\coder\coder.py”, line 2373, in fileOpen  
self.setCurrentDoc(filename)  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\_app\coder\coder.py”, line 2347, in setCurrentDoc  
self.project = pavlovia.getProject(self.currentDoc.filename)  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1593, in getProject  
session = getCurrentSession()  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1707, in getCurrentSession  
\_existingSession.doRefreshToken()  
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 526, in doRefreshToken  
raise gitlab.GitlabAuthenticationError(  
gitlab.exceptions.GitlabAuthenticationError: invalid\_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

---

<div class="post-metadata">

**Author:** ![amccarter](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@amccarter](https://discourse.psychopy.org/u/amccarter)\
**Post date:** [September 11, 2026, 4:59pm UTC](https://discourse.psychopy.org/t/psychopy-unhandled-internal-error-invalid-grant/47877/2 "2026-09-11T16:59:02Z")

</div>

I was able to solve this. I went into AppData/Roaming/PsychoPy3 on my computer and deleted the pavlovia folder. I was then able to re-log in to Pavlovia in PsychoPy and successfully sync.
