No submit HIT button

75 views
Skip to first unread message

Kara Schwartz

unread,
May 24, 2021, 12:44:48 PM5/24/21
to PsiTurk
Whenever I run my experiment it works fine, and when I finish it I get an experiment has finished blurb. However I dont see a submit HIT button. because I can never submit the HIT , I can never get the data. My database is configured in heroku to match up to my config.txt file, my aws credentials are valid, and my custom.py file looks fine. Do you have any idea what could be causing this issue?

Dave Eargle

unread,
May 24, 2021, 12:50:09 PM5/24/21
to PsiTurk
Not enough details to know for sure, but I'm guessing that you're going through in mode=debug. If you hit the /complete route on mode=sandbox or mode=live, the "popup" closes (assuming it's a popup like it is when launched from mturk) and the /ad aka /pub route refreshes, and shows a "submit" button.

On Mon, May 24, 2021, 10:44 AM Kara Schwartz <kjaesc...@gmail.com> wrote:
Whenever I run my experiment it works fine, and when I finish it I get an experiment has finished blurb. However I dont see a submit HIT button. because I can never submit the HIT , I can never get the data. My database is configured in heroku to match up to my config.txt file, my aws credentials are valid, and my custom.py file looks fine. Do you have any idea what could be causing this issue?

--
You received this message because you are subscribed to the Google Groups "PsiTurk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psiturk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psiturk/42828754-68de-46fc-b02d-3b7d37eef35fn%40googlegroups.com.

Kara Schwartz

unread,
May 24, 2021, 3:01:47 PM5/24/21
to PsiTurk
it says i'm in sandbox mode...

Kara Schwartz

unread,
May 25, 2021, 1:20:29 PM5/25/21
to PsiTurk

Is there any reason this error could happen while I'm in sandbox mode? Or it could think I'm in debug mode despite psiturk telling me otherwise?

Dave Eargle

unread,
May 25, 2021, 3:21:17 PM5/25/21
to Kara Schwartz, PsiTurk
It would be a lot easier to help if you could provide a reprex-- a self-contained explicit step by step that anyone else could follow to see what you're seeing -- a reproducible example. Otherwise, it's a game of 20 questions combined with telephone. Like before, with your other problem, a reprex would have shown a missing "git add, git commit, git push". It wouldn't have been obvious to you, but it would have been to others looking. Can you provide something like that? That's what I mean when I say "not enough details to know for sure."

And, during a task, for what to do when /complete is reached, psiturk determines the "mode" from the "mode=" key-value in the url.

Kara Schwartz

unread,
May 25, 2021, 6:36:39 PM5/25/21
to PsiTurk
I currently have my experiment in a state where I can ssh into the virtual machine our lab is using, cd  into the experiment directory, and input psiturk hit create. Depending on the config file, my hit can go to one of two apps in a pipeline, either secure-wave-49665 or secure-wave-2. Each app is configured with its own database and url. To ensure the app I'm using always matches my config file my virtual machine has 2 backup config files (config-sw2 and config-sw49) that correspond to each app. Whenever I want to switch apps I just remove config.txt,copy one of my app specific config files to a new file called config.txt, and then add that config  file to a git branch (either master or a clone of master I've made so I dont drastically screw everything up in the process of trying to find something that works), commit that branch, push the branch to github, go to the desired heroku app url , deploy the git branch I just committed. To be sure heroku sees the config I want it to see I then run "heroku run --app secure-wave-2(or secure-wave-49665) psiturk config print". I verify that the config file heroku sees is the same as the one that psiturk is seeing locally.Then finally I go back to the terminal window and input psiturk server on/ psiturk hit create 1 0.01 1.

I can go to the sandbox page and accept  the hit fine now without running into the "our records show you have already completed this hit". I can test and run the hit. When I use chrome's inspector tool I see a "failed to load sourcemap :could not load content for https://secure-wave-49665.herokuapp/com/static/lib/underscore-min.map: HTTP error:status code 404, net :: ERR_HTTP_RESPONSE_CODE_FAILURE" and  "synchronous jquery 3.4.1.min.js:6 XMLHttpRequest is deprecated because of its determental effects to the end user's experience." error. However I get similar errors when I run the example, which I can collect data from fine.  Then below on the console I get printouts of all the data I want. current round, chosen room, ect. At the end I get a message that says "XHR finished loading:  POST "https://s jquery-min.js: Secure-wave-49665.herokuapp.com/save data file". But when I go to the psql database none of the data I saw from the console appears. Its like aws never gets any data and never realizes that the experiment has finished. Even though the console seems to be collecting data and sending it -somewhere. But my config file points to the correct database, heroku sees the same config file psiturk does, and my aws credentials are entered correctly (they are the same crendentials I use in the example- the one I am able to get data from).

