JS file has been modified outside of PsychoPy

Description of the problem:

After upgrading to the latest version (2021.1.2), we have been trying to create a new experiment. The first sync of the project usually goes well, but then if we make further changes and try to sync, we get a popup saying that the js file has been modified externally since the last sync (we haven’t touched it…). It asks us if we want to incorporate the changes, ignore, or cancel. We’ve tried both and can’t tell what difference it makes.

In addition, if we close the file and open it again, we sometimes end up with a blank builder experiment, with no routines in it; though the online version is preserved.

Any idea what’s going on?

Update: we tried using an earlier, working backup of the psyexp file on another computer. This seemed to work for some time and we were able to create a new working Gitlab project with this experiment. But this morning, opening the same file locally produces the following:

No routine flow; but a select few routines are saved up top. I am now thinking think this is a problem with the builder file, so I am changing the category of this post.

I can attempt to run this file, and I get the following output. Note that it says I’m running v2021.1.2 but also alerts me that the experiment was built in 2020.1.2

Welcome to PsychoPy3!
v2021.1.2
34.0700     INFO     Loaded monitor calibration from ['2020_04_14 14:15']
Alert 4052:Experiment was built in a past version of PsychoPy (2020.1.2), saving it in this version may add parameters which cannot be parsed.
	For further info see https://psychopy.org/alerts/4052.html
34.6082     WARNING     IPython failed as shell, using pyshell (IPython v0.12 can fail on wx)
Failed to load /Users/_______________/MA1.psyexp. Please send the following to the PsychoPy user list
Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py", line 650, in fileOpen
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 646, in loadFromXML
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 379, in _getXMLparam
  File "<string>", line 1, in <module>
NameError: name 'slider' is not defined
Failed to load /Users/_______________/MA1.psyexp. Please send the following to the PsychoPy user list
Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/runner/runner.py", line 912, in loadExperiment
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 646, in loadFromXML
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 379, in _getXMLparam
  File "<string>", line 1, in <module>
NameError: name 'slider' is not defined
63.1999     INFO     Investigating repo at /Users/_______________/miso1
Failed to load /Users/_______________/MA1.psyexp. Please send the following to the PsychoPy user list
Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/runner/runner.py", line 912, in loadExperiment
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 646, in loadFromXML
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 379, in _getXMLparam
  File "<string>", line 1, in <module>
NameError: name 'slider' is not defined
Failed to load /Users/_______________/MA1.psyexp. Please send the following to the PsychoPy user list
Traceback (most recent call last):
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/runner/runner.py", line 912, in loadExperiment
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 646, in loadFromXML
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py", line 379, in _getXMLparam
  File "<string>", line 1, in <module>
NameError: name 'slider' is not defined
Generating PsychoPy script...

## Running: /Users/_______________/MA1_lastrun.py ##
2021-03-03 10:31:46.922 python[50895:897564] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
##### Experiment ended. #####

I thought this might be because we had copied a routine from another experiment, which may not have been in 2021.1.2. However, we’ve tried re-coding the experiment in the new version and still get the popup saying the JS file has been modified outside of Psychopy, though the experiment runs.

I’m still not 100% sure I’ve diagnosed the problem, so I’d welcome any further insights.

The alert should go away if you save in 2021.1.x, that’s triggered when the version stored in the experiment file (which is the version it was last saved in) is less than 2021.1.0 and the version you’re currently running it in is more. So saving the file should update the version number in the experiment file.

The bug itself is harder to diagnose - could you share the .psyexp file for the broken experiment? I’ll need to see whether this is a problem with how the file was constructed or with how the builder interprets the file to build the Flow panel…

Same problem here - I also copied a (slider) component from an experiment built with an earlier PsychoPy version. Errors read pretty identical.

What brought the “flow” back was editing the .psyexp file in a text editor and completely deleting the slider routine. Hopefully the experiment stays stable now :confused:

I experienced this issue recently where someone made an edit to a text component. I recovered the experiment by identifying the offending component from the error message in the runner and simplifying the contents by replacing it with “Test”.

I’m still not sure exactly what character caused the issue but I managed to paste the desired text back in (replacing some code characters with line breaks)

Sorry I didn’t see when you wrote this! I’m not sure I have the broken file anymore, but I will look around and send it to you privately if I find it.

P.S. I still get popups with the same query (“JS file has been modified outside of Psychopy”) on many experiments now, but all goes well if I just hit “Yes”

That happens if you have the coder view open in 2021 with the JS code in it and press sync.

2 Likes

[Sorry for bringing this post back] In 2021.1.4 the coder view (with the JS contnent of the exp) pops up everytime I hit the sync button so I need to remember to close it for next time I want to sync? Is there a way to supress it?

Thanks

I’ve been finding this too and I’ve not yet found a consistent way to surpress it.

1 Like

Thanks @wakecarter for confirming.