Unable to sync experiment to pavlovia

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2022.2.3
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?:
Hi to all of you,
I am currently creating an experiment using the builder. I am continuously adding features and then uploading to pavlovia. However, when I shutdown my computer and start it again, e.g. on the next day, and try to sync new changes I get the following error message:

Traceback (most recent call last):
  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 112, in get
    server_data = self.gitlab.http_get(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 628, in http_request
    raise gitlab.exceptions.GitlabHttpError(
gitlab.exceptions.GitlabHttpError: 404: 404 Project Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 663, in project
    self._project = self.session.gitlab.projects.get(self.id)
  File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\v4\objects\projects.py", line 782, in get
    return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
  File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\exceptions.py", line 306, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 404: 404 Project Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py", line 1374, in onPavloviaSync
    pavlovia_ui.syncProject(parent=self, file=self.filename, project=self.project)
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\project.py", line 743, in syncProject
    if not project.localRoot or not Path(project.localRoot).is_dir():
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 746, in localRoot
    if self.project.path_with_namespace in knownProjects:
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 666, in project
    raise KeyError(f"Could not find GitLab project with id {self.id}.")
KeyError: 'Could not find GitLab project with id 248308.'

What did you try to make it work?:
The first time this error occurred I just deleted the project on pavlovia + the local .git folder, created a new project, synced again and everything worked. Since the development history isn’t so important at the moment, I don’t mind repeating this process. However, I don’t think that is how it’s supposed to work.
I also found another quite similar post in this forum. However, the only advice in that post was the same what I’ve already done.

Any help is very appreciated
Chris

OS (e.g. Win10): MacOS 12.6.1
PsychoPy version (e.g. 1.84.x): 2022.2.4
Standard Standalone? (y/n): Y

I want to boost this topic because I’m having the same problem. Up until just a couple of minutes ago I was syncing to Pavlovia just fine, but then received the same type of “404 Project Not Found”/“Could not find GitLab project with id XXXXXX” error:

Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/gitlab/exceptions.py", line 304, in wrapped_f
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/gitlab/mixins.py", line 112, in get
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/gitlab/client.py", line 662, in http_get
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/gitlab/client.py", line 628, in http_request
gitlab.exceptions.GitlabHttpError: 404: 404 Project Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/projects/pavlovia.py", line 663, in project
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/gitlab/v4/objects/projects.py", line 782, in get
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/gitlab/exceptions.py", line 306, in wrapped_f
gitlab.exceptions.GitlabGetError: 404: 404 Project Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py", line 3945, in onPavloviaProject
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/pavlovia_ui/project.py", line 680, in __init__
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/pavlovia_ui/project.py", line 395, in __init__
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/projects/pavlovia.py", line 632, in refresh
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/projects/pavlovia.py", line 666, in project
KeyError: 'Could not find GitLab project with id 218374.'

I added a form to the end of the experiment, and that was when I got this error. Before I added the form, I wasn’t getting this error and syncing with Pavlovia totally fine. The current GitLab project ID for this project is actually 262354, so I’m also wondering if there’s something going on under the hood that’s making it try to sync with project 218374 instead.

Like the above poster, I also previously deleted and made a new project to make this one work, but haven’t shut down my computer in the meantime (just quit and restarted PsychoPy). I haven’t tried that again, because I had originally done it because it was syncing with the project that I had associated with a previous psyexp file (the base experiment was very similar, and I didn’t want to rebuild the whole thing from scratch!). I also had to associate a new local folder with it.

I’d love to know what’s going on, because I also don’t think it’s supposed to be doing this.

Hi Everyone,

Sorry that you are having this problem! I’ll check with the dev team as it seems to be a pressure point - we’ll look into a solution. (Sorry I don’t have something immediate to suggest now other than a) checking that you are signed into pavlovia on psychopy from the correct account b) checking to use the most recent psychopy release c) (as a last solution) deleting the hidden .git file and creating a new project!)

Becca

1 Like

Hi Becca, don’t know if others are having this problem yet, but now after a long sync time I’m getting a 403 Forbidden error on the browser page that pops up and should be loading the experiment. I get a blank page when I try to pilot from within Pavlovia. Any ideas?

edit: from another post, it looks like the 403 Forbidden error comes up when an index.html file isn’t generated; now the index.html file is being generated, but in a folder that’s also labeled index.html (and contains the .js files as well). The blank page is still happening, and, most recently, I’m back to getting the 404 Project Does Not Exist error with a number mismatch between the project that the traceback is referring to and the project that exists on Pavlovia.

Hi There,

I think this is something different (so maybe a diff thread for this) but this usually happens when for some reason psychopy has not compiled your javascript file (so there is nothing in browser to run) please can you try clicking the :compile_js: button in your psychopy experiment, sync to pavlovia and then try again?

Becca

We’ve identified one of the bigger bugs causing these sorts of errors so will soon be bringing out a bug fix release which should allow you to sync as normal!

In the meantime, one thing which might help is if you go to your user folder and delete the file projects.json in the pavlovia folder. The location of your user folder is different on different operating systems, but an easy way to get there is to go Themes → Open Themes Folder and then go up one folder, as the themes folder is inside your user folder. Once the projects.json file is deleted, so too will be the reference to your old study ID and so PsychoPy should then be able to pick up the new ID from the local git folder.

Hi, just wanted to add to this thread because I have the same issue.

raise KeyError(f"Could not find GitLab project with id {self.id}.")

KeyError: ‘Could not find GitLab project with id 263358.’

I’ve tried to basically make a new project, but even that didn’t work:

  • Deleting the .git folder and .gitignore
  • Changing the name of the experiment in both settings & the file
  • Using a new root folder (presumably the folder where the .psyexp file is)
  • Making sure I have the newest version installed

Does anyone have any more ideas, please?

Full message:
Traceback (most recent call last):
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 112, in get
server_data = self.gitlab.http_get(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 628, in http_request
raise gitlab.exceptions.GitlabHttpError(
gitlab.exceptions.GitlabHttpError: 404: 404 Project Not Found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 663, in project
self._project = self.session.gitlab.projects.get(self.id)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\v4\objects\projects.py”, line 782, in get
return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\exceptions.py”, line 306, in wrapped_f
raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 404: 404 Project Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1374, in onPavloviaSync
pavlovia_ui.syncProject(parent=self, file=self.filename, project=self.project)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 743, in syncProject
if not project.localRoot or not Path(project.localRoot).is_dir():
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 746, in localRoot
if self.project.path_with_namespace in knownProjects:
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 666, in project
raise KeyError(f"Could not find GitLab project with id {self.id}.")
KeyError: ‘Could not find GitLab project with id 263358.’

Update - I solved the issue, the key was to delete index.html