[英]Heroku app crashing (H10 error) with psiturk experiment
我正在嘗試使用 psiturk 對 Heroku 應用程序進行實驗。 我之前已經讓它工作了(~2019 年),但最近(自 2021 年以來)我無法在 Heroku 上運行 psiturk 而不會導致應用程序崩潰,即使使用完全相同的代碼也是如此。
以下是我迄今為止采取的一些步驟:
Heroku 應用程序使用 python 和節點構建包,Procfile 指向 python 腳本。 我正在使用 psiturk 2.3.11 和 python 3.8.8,並且我已按照 psiturk 文檔中的步驟設置配置變量。
這是 Heroku 日志:
2021-03-29T16:44:16.409840+00:00 app[api]: Starting process with command `bash` by user danibassettlab@gmail.com
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
還有我正在使用的 config.txt(刪除了帳戶信息)
[HIT Configuration]
title = Key Sequence Learning Study
description = Psychology Study in which you will learn to quickly press keys to respond to squares on the screen.
lifetime = 96
us_only = true
approve_requirement = 95
ad_group = default_network
psiturk_keywords = network
organization_name = University of Pennsylvania
browser_exclude_rule = mobile, tablet
allow_repeats = false
server_timeout = 240
[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
login_username = examplename
login_pw = examplepassword
threads = 1
secret_key = 'this is my secret key which is hard to guess, i should change this'
[Task Parameters]
experiment_code_version = 'behavioral_pilot_v6_delay'
num_conds = 1
num_counters = 1
[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
崩潰發生在任何內容被記錄到實驗文件夾中的 psiturk server.log 文件之前。
對下一步有什么建議嗎?
較新版本的SQLAlchemy
刪除了已棄用的方言名稱postgres
。 您必須使用postgresql
。 在您的數據庫參數中,您有:
database_url = postgres:<my_database_url>
要解決此問題,請將 URL 中的postgres://
重命名為postgresql://
。
或者考慮將sslmode='require'
添加到您的數據庫 URL。
我在psiturk google group上找到了答案。 Psiturk 2 需要設置參數 ON_HEROKU(我設置了 ON_CLOUD 代替。運行
heroku config:set ON_HEROKU=1
解決了這個問題。
或者,您可以升級到 psiturk 3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.