Updates were rejected because the remote contains work that you do

Hi,
I am new to git but used Psychopy for a while, and excited about the online function. Thanks for developing it!
I have a old version experiment that already uploaded to the pavlovia, yesterday I copied that old version experiment file to another laptop mac with only Psychopy1.9 in it (because my mac still can’t install Psychopy3 properly…) and developed a new experiment (offline) based on that old experiment file. Today I want to upload this new experiment as a new project to pavlovia, but the problem happened. I copied code at below.

Basically, I opened that new experiment file with Psychopy3 and login Pavlovia in the Psychopy3 and then hit the new button that the small earth with refresh marker. problem comes…
It seems this new experiment conflicted with the old experiment/project already on my pavlovia account.
What should I do, I spend half day searching for the answer but failed… btw, I don’t really know how to play git…

Chengyang

Pushing files to PavloviaTraceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 455, in syncProject
project.firstPush()
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py”, line 758, in firstPush
self.repo.git.push(’-u’, ‘origin’, ‘master’)
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\git\cmd.py”, line 548, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\git\cmd.py”, line 1014, in _call_process
return self.execute(call, **exec_kwargs)
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\git\cmd.py”, line 825, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd(‘git’) failed due to: exit code(1)
cmdline: git push -u origin master
stderr: ‘To https://gitlab.pavlovia.org/chengyang/cfmt_chinese_version.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘https://gitlab.pavlovia.org/chengyang/cfmt_chinese_version.git
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.’

1 Like

Hey,

I haven’t been able to upload a single experiment yet.
I’ve got absolutely the same errors, although using a single laptop.
If i try to run the experiment online, the OK button is disabled.
Has anyone found a solution yet?

When I try to pull (through Sync) the experiment from pavlovia - that is after an unsuccessful run of the experiment Online because of disabled OK button - I get the following error.

Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy3_\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 364, in onSyncButton
self.project.sync(syncPanel=syncPanel, progressHandler=progHandler)
File “C:\Program Files (x86)\PsychoPy3_\lib\site-packages\psychopy\projects\pavlovia.py”, line 607, in sync
status = self.pull(syncPanel=syncPanel, progressHandler=progressHandler)
File “C:\Program Files (x86)\PsychoPy3_\lib\site-packages\psychopy\projects\pavlovia.py”, line 651, in pull
raise e
File “C:\Program Files (x86)\PsychoPy3_\lib\site-packages\psychopy\projects\pavlovia.py”, line 642, in pull
info = self.repo.git.pull() # progress=progressHandler
File “C:\Program Files (x86)\PsychoPy3_\lib\site-packages\git\cmd.py”, line 548, in
return lambda *args, **kwargs: self.call_process(name, *args, **kwargs)
File "C:\Program Files (x86)\PsychoPy3
\lib\site-packages\git\cmd.py", line 1014, in call_process
return self.execute(call, **exec_kwargs)
File "C:\Program Files (x86)\PsychoPy3
\lib\site-packages\git\cmd.py", line 825, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd(‘git’) failed due to: exit code(1)
cmdline: git pull
stdout: ‘Updating 089f0d7…cf8baba’
stderr: ‘From https://gitlab.pavlovia.org/yolinap/test3
089f0d7…cf8baba master -> origin/master
error: unable to create file data/test3_PARTICIPANT_001_2018-09-28_10:15:11.234.csv: Invalid argument’

Thank you for all your efforts for making open science, it is greatly appreciated!

I haven’t used Pavlovia, but my answer is based your git error message. I think the error message "updates were rejected because the remote contains work that you do not have locally" you get is because something has changed in the original file after you modified the project locally in your computer. So you would need to sync your local to match that in the original file.

Try:
git pull --rebase origin master

Then try pushing it again with git push origin master

Hope it works :slight_smile:

Thank you for the response!
I tried doing what you’ve suggested. It seemed that everything is okay after the pull and push (i got the ''Everything is updated" message).
Unfortunately, when I tried to run the experiment the OK button was still disabled and the same errors appeared…
Any other suggestions?

hi,
Thanks for your suggestion. I don’t have git knowledge. Can I ask some basic thing, plz? so I opened git bash and what should I do? I assume I shall change the work directory to the right fold?
But anyway, I directly put ‘git pull --rebase origin master’, it comes with ‘git@gitlab.pavlovia.org’s password’. then I entered my password of my pavlovia account, it’s incorrect (show ‘permission denied, please try again’), so I assume it’s the password of the whole pavlovia in git? that impossible to have.

plz, tell me what shall I do.
Thanks in advance!

I found the answer… just ignore my last stupid question. I find I can right-click within the target folder and there is ‘git bash here’… and I typed git push origin master, and it works! Thank you so much! it kills me serval day, but finally, I survived…

It is great that it worked with you :slight_smile:

But that makes me wonder even more why it does not work with me. I am doing the git pull and push to the point “Everything up-to-date”. Than I hit the Online run at PsychoPy, the red html warning pops up, I click Ok, and everything syncs again. After that the browser opens for entering participant’s number and session but the OK button there just stays disabled…

Yolina,
PsychoPy3 3.0.0b9, Windows

hi,
I find a even simpler way to solve this problem…
On the builder view, go to find ‘search pavlovia’ on the tool bar (the little earth with magnifying glass). Then tick My groups above the search bar and then find your current project (Name), then Browse… set the local root to your project folder on your computer then press Sync… (I think this is the same function as you type ‘git pull’ in the git cmd). After that, you can now go out to sync… your work without problem.
Hopeful it works for someone have same problem as I was.

Chengyang

Gitlab won’t let you push new files to your repository if there are files in there that haven’t been pulled to your local repository yet. At the moment, the csv output files are invalid because they contain a colon. So, if you want to push anything to gitlab, you will have to remove the csv files first. Once you do this, you will be able to sync.

I was having the same problem:

Now, I understand what was happening.

1 Like