Heroku app crashing (H10 error)

90 views
Skip to first unread message

Jeni Stiso

unread,
Mar 31, 2021, 9:58:30 AM3/31/21
to PsiTurk
This is a technical question that I had posted on stack overflow but wasn't getting any traction on.

I'm trying to spin up an experiment on a Heroku app with psiturk. I have previously gotten this to work (~2019), but recently (since 2021) I have not been able to run psiturk on Heroku without the app crashing, even using exactly the same code. 

Here are some of the steps I have taken so far:

  • The experiment runs locally, and I have confirmed that I can connect to my postgres database from the Heroku app.
  • I have also confirmed the Heroku is dynamically binding the port, and not using the one set in config.txt.
  • In the Heroku bash environment, I am able to start psiturk and turn on the server without the app crashing, but the app will crash when loading a debug of sandbox HIT link.

The Heroku app uses python and node buildpacks, and the Procfile points to a python script. I am using psiturk 2.3.11 and python 3.8.8, and I have followed the steps in the psiturk documentation for setting config variables.

Here is the Heroku log:

```

2021-03-29T16:44:16.409840+00:00 app[api]: Starting process with command `bash` by user XXXX 

2021-03-29T16:44:39.951733+00:00 heroku[run.7975]: State changed from starting to up 

2021-03-29T16:44:40.507250+00:00 heroku[run.7975]: Awaiting client 

2021-03-29T16:44:40.583037+00:00 heroku[run.7975]: Starting process with command `bash` 

2021-03-29T17:04:33.678083+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/pub/ad?assignmentId=debug98GDW3&hitId=debug6JU43S&workerId=debugG38KJ9&mode=debug" host=jeni-docker-test.herokuapp.com request_id=2bdae5da-5f59-475e-8ca6-9ea9a380d5c0 fwd="70.16.141.206" dyno= connect= service= status=503 bytes= protocol=http 

2021-03-29T17:04:33.870529+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=jeni-docker-test.herokuapp.com request_id=828565a0-923b-4283-b9de-17b4cf890459 fwd="70.16.141.206" dyno= connect= service= status=503 bytes= protocol=http

```

And the relevant parts of config.txt I'm using (with account information removed)

```

 [Database Parameters] 

database_url = postgres:<my_database_url>

 table_name = participants_tmp

 [Server Parameters] 

host = 0.0.0.0 

port = 22362 

cutoff_time = 30

 logfile = server.log

 loglevel = 2 

debug = false l

ogin_username = examplename 

login_pw = examplepassword 

threads = 1 

secret_key = 'this is my secret key which is hard to guess, i should change this' 

 [Shell Parameters] 

launch_in_sandbox_mode = true

 bonus_message = "Bonus for Bassett Lab Experiment. Thanks for participating!" 

 use_psiturk_ad_server = false 

ad_location = https://jeni-docker-test.herokuapp.com/pub

```

The crash happens before anything is logged to the server.log file

Any advice on next steps?

Thank you!!

Jeni

Dave Eargle

unread,
Mar 31, 2021, 10:45:33 AM3/31/21
to Jeni Stiso, PsiTurk
Psiturk 2 needs ON_HEROKU set, but the latest docs mention ON_CLOUD. H10 is about failing to bind to PORT. Show your redacted `heroku config`?

--
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/8df498ca-d0f7-432d-ad53-6805feee7c83n%40googlegroups.com.

Jeni Stiso

unread,
Mar 31, 2021, 10:55:15 AM3/31/21
to PsiTurk
Thanks for getting back to me!
Here is the output of heroku config (except for the psitruk and mturk passwords)

ON_CLOUD:                 1                                                                           

PSITURK_THREADS:          1

I tried adding ON_HEROKU=1 and it works now. Thank you!! So any psiturk version in the form 2.X.X needs ON_HEROKU and not ON_CLOUD?

Dave Eargle

unread,
Mar 31, 2021, 12:04:16 PM3/31/21
to Jeni Stiso, PsiTurk
Right. There's separate, older docs for psiturk v2: https://psiturk.readthedocs.io/en/python2/

Consider migrating to psiturk 3 -- the only main reason to stay on psiturk 2 is if you're using the psiturk ad server, which you're not. 

Reply all
Reply to author
Forward
0 new messages