heroku - Heroku 应用程序因 psiturk 实验而崩溃(H10 错误)
问题描述
我正在尝试使用 psiturk 在 Heroku 应用程序上进行实验。我之前已经让它工作了(~2019 年),但最近(自 2021 年以来)我无法在 Heroku 上运行 psiturk 而不会导致应用程序崩溃,即使使用完全相同的代码也是如此。
以下是我迄今为止采取的一些步骤:
- 实验在本地运行,我已经确认可以从 Heroku 应用程序连接到我的 postgres 数据库。
- 我还确认 Heroku 正在动态绑定端口,而不是使用 config.txt 中设置的端口。
- 在 Heroku bash 环境中,我能够启动 psiturk 并打开服务器,而不会导致应用程序崩溃,但是在加载沙盒 HIT 链接的调试时应用程序会崩溃。
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 文件之前。
对下一步有什么建议吗?
解决方案
我在psiturk google group上找到了答案。Psiturk 2 需要设置参数 ON_HEROKU(我设置了 ON_CLOUD 代替。运行
heroku config:set ON_HEROKU=1
解决了这个问题。
或者,您可以升级到 psiturk 3
推荐阅读
- token - Gensim 中的 filter_extreme
- macos - 自制“没有可用的瓶子”
- flutter - Flutter,Text,不换行?
- spring - 尽管使用了正确的映射,但对 Spring REST JPA 存储库代码的 GET 调用返回 404
- flutter - 填充列中的垂直空间 - Flutter
- android - fadingEdgeLength 在 Android 9 的某些设备上呈现不正确
- loopbackjs - 如何在 Loopback 4 中填充对象 ID 数组
- html - R:将“rmarkdown”转换为“html”文件
- java - 抛出非法参数异常的构造函数逻辑
- git - Github 直接推送到 main