| Reference | Downloads | Github

Cannot sync to Pavlovia

URL of the experiment:

Description of the problem:
I have a project that was working fine on Pavlovia (link above), but when I closed PsychoPy (builder), and then reopened it, and then tried to sync a project it said I needed to recreate a project. This then was working fine for a while, but now when I try to resync or create a new project on pavlovia it gets stuck on synchornising, and I get the following error in my python console:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\”, line 2471, in onPavloviaSync
retVal = pavlovia_ui.syncProject(parent=self, project=self.project)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\”, line 488, in syncProject
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\”, line 96, in showCommitDialog
changeDict, changeList = project.getChanges()
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\”, line 915, in getChanges
raise ValueError(“Found an unexpected change_type ‘{}’ in gitpython Diff”.format(this.change_type))
ValueError: Found an unexpected change_type ‘U’ in gitpython Diff

When I try to close psychopy and reopen it, or try creating a new project, I still get this same error. Everything runs fine from Psychopy on my computer, and no errors are generated when exporting the html file. Any help is much appreciated, as I am very much stuck at the moment.

If I try to sync from PsychoPy to the existing study above (Using the find existing study button) I get a different error:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\”, line 364, in onSyncButton
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\”, line 651, in sync
status = self.pull(infoStream=infoStream)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\”, line 694, in pull
raise e
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\”, line 685, in pull
info = self.repo.git.pull(self.remoteWithToken, ‘master’)
File “C:\Program Files\PsychoPy3\lib\site-packages\git\”, line 548, in
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File “C:\Program Files\PsychoPy3\lib\site-packages\git\”, line 1014, in _call_process
return self.execute(call, **exec_kwargs)
File “C:\Program Files\PsychoPy3\lib\site-packages\git\”, line 825, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd(‘C:\Program Files\PsychoPy3\MinGit\cmd\git.exe’) failed due to: exit code(128)
cmdline: C:\Program Files\PsychoPy3\MinGit\cmd\git.exe pull master
stderr: 'error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use ‘git add/rm ’
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.’

The error in my first post is in trying to create the new project, this error is for trying to sync with the existing project.

@Bobby_Thomas, looks like you have a Git merge conflict. This appears when you change the same lines of code locally (from PsychoPy) and remotely (from Pavlovia). At this point, your easiest solution is clear your local repository (deleting .git folder), delete your remote repo (so long as you are not data collecting) and start again: Here are explicit steps:

Edit: To avoid merge conflicts, you should only amend code on using PsychoPy, rather than making changes through Pavlovia.

1 Like

Thanks that solved it, I’m now dealing with my code components not working with the newest update of PsychoPy, but that is for a separate post

Deleting everything and starting anew may not always be necessary when this happens.

I have edited the PsychoPy code in psychopy/projects/ as follows:

>diff -c
***     2020-03-28 02:29:48.000000000 -0400
--- 2020-06-07 15:02:10.162859784 -0400
*** 911,916 ****
--- 911,918 ----
                  changeDict['renamed'].append((this.rename_from, this.rename_to))
              elif this.change_type == 'M':
+             elif this.change_type in ['U','T']:
+                 raise ValueError("Change type '{}' not supported (file: {}) in gitpython Diff".format(this.change_type, this.b_path))
                  raise ValueError("Found an unexpected change_type '{}' in gitpython Diff".format(this.change_type))
          changeList = []

Basically, it adds the filename to the error message, so instead of:
ValueError: Found an unexpected change_type 'U' in gitpython Diff
you get:
Change type 'U' not supported (file: filename.ext) in gitpython Diff
I find this extra information helpful, as often it is only necessary to delete and resync this one file, rather than the whole project.

Not sure if this is something the developers want to add to PsychoPy, but anyone who wants to give it a try can add the 2 lines of code to the same file, restart PsychoPy, and try the sync again to get a more informative error message.

1 Like