psychopy.org | Reference | Downloads | Github

Not able to run experiment online

Hello,

I am testing to see if I can get my code to pilot and when I click run online in builder mode (or pilot on pavlovia) I get an error message in my web browser that says

403 Forbidden

nginx

What do I need to do to get this to work?

Thank you!
Clark

Hey @2clarkmoore2, could you send me a link to your study so that I can investigate a bit further? Here to help, thanks, s.

https://run.pavlovia.org/2clarkmoore2/hl_ensemble_pilot/

also here is the gitlab:

Thank you

No worries, your study must be set to private and I lack sufficient rights to access the repo, would it be possible to upload the .psyexp here instead? Thanks, s.

HL_ensemble_prestim.psyexp (2.5 KB)

I feel like I may be missing some step in preparing the code to link into an online mode.

Sorry not sure what the problem is, I was able to stage below as normal. Did you remember to Export HTML from the File menu in PsychoPy?

Did not know to do this but I tried it. It seems I have an index html file but that is it. Not sure if I am supposed to have more than that. Either way it still does not work. Besides exporting as an html file is there anything else I need to be doing to get this to run? Thank again for the help

also here is my github I changed the permissions so if you request access you may view.

OK great, thanks for giving me access to your repo. I created a fork for it, cloned it on my computer, opened HLensemble_prestim.psyexp in PsychoPy, hit the “Run the study online (with pavlovia.org)” button and that was all I had to do to get past the 403 you posted about initially.

However, I believe there are some issues with how you specify “allowed keys” in your keyboard components, which I sort of had to patch to get the JS to run. Please consult the manual for more details on how to use the keyboard component in PsychoPy.

Please let me know if you need more help, thanks :blush:

Hello Sotiri, thank you so much (again lol) for your help. In trying to fix my allowed keys component I actually solved another issue that I had run into (so thanks for this). However, I do feel like I may be missing something here. What exactly did you do to the key component to get the JS to work? The one issue that seems weird to me is when I put ‘return’ into the first routines key component I get an error message about my python syntax. This is strange because the examples in the key component are ‘left’, ‘right’ and these seem to work fine. When I put [‘return’] I dont get the same error message and this seems to works just fine.

Either way, I still can’t seem to get my project to run online the way you did. I clicked on fork in gitlab and doesn’t seem to do much. Feel like I am still missing something here to get past this 403 error message. Im so close! I can almost feel it!

I think there’s a new bug in 2020.2 which means that you can’t have a single item in allowed keys, because it is expecting a list.

i.e.
‘return’,‘space’ is fine
‘return’,‘return’ is fine
[‘return’] is fine
‘return’ is not clearly a list and gives an error.

2 Likes

This is great to know thank you for this clarification!

@wakecarter Thanks for flagging, our Python team are aware of the problem, please bear with us a patch is on the way. @2clarkmoore2 Looking at the structure of your project, which includes an html folder, does https://run.pavlovia.org/2clarkmoore2/hl_ensemble_pilot/html also lead to a 403?

In the meantime, I found that ‘return’, (with a comma after the allowed key) seems to work.

1 Like

Hello, Yes it seems that the html leads to a 404 which is interesting. I added the html folder in gitlab manually. Not sure if psychopy was supposed to create a folder like that automatically. Is there anything else I can try to get this to work? Thank you! It does give me hope that you were able to put it online successfully.

Hello all so I see a new issue in this which may be causing the problem - in Sotiri’s above posting of my project it seems to run okay until it gets to a variable E which I have defined in a code component called E = randint(0,2). When the code gets to this part it displays the error message “Reference error: E is not defined”.
Then when I try to run my code in local debug mode I get a similar but different error - “Reference error: randint() is not defined”. Is it possible that I am having an issue converting python’s numpy to java? Shouldn’t builder mode be making this conversion when running online?

Have you looked at my crib sheet? You need to define randint in code_JS

Hi thanks for the response - yes I did see the crib sheet and attempted to do this but didn’t work. It is likely I am going about it the wrong way. In the crib sheet youre saying I should create a code component in my very first routine, set it to JS only. One point I wasn’t clear on is where to put the code - do I put it in “before experiment” or “begin experiment” or “being routine”. Also how exactly should I input the code for defining randint(). Thank you for your help. The crib sheet will be very helpful in getting my experiment to work online once I can figure out how to implement it.

Before Experiment didn’t exist as a tab when I started the crib sheet. Begin Experiment is fine.

Copy and paste the code from the JS column.