# Experiment not running online/unhandled internal errors when syncing

**URL:** <https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756>\
**Category:** Online experiments\
**Created:** [February 24, 2021, 7:19pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756 "2021-02-24T19:19:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sydperry14](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sydperry14](https://discourse.psychopy.org/u/sydperry14)\
**Post date:** [February 24, 2021, 7:19pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/1 "2021-02-24T19:19:53Z")

</div>

URL of experiment: [https://run.pavlovia.org/sydperry/hnp](https://run.pavlovia.org/sydperry/hnp)

Description of the problem:  
I have had issues when syncing my experiment to my Pavlovia account. I finally got it to sync but now every time I try to resync/update by clicking the globe icon in builder view it brings up the following unhandled internal error

Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 774, in findPathsInFile  
filePath = eval(filePath)  
File “”, line 1, in   
NameError: name ‘expInfo’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 1226, in onPavloviaSync  
self.fileExport(htmlPath=htmlPath)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 719, in fileExport  
target=“PsychoJS”)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 73, in generateScript  
compileScript(infile=exp, version=None, outfile=filename)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 242, in compileScript  
\_makeTarget(thisExp, outfile, targetOutput)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 214, in \_makeTarget  
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 212, in writeScript  
self\_copy.flow.writeFlowSchedulerJS(script)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\flow.py”, line 290, in writeFlowSchedulerJS  
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 821, in getResourceFiles  
condsPaths = findPathsInFile(params[‘conditionsFile’].val)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 783, in findPathsInFile  
[getPaths(condFile) for condFile in os.listdir(expPath)  
NotADirectoryError: [WinError 267] The directory name is invalid: ‘C:\Users\jaepe\OneDrive\Desktop\HNI.experiment4\HNP.js’

Furthermore, when trying to pilot my experiment it doesn’t take any time to upload resources (I have over 1,000 and it used to take a long time to upload them). After I fill in the participant and session info and click okay it just says “Closing the session, please wait a few moments” then “Thankyou for your patience” then the experiment ends.

Any help in figuring this out would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [February 24, 2021, 9:44pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/2 "2021-02-24T21:44:52Z")

</div>

Some part of your experiment appears to be referring to `C:\Users\jaepe\OneDrive\Desktop\HNI.experiment4` and it looks like that folder doesn’t exist. Maybe it’s `One Drive` with a space instead?

---

<div class="post-metadata">

**Author:** ![sydperry14](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sydperry14](https://discourse.psychopy.org/u/sydperry14)\
**Post date:** [February 24, 2021, 11:19pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/3 "2021-02-24T23:19:46Z")

</div>

C:\Users\jaepe\OneDrive\Desktop\HNI.experiment4

I’ve copied and pasted the file location above. There doesn’t seem to be any space needed.

---

<div class="post-metadata">

**Author:** ![sydperry14](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sydperry14](https://discourse.psychopy.org/u/sydperry14)\
**Post date:** [February 25, 2021, 3:59pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/4 "2021-02-25T15:59:48Z")

</div>

I think it was a bug of that version of PsychoPy (2020.1). I downloaded the latest version of PsychoPy and everything ran great until my text response section which resulted in the following error

- **TypeError: Cannot read property ‘clearEvents’ of undefined**

---

<div class="post-metadata">

**Author:** ![sydperry14](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sydperry14](https://discourse.psychopy.org/u/sydperry14)\
**Post date:** [February 25, 2021, 4:27pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/5 "2021-02-25T16:27:37Z")

</div>

> [@Python to JS Trouble](https://discourse.psychopy.org/t/python-to-js-trouble/13144/5):
>
> In general, you’ll need to set your Code Type to ‘Both’ instead of ‘Auto\>JS’ to modify the auto-translation. The problem is that that setting is the default, every time you close the code snippet it will go back to it and you need to be careful that it doesn’t accidentally overwrite the correct code. For the text input, go to the text input demo and use their Javascript code ([https://gitlab.pavlovia.org/demos/textinput](https://gitlab.pavlovia.org/demos/textinput)) \> download the whole demo, open it in builder and take those code snippets. …

The solution to this error can be found on the forum link above.

---

<div class="post-metadata">

**Author:** ![Kylie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kylie/32/13333_2.png) [@Kylie](https://discourse.psychopy.org/u/Kylie)\
**Post date:** [March 5, 2021, 5:10am UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/6 "2021-03-05T05:10:03Z")

</div>

I am also being told that ‘expInfo’ is not defined. I was using expInfo[‘group’] to determine which condition Excel file to use. What is even more confusing, is that I created condition Excel files using expInfo[‘group’] for two loops previously and everything worked flawlessly. I am currently using 2020.2.10. I have not updated because I was worried about compatibility and am almost done creating my paradigms.

The full error from the PsychoPy unhandled error is as follows:  
Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 808, in findPathsInFile  
filePath = eval(filePath)  
File “”, line 1, in   
NameError: name ‘expInfo’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 1221, in onPavloviaSync  
self.fileExport(htmlPath=htmlPath)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 719, in fileExport  
target=“PsychoJS”)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 73, in generateScript  
compileScript(infile=exp, version=None, outfile=filename)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 242, in compileScript  
\_makeTarget(thisExp, outfile, targetOutput)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 214, in \_makeTarget  
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 223, in writeScript  
self\_copy.flow.writeFlowSchedulerJS(script)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\flow.py”, line 289, in writeFlowSchedulerJS  
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 856, in getResourceFiles  
condsPaths = findPathsInFile(params[‘conditionsFile’].val)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 822, in findPathsInFile  
files.extend(findPathsInFile(str(condFile)))  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py”, line 808, in findPathsInFile  
filePath = eval(filePath)  
File “”, line 1  
C:\Users\knfer\Documents\dissertation\stressors~$ReviewConditionB.xlsx  
^  
SyntaxError: invalid syntax

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [March 5, 2021, 10:00am UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/7 "2021-03-05T10:00:08Z")

</div>

Not evaluating `expInfo` is not itself a problem. The problem is with the line trying to extract `C:\Users\knfer\Documents\dissertation\stressors~$ReviewConditionB.xlsx`  
Maybe you have another file that refers to this location incorrectly? Maybe you’ve inserted a $ where it wasn’t needed? Hard to know what you’ve done wrong from this, but it’s something to do with how you’ve specified that filename I think

---

<div class="post-metadata">

**Author:** ![Kylie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kylie/32/13333_2.png) [@Kylie](https://discourse.psychopy.org/u/Kylie)\
**Post date:** [March 30, 2021, 3:18pm UTC](https://discourse.psychopy.org/t/experiment-not-running-online-unhandled-internal-errors-when-syncing/20756/8 "2021-03-30T15:18:41Z")

</div>

Sorry for the delay in response, I must have missed the notification. It looks like I did update the file that day (going back to my commits).

However, I was having an issue where I could sync to Pavlovia only a single time and then would receive an unhandled error (even for something like a text stimulus update). For this, I believe what ended up working was restarting my computer, then syncing. But, actually checking/piloting in Pavlovia on a different computer. The issue seemed to occur only when I also connected to Pavlovia from the same computer. When this error was most persistent, I ended up working between two different computers. After a day, whatever the error was seemed to correct itself and then I could do everything from the same machine. I never figured out what was causing the issue.
