Problems when trying to sync projects after update

Hi,

I have just updated my PsychoPy Version to 2022.1.2.
When I am trying to sync a new project I am getting this error:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1377, 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 741, in syncProject
functions.showCommitDialog(parent, project, initMsg="", infoStream=dlg.status)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\functions.py”, line 94, in showCommitDialog
changeDict, changeList = project.getChanges()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1017, in getChanges
changeDict[‘untracked’] = self.repo.untracked_files
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 861, in repo
raise AttributeError(“The requested local path for project\n\t{}\n”
AttributeError: The requested local path for project
‘C:\Users\pfrick\Work Folders\Documents\Projekt Validierung und Reaktivierung\Studie C2’
sits inside another folder, which git will not permit. You might like to set the project local folder to be
‘C:\Users\pfrick\Work Folders\Documents’

This folder structure always worked with the old version (2021.1.4). Are subfolders no longer possible?

Also, when I try to open a project created with the old version, 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\app\builder\builder.py”, line 735, in fileOpen
self.project = pavlovia.getProject(filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1253, in getProject
project = session.gitlab.projects.get(name)
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

Can anyone help? Thanks in advance!

Hello,

is the project you are trying to sync nested in another git-folder. That is not allowed.

Best wishes Jens

Yes, it isn’t so much that it’s inside another folder as it’s inside the root folder of another project.

1 Like

Thanks to both of you for the quick reply.

I checked to see if there was another project in the folder and there was indeed one (was directly in the folder “Projekt Validierung und Reaktivierung”. I deleted it (also on pavlovia) but it still doesn’t work.

My folder structure right now looks like this:
C:\Users\pfrick\Work Folders\Documents\Projekt Validierung und Reaktivierung\Studie A1 → Project is there.

C:\User\pfrick\Work Folders\Documents\Projekt Validierung und Reaktivierung\Studie A2 → second project is there.

The strange thing is: A1 works, A2 gives the above error.

Is there anything else I can do?

Just deleting the folder won’t unlink it from the online project - PsychoPy still has an internal reference saying that X project is linked to Y folder even if the folder is not there. What you need to do is move the project to a different folder, then open it and in the Project Info :pavlovia_info: view change it’s “Local Root”.

Thank you very much for this information!

I tried it - but when I click on project info I get the same error:

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\app\pavlovia_ui\toolbar.py”, line 86, in onPavloviaProject
if self.frame.project is not None:
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1458, in project
return pavlovia.getProject(self.filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1253, in getProject
project = session.gitlab.projects.get(name)
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

Hi everyone,
I have one more question concerning this:
Since I could not make it work, I uninstalled PsychoPy 2022.1.2 and reinstalled my old version (2021.1.4).
Now, everything (including synchronization) works again. (I have not changed the folder structure).
Is there anything else I can try to make PsychoPy 2022 work? I tried several different locations for saving the project – none of it worked with PsychoPy 2022

Again, many thanks in advance!

Is the project one you made yourself or one you’ve been added to as an editor? And is the project private? The way the interface works is by sending requests to an “API”, essentially saying “I am [username], I can prove it using this authentication key, please show me this project”, which returns the project details. The big change we made in 2022.1 was switching from GitLab’s API to our own Pavlovia one, so it may be that it doesn’t accept your authentication key as sufficient to give you the project details for some reason (my first guess would be that it doesn’t recognise you as an editor as you’re not the author)

Hi all,

actually, I have the same problem that I cannot sync a task with Pavlovia. I already figured out that I had another (test-) task in the same folder so I deleted this and also moved the right one to a different location. However, also with the tip to check the root folder, the problem remains. It is a project I just made myself. I synced an earlier version though, to see how it works and then is also had no host server and would not let me pilot or run it. As the task was not finished, I did not get into this and just deleted it on Pavlovia to figure this out when I have the task ready for usage.

I came across another post that said that hidden objects might be a problem, but when I made hidden files or folder visible via Windows settings, nothing appears.

Maybe, we have this problem due to totally different reasons, but I still wanted to share it.

My error message when I click sync:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 289, in writeScript
self_copy.flow.writeLoopHandlerJS(script, modular)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 345, in writeLoopHandlerJS
entry.writeMainCodeJS(script, modular) # will either be function trialsBegin() or trialsEnd()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\loops.py”, line 662, in writeMainCodeJS
self.loop.writeLoopStartCodeJS(buff, modular)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\loops.py”, line 231, in writeLoopStartCodeJS
seed=seed))
TypeError: str returned non-string (type NoneType)

I’m having a similar problem too. I have the newest version of PsychoPy.

Thanks again for your reply!
The projects are all my own.
However - I uninstalled everything and installed the new version again. Now everything is working- I do not know what the problem was, but the good thing is that it is working now…

Has there been a fix to this other than uninstall/reinstall?

There will be soon! We’ve finally tracked down what’s going on with this - it’s an authentication bug within the app, which there is now a fix in for, so it will be in the next release.