Problems with Pavlovia synchronization

For syncing to Pavlovia I would try syncing a very simple experiment to test, just in case yours in failing due to JS errors or too many resources.

Hi @wakecarter, So removed the var components, then I tried to resynch. Nothing worked so in the end I deleted the project from Pavlovia, also everything created including the hidden git folder as suggested in another thread, after repeated failures, to connect to hte actual and not a deleted project). I logged in created a project, then tried to Synch. nothing happened. Tried the Synch icon, then this is what I received:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\menu.py”, line 116, in onSync
syncProject(parent=self.parent, project=self.parent.project)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 854, in syncProject
project.sync()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 916, in sync
self.firstPush(infoStream=infoStream)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1155, in firstPush
info = self.commit(
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 1321, in commit
info = self.repo.git.commit(‘-m’, message)
File “C:\Program Files\PsychoPy\lib\site-packages\git\cmd.py”, line 986, in
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\git\cmd.py”, line 1599, in _call_process
return self.execute(call, **exec_kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\git\cmd.py”, line 1389, in execute
raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd(‘C:\Program Files\PsychoPy\MinGit\cmd\git.exe’) failed due to: exit code(1)
cmdline: C:\Program Files\PsychoPy\MinGit\cmd\git.exe commit -m Push initial project files
stdout: ‘On branch master
nothing to commit, working tree clean’

The Pavlovia folder is now empty. Previously at least it had a code and all the resources. Now, not even that. I am confused. where and how shall I do the synch to work? shall I first create the js file (sometimes it seems to be automatically created when synch-ing sometimes not). When I try to synch the created js file again I get the variable components message. I seriously don’t understand what is happening and why.

Have you tried syncing a very simple experiment to test, just in case yours in failing due to too many resources.

Hi @wakecarter, After I while, suddenly it worked and I could start to pilot the script (locally). The type was finally not Unknown, changed versions could be synchronized I got to the practice part of my exp when piloting. Then I could not deal with the project for about one day, and today, nothing works. I was desperate, after a few hours and deleted the project, tried to create a new one and synchronization again does not work at all. There are no hidden git folders, the naming is correct. Since it worked at some point (I don’t know why), it is not the amount of resouces either (but anyways, I need all and the whole experiment as it is, so there is absolutely no point in trying out sth “simple”). Maybe I did sth slightly differently when creating the project, synch-ing etc. Honestly it was like midnight, and I don’t remember. I log in Pavlovia while in PsychoPy builder. I create a project with New. I try to Synch under the Pavlovia Synch tab. I see that the project is created and then…it remains empty. I try to resynch setting the project on Pavlovia to Piloting, no effect. I don’t understand what I am doing wrong. Also, when I pilot I get this error message, despite the csv-s are in the appropriate folder: * when importing condition: lists/relevantA_blockfile_B1_FD2.csv

  • when getting the value of resource: lists/relevantA_blockfile_B1_FD2.csv
  • lists/relevantA_blockfile_B1_FD2.csv is not available for use (yet), its current status is: "REGISTERED. Friday night this problem was resolved by moving the files in the list folder. They are there, I checked. (Of course, online there is nothing, so I guess that is the reason.)

If your files are in Gitlab then this tip should help.

However, for some reason this was failing for me today, so please post here if you have code in Gitlab which isn’t showing up when running in an incognito tab.

Hi @wakecarter. so finally I was able to do the synchronization, again, and started to pilot locally in my browser, again, synching the file after the changes successfully. Then, I had to add a new resource (1 small file) and the synchronization is suddently not working. Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1617, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 907, in fileExport
self.app.showCoder(fileList=[exportPath])
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app_psychopyApp.py”, line 838, 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 1513, in getProject
if requestVal[‘experiment’] is None:
KeyError: ‘experiment’
when trying to pilot the script online, I see this weird black thing covering the screen (below. Plus there is also a reference error, but it is likely that because of the failed synchronization.

OK. It works again, after logging out and then logging in again to Pavlovia. I give up understanding what makes synch fail from time to time. I guess, tomorrow when I try it again, it will not work (again). The screen still looks like that though, no idea why.

Are you using a button with a border?

For synchronization, the best option is to upgrade to 2025.2.4

Hi @wakecarter, Yes. The border was the issue. For the synch-ing: Thanks. Unfortunately, it turned out that the amount of resources is just too much. Even files that are defined in the initialization (before exp) routine are not (down)loaded. After restarting the piloting multiple times, finally everything loads, piloting can be started but this is just not okay this way. The exact condition files (containing the trial stim information), the stim order, audio order etc. differ per participant, so I don’t know what to do. Also, even if they load, there is a weird audio reference error (due to which I cannot even strat the practice). Originally I used wav files, extensions were in the csv. Then I cahnged it to mp3 (also readded the audios in the Exp settings resources tab), I deleted the extension from csv. and it still says that it cannot find xx.wav (the audio the first pract trial uses). The synching is okay, changes are there online. I am puzzled.

Hello @danna

I can understand why you are puzzled. One thing to understand is that if your PsychoPy does not compile properly to PsychoJS, nothing can be synced. My workflow is as follows: First, I try to get everything running locally as a PsychoPy experiment. Then, I test the experiment locally in a browser as a PsychoJS experiment. Finally, I sync everything to Pavlovia.

Something it is nothing more than an extra space in the reference in the condition file that prevents PsychoJS from finding the file.

I usally download the stimulus files at a later moment in the experiment. The Before Experiment tabist used to do “Things that need to be done just once, like importing a supporting module, which do not need the experiment window to exist yet.”

How many files would you like to upload? Bear in mind that your participants will need to download these files again.

You can start the synchronisation process via the command line. Go to the folder where your experiment is stored, open a terminal window, and enter the following commands:

git add .
git commit -m "Your Description goes here"
git push

Best wishes Jens

Hi, Thank you for the response, but I think you misunderstood what I wrote (maybe I wasn’t celar enough). 1. The py script runs and I test the js locally in the browser not on Pavlovia. 2. The audio problem exists even if all the resources are loaded. There is no such thing as xx.wav file in the csv (or the folders or the exp tab resources or online) anymore. 3. In the begin exp tab, I only define certain conditions files which tell which csv files I should load (that define the trial stimuli). And I eve have problems with those when I first try. After multiple round, not (as I wrote earlier). I have 215 audio files (very small, 2.5 sec long ones), 500+ small png files, and currrently sth like 60 csv files (I will actually need more- this is because I need a special pseudorandomization that cannot be solved in na yother way). I will try the synchronization the way you suggested. Thank you for the suggestion.

Hello @danna

before you wrote

So, where do you set up your condition file?

I misread xx.wav as an example for wav-files not being found.

You can search your experiment code (Crtl+F) for xx.wav and check where PsychoPy looks for this file.

I do not understand these sentences.

I can only reiterate wakecarter’s suggestion to try something smaller and simpler to pinpoint your problem. You could also upload your PsychoPy file here so that someone can take a look. You might want to consider granting access to your repository, but I’m uncertain if that would be beneficial, as it’s not complete.

Best wishes Jens

Dear Jens, I nthe end, it turned out that the script (kinda) runs on Pavlovia - resources are complied -, just not locally (after synching happens, which now seems to work). I have other issues (how images are displayed) but I will start a new thread with it. Thank you all the help.