Forbidden ngx: 403 error when trying to pilot/run an experiment on Pavlovia

URL of experiment:

Hello everyone!

Whenever I try to pilot an experiment that I have synced from PsychoPy onto Pavlovia, I get the error message:

Forbidden ngx: 403 error

Would anyone be able to give me a helping hand?

I’d greatly appreciate it :slight_smile:

In the Pavlovia dashboard, try setting your experiment to piloting or running.

See also Forbidden ngx: 403 - #2 by jon

1 Like

I am having the same problem, with Pavlovia
I tried to run it from the Builder BEFORE putting in Piloting mode, which of course did not work, but now I have it in Piloting mode and I get the error when I pilot it.

When you look at your experiment home page on Pavlovia, can you see a version number?

When you view code can you see two JS files?

When you press the sync button in Builder does it sync without errors?

I sometimes have errors which stop the experiment syncing, which means it has no chance of running online because it hasn’t created a JS file.

I don’t think I see a version number; where would it be? And I don’t see JS files in view code. And, no, it does not sync - I get an unhandled internal error. But I can’t make sense of any of the traceback call information.

Please paste the trace back information. That’s why it won’t run online.

Here’s the trace information:
Traceback (most recent call last):
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\app\builder\”, line 1339, in onPavloviaRun
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\app\builder\”, line 759, in fileExport
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\scripts\”, line 73, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\scripts\”, line 242, in compileScript
makeTarget(thisExp, outfile, targetOutput)
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\scripts\”, line 214, in makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\”, line 220, in writeScript
localDateTime, modular)
File "C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\experiment\components\settings_init
.py", line 528, in writeInitCodeJS
File "C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\experiment\components\settings_init
.py", line 516, in prepareResourcesJS
resourceFiles = self.exp.getResourceFiles()
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\”, line 870, in getResourceFiles
condsPaths = findPathsInFile(params[‘conditionsFile’].val)
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\”, line 836, in findPathsInFile
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\”, line 853, in findPathsInFile
conds = data.importConditions(thisFile[‘abs’]) # load the abs path
File “C:\Users\bwhitlow\AppData\Local\PsychoPy3\lib\site-packages\psychopy\data\”, line 476, in importConditions
(fileName, len(trialList), len(fieldNames)))
UnboundLocalError: local variable ‘trialList’ referenced before assignment

Tell us about your loops or other trial lists.

I have a training phase, with a trial routine that picks different condition files for each block of 22 trials (the condition files all have a block count suffix that increments in each block). The trials are within a block loop that indicates how many trial blocks will be used. This loop is followed by a test block, which loops through a block of 44 test trials, then ends the experiment. Do you need more specific information?

It sounds like you have concentric loops. Do you make any reference to variables set inside the inner loop outside that loop?

It might be a good idea to show screenshots of your loops and any code used to create the spreadsheet file names.

Thanks for the offer. Here are some shots:
First, the experiment flow

Here is the Instruction Routine:
and code

Here is the ClearBlock Routine and code


the Trials Routine:
and Code

and conditions file

The Trial Feedback Routine:
and code

End of Block Routine and code:

The test loop routine and code:

and the test conditions file


Please take a look at my crib sheet.

You have a Both code importing random and zipfile. Are you doing anything to cope with that on the JS side. I noticed random in an Auto component sonO suspect not.

Sorry to be dense. Where is your crib sheet?

1 Like