And finally when I go back to psiturk in terminal and run download_datafiles I get a whole bunch of error messages and no changes to the virtual machine, unlike when I run download datafiles in the example experiment directory after running the example- in which I get no error messages and I get csv files with eventdata,trialdata,and questiondata. 

I don't know what could be wrong. The javascript should work fine because it worked fine before this mess with heroku and psiturk3 happened.The aws credentials should work fine because they work fine on the example. The config credentials should be fine because I have a super reliable method of posting the right config files to the right apps. What else could it be?

Hopefully this is close to what you meant by reprex, this tries to explain everything I do when I run a hit, all I have tried,and all potential sources for errors I have systematically eliminated or investigated.

Kara Schwartz

unread,
May 25, 2021, 6:46:14 PM5/25/21
to PsiTurk

Dave Eargle

unread,
May 25, 2021, 10:26:50 PM5/25/21
to Kara Schwartz, PsiTurk
There's still a fog of reproducibility. A reprex is step by step literal code that someone else can run, simplified as much as possible to remove confounds, ideally with sample code, perhaps starting from the bare bones example repro. If it's those things, others can go through the steps on their own and hit the same problem.

The 404 sourcemap is not a problem

The Network tab on the Chrome inspector should also show your POST to /save

It would be useful to see the "whole bunch of errors" for download_datafiles

That things are working with the example experiment suggests there's something off in your flow that's causing whatever, and also suggests it will be impossible for anyone without access to your entire pipeline to reproduce the issue.

You have one heroku app that switches back and forth between being two entirely different apps? Why not two separate heroku apps?

Your database that has no data -- does it have any _tables_? Does it have _any_ rows in _any_ table? Does it have all fields for a participant _except_ the datastring? Where is your database hosted, I wonder if you're getting a connection error for your one app, idk.

Kara Schwartz

unread,
May 28, 2021, 3:07:35 PM5/28/21
to PsiTurk
My lab head and I noticed recently that our task.js file included data.XXX commands to log the data, and then in the on_finish section of the jspsych.init function it makes a csv data file and uses a route from our custom.py file to save it in a data folder on our vm. But meanwhile the example records and saves the data using psiturk specific commands.  Could the fact that we aren't using psiturk data managing commands contribute to any issues? Or maybe could there be an error where the csv files were able to save locally when we used the psiturk ad server but now that we are using a heroku server its trying to save files locally on a cloud platform and failing?

Dave Eargle

unread,
May 28, 2021, 5:44:25 PM5/28/21
to Kara Schwartz, PsiTurk, m.lil...@uci.edu
After our many private messages back and forth in additional to the public ones, I'm ccing your lab lead so that everyone is on the same page. Hello Mimi, from a fellow assistant prof. 

Kara, this study that you have been trying to launch for months now only seems to use psiturk a little bit. Whoever created it bolted psiturk on top of jspsych, probably so that psiturk would handle the mturk worker interaction stuff, maybe as an afterthought. What you just described about on_finish saving data to a csv on disk is totally not "the psiturk way" in any way. That's fine, but dont expect that data to somehow end up in a psiturk database. How could it! It's saving to a csv on a heroku dyno somewhere that you'll never be able to access without custom accessing programming -- some kind of password protected route in custom.py would work assuming you're not scaling to more than 1 dyno, but don't ask me how to do that, because we're way into "can you program my study for me for free" territory if so. Or you could use your custom route to save your data to a database _somewhere_.

Heroku dynos are docker containers. Containers are ephemeral. Even if you run "heroku run bash" and get a bash shell within a one-off container, _that container is not the one that served your experiment and therefore will not have your datafile._ It wouldn't fail to create the csv files on the heroku dyno_ -- they would exist, but just not be retrievable.

You might opt to dump heroku and just figure out how to serve https from your vm, buying a domain name etc. I started a how-to on this using cloudflare: https://psiturk.readthedocs.io/en/latest/tutorials/static-ip-ssl.html, and nginx rev proxy is also an option, but again, hello from an assistant prof with no lab doing this on a volunteer basis. 



Mimi Liljeholm

unread,
Jun 2, 2021, 1:06:48 AM6/2/21
to PsiTurk
Hi Dave,

I just recently got involved in troubleshooting this situation and believe we have it sorted now, thanks for all your help!

Best,
Mimi
Reply all
Reply to author
Forward
0 new messages