Closed mvdoc closed 7 years ago
Ping @adamliter and perhaps @deargle?
Hi @mvdoc. Yes, sorry, this is in on my radar. I'm hoping to get a chance to look at it this weekend. I've been a bit swamped this week. Sorry!
Thanks @adamliter, I managed to debug it and solved the problem. Updating psiturk.js with the latest version did it. The reason was that at the end of the experiment with the old psiturk.js, psiturk would request
self.completeHIT = function() {
self.teardownTask();
// save data one last time here?
window.location= self.taskdata.adServerLoc + "?uniqueId=" + self.taskdata.id;
}
instead of (new version)
self.completeHIT = function() {
self.teardownTask();
// save data one last time here?
window.location= self.taskdata.adServerLoc + "?uniqueId=" + self.taskdata.id + "&mode=" + self.taskdata.mode;
}
so because of the missing &mode=
, nginx wouldn't serve the page (I don't know why though, would be curious to know why).
I'm gonna close this. Thanks again!
It looks like that change was committed by @deargle, so he can probably answer better. But it looks like this is an indicator of whether you're in live or debug mode. Maybe without this indicator, it was trying to save data to the live version of things while you were in debug mode?
It worked when you used gunicorn because psiturk.js is loaded dynamically, from the up-to-date pip repo. But when you use nginx it serves it statically without asking flask/gunicorn to load it, because you've copied it into a static folder (why did you copy it into a static dir?). Flask/gunicorn explodes when you don't pass mode
because the route tries to access it
Now it all makes sense. Thank you so much @deargle @adamliter!
why did you copy it into a static dir?
I have no idea ¯_(ツ)_/¯ probably a residual of when I was playing around...
@adamliter I'm getting a Bad Request error 400 when using psiturk with jspsych. It works fine if I bypass nginx and access gunicorn directly, so there's something happening with nginx. I tried looking up on google and changed a bunch of parameters (mostly related to increasing the buffer size), but it still fails.
I have created a minimal example that fails with nginx, which you can download here: https://www.dropbox.com/s/kk5q8vo0qh6wzq2/nginx_fail.zip
Enabling debugging for nginx, this is the error I get:
And this is the complete log
Do you have any clue on how to fix this?