Template Not Found Issue

44 views
Skip to first unread message

Luke Chen

unread,
Dec 16, 2021, 8:04:10 PM12/16/21
to PsiTurk
The structure of my experiment project is correct, and the templates are in the templates subfolder which experiment.py has access to, but I keep getting this error log...has anyone run into a similar problem by chance?

_____________________________________________________

File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker

2021-12-16T16:04:58.373710+00:00 app[web.1]: worker.init_process()

2021-12-16T16:04:58.373711+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/ggevent.py", line 162, in init_process

2021-12-16T16:04:58.373711+00:00 app[web.1]: super().init_process()

2021-12-16T16:04:58.373711+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 119, in init_process

2021-12-16T16:04:58.373712+00:00 app[web.1]: self.load_wsgi()

2021-12-16T16:04:58.373712+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi

2021-12-16T16:04:58.373713+00:00 app[web.1]: self.wsgi = self.app.wsgi()

2021-12-16T16:04:58.373713+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi

2021-12-16T16:04:58.373713+00:00 app[web.1]: self.callable = self.load()

2021-12-16T16:04:58.373713+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/psiturk/experiment_server.py", line 68, in load

2021-12-16T16:04:58.373714+00:00 app[web.1]: return util.import_app("psiturk.experiment:app")

2021-12-16T16:04:58.373714+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 358, in import_app

2021-12-16T16:04:58.373715+00:00 app[web.1]: mod = importlib.import_module(module)

2021-12-16T16:04:58.373715+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module

2021-12-16T16:04:58.373715+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)

2021-12-16T16:04:58.373716+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1030, in _gcd_import

2021-12-16T16:04:58.373716+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load

2021-12-16T16:04:58.373716+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked

2021-12-16T16:04:58.373717+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 680, in _load_unlocked

2021-12-16T16:04:58.373717+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 850, in exec_module

2021-12-16T16:04:58.373717+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed

2021-12-16T16:04:58.373718+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/psiturk/experiment.py", line 70, in <module>

2021-12-16T16:04:58.373718+00:00 app[web.1]: check_templates_exist()

2021-12-16T16:04:58.373718+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/psiturk/experiment.py", line 63, in check_templates_exist

2021-12-16T16:04:58.373719+00:00 app[web.1]: raise RuntimeError((

2021-12-16T16:04:58.373733+00:00 app[web.1]: RuntimeError: Missing one of the following templates: thanks-mturksubmit.html, closepopup.html.Copy these over from a freshly-created psiturk example experiment.('TemplateNotFound', 'thanks-mturksubmit.html')

Brian Yin

unread,
Dec 16, 2021, 8:30:04 PM12/16/21
to PsiTurk
I had this exact issue a few hours ago! The problem was that I needed to be initializing my git repo for Heroku inside the directory which houses the /templates/ directory. So I went from this (broken):

/stroop-task/
    herokuapp.py
    .git
    /psiturk-example/
        /templates/
        ...
to this (fixed):

/stroop-task/
    /psiturk-example/
        herokuapp.py
        .git
        /templates/
Reply all
Reply to author
Forward
0 new messages