``` PS C:\_Fractal Trail> heroku logs --tail
2024-11-30T11:47:52.698140+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:47:52.698140+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:47:52.698140+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:47:52.698141+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:47:52.698141+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:47:52.698141+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:47:52.698141+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:47:52.698618+00:00 app[web.1]: 10.1.47.112 - - [30/Nov/2024:11:47:52 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:47:52.699314+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=5eb94aea-c959-4437-974c-9b314834bedc fwd="222.98.167.222" dyno=web.1 connect=0ms service=2ms status=500 bytes=463 protocol=https
2024-11-30T11:47:53.182781+00:00 app[web.1]: [2024-11-30 11:47:53,182] ERROR in app: Exception on / [GET]
2024-11-30T11:47:53.182794+00:00 app[web.1]: Traceback (most recent call last):
2024-11-30T11:47:53.182795+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
2024-11-30T11:47:53.182802+00:00 app[web.1]: response = self.full_dispatch_request()
2024-11-30T11:47:53.182811+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2024-11-30T11:47:53.182812+00:00 app[web.1]: rv = self.handle_user_exception(e)
2024-11-30T11:47:53.182812+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2024-11-30T11:47:53.182812+00:00 app[web.1]: rv = self.dispatch_request()
2024-11-30T11:47:53.182812+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2024-11-30T11:47:53.182812+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-11-30T11:47:53.182813+00:00 app[web.1]: File "/app/app.py", line 32, in index
2024-11-30T11:47:53.182813+00:00 app[web.1]: return render_template('index.html')
2024-11-30T11:47:53.182813+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2024-11-30T11:47:53.182814+00:00 app[web.1]: ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2024-11-30T11:47:53.182815+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
2024-11-30T11:47:53.182816+00:00 app[web.1]: return self.get_template(template_name_or_list, parent, globals)
2024-11-30T11:47:53.182816+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
2024-11-30T11:47:53.182816+00:00 app[web.1]: return self._load_template(name, globals)
2024-11-30T11:47:53.182816+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
2024-11-30T11:47:53.182816+00:00 app[web.1]: template = self.loader.load(self, name, self.make_globals(globals))
2024-11-30T11:47:53.182816+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:47:53.182817+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:47:53.182817+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:47:53.182817+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:47:53.182817+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:47:53.182817+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:47:53.182817+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:47:53.183421+00:00 app[web.1]: 10.1.47.112 - - [30/Nov/2024:11:47:53 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:47:53.183516+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=8f8c9745-f2b7-4f28-aca7-1d61e95b9d7c fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=500 bytes=463 protocol=https
2024-11-30T11:47:59.670654+00:00 app[web.1]: [2024-11-30 11:47:59,670] ERROR in app: Exception on / [GET]
2024-11-30T11:47:59.670666+00:00 app[web.1]: Traceback (most recent call last):
2024-11-30T11:47:59.670667+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
2024-11-30T11:47:59.670667+00:00 app[web.1]: response = self.full_dispatch_request()
2024-11-30T11:47:59.670668+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2024-11-30T11:47:59.670668+00:00 app[web.1]: rv = self.handle_user_exception(e)
2024-11-30T11:47:59.670668+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2024-11-30T11:47:59.670668+00:00 app[web.1]: rv = self.dispatch_request()
2024-11-30T11:47:59.670669+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2024-11-30T11:47:59.670669+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-11-30T11:47:59.670676+00:00 app[web.1]: File "/app/app.py", line 32, in index
2024-11-30T11:47:59.670676+00:00 app[web.1]: return render_template('index.html')
2024-11-30T11:47:59.670676+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2024-11-30T11:47:59.670677+00:00 app[web.1]: ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2024-11-30T11:47:59.670678+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
2024-11-30T11:47:59.670678+00:00 app[web.1]: return self.get_template(template_name_or_list, parent, globals)
2024-11-30T11:47:59.670678+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
2024-11-30T11:47:59.670678+00:00 app[web.1]: return self._load_template(name, globals)
2024-11-30T11:47:59.670679+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
2024-11-30T11:47:59.670679+00:00 app[web.1]: template = self.loader.load(self, name, self.make_globals(globals))
2024-11-30T11:47:59.670679+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:47:59.670680+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:47:59.670680+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:47:59.670681+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:47:59.670681+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:47:59.670681+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:47:59.670681+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:47:59.671136+00:00 app[web.1]: 10.1.47.112 - - [30/Nov/2024:11:47:59 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:47:59.671351+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=673645be-7eb3-4d5a-8144-6b73200f3d12 fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=500 bytes=463 protocol=https
2024-11-30T11:47:59.935407+00:00 app[web.1]: 10.1.47.112 - - [30/Nov/2024:11:47:59 +0000] "GET /favicon.ico HTTP/1.1" 404 232 "https://fractaltrail20241130-b723087de37d.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:47:59.935827+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=2d47726f-26ee-4a9d-b099-4c6c60049a9a fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=404 bytes=393 protocol=https
2024-11-30T11:48:03.972369+00:00 app[web.1]: [2024-11-30 11:48:03,972] ERROR in app: Exception on / [GET]
2024-11-30T11:48:03.972380+00:00 app[web.1]: Traceback (most recent call last):
2024-11-30T11:48:03.972381+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
2024-11-30T11:48:03.972381+00:00 app[web.1]: response = self.full_dispatch_request()
2024-11-30T11:48:03.972382+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2024-11-30T11:48:03.972382+00:00 app[web.1]: rv = self.handle_user_exception(e)
2024-11-30T11:48:03.972393+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2024-11-30T11:48:03.972393+00:00 app[web.1]: rv = self.dispatch_request()
2024-11-30T11:48:03.972393+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2024-11-30T11:48:03.972394+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-11-30T11:48:03.972394+00:00 app[web.1]: File "/app/app.py", line 32, in index
2024-11-30T11:48:03.972394+00:00 app[web.1]: return render_template('index.html')
2024-11-30T11:48:03.972394+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2024-11-30T11:48:03.972395+00:00 app[web.1]: ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2024-11-30T11:48:03.972395+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
2024-11-30T11:48:03.972395+00:00 app[web.1]: return self.get_template(template_name_or_list, parent, globals)
2024-11-30T11:48:03.972396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
2024-11-30T11:48:03.972396+00:00 app[web.1]: return self._load_template(name, globals)
2024-11-30T11:48:03.972396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
2024-11-30T11:48:03.972396+00:00 app[web.1]: template = self.loader.load(self, name, self.make_globals(globals))
2024-11-30T11:48:03.972396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:48:03.972397+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:48:03.972397+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:48:03.972397+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:48:03.972397+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:48:03.972397+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:48:03.972398+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:48:03.972872+00:00 app[web.1]: 10.1.47.112 - - [30/Nov/2024:11:48:03 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:48:03.973097+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=95806ab8-d066-447b-927e-2889d151e03c fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=500 bytes=463 protocol=https
2024-11-30T11:48:04.233060+00:00 app[web.1]: 10.1.47.112 - - [30/Nov/2024:11:48:04 +0000] "GET /favicon.ico HTTP/1.1" 404 232 "https://fractaltrail20241130-b723087de37d.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:48:04.233518+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=1940b619-3acf-4387-88d3-e03d18f45af1 fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=404 bytes=393 protocol=https ```
여전히 index.html
파일을 찾을 수 없다는 오류가 발생하고 있습니다. 이 문제는 보통 index.html
파일이 존재하지 않거나, 잘못된 경로에 배치된 경우에 발생합니다. 다음과 같은 방법으로 문제를 해결해 보세요:
- 파일 위치 확인:
index.html
파일이templates
디렉터리에 있는지 확인하세요. 파일이 없다면 추가해야 합니다.
프로젝트 구조는 다음과 같아야 합니다
├── app.py
├── requirements.txt
├── Procfile
├── templates/
├── index.html
├── result.html
파일 추가 후 Git에 반영:
index.html
파일을templates
폴더에 추가한 후, 변경 사항을 Git에 반영하고 다시 푸시해야 합니다.
git add templates/index.html templates/result.html
git commit -m "Add index.html and result.html to templates directory"
git push heroku main
- 파일 경로 확인:
- Flask는 템플릿 파일이 반드시
templates/
폴더에 있어야 합니다. 파일 경로가 잘못된 경우index.html
을 찾을 수 없게 되니, 반드시 올바른 경로에 위치해야 합니다.
- Flask는 템플릿 파일이 반드시
이 과정을 통해 Heroku에서 index.html
을 찾을 수 있게 됩니다. 추가로 문제가 있거나 더 도와드릴 부분이 있다면 알려주세요!
프로젝트 구조를 확인한 결과, templates
폴더에 index.html
과 result.html
파일이 올바르게 배치되어 있는 것 같습니다. 이 경우에도 Heroku에서 템플릿을 찾지 못하는 문제가 발생하는 몇 가지 원인을 살펴보고 해결해 보겠습니다.
- Git에 올바르게 반영되지 않은 파일 확인:
- 모든 파일이 Git에 커밋되어 있는지 확인하세요. 특히,
index.html
과result.html
파일이 올바르게 Git에 추가되었는지 확인해야 합니다.
- 모든 파일이 Git에 커밋되어 있는지 확인하세요. 특히,
git status
만약 index.html
파일이 Git에 추가되지 않았다면, 추가하고 푸시하세요.
git add templates/index.html templates/result.html
git commit -m "Add index.html and result.html"
git push heroku main
템플릿 캐시 문제:
- 가끔씩 템플릿 파일이 캐시되어 발생하는 문제일 수 있습니다. Heroku에서 앱을 강제로 다시 시작해 볼 수 있습니다.
heroku restart
- 경로 확인 및 대소문자 확인:
- 파일명이나 경로의 대소문자가 일치하지 않으면 템플릿을 찾지 못할 수 있습니다.
templates
폴더와 파일 이름(index.html
,result.html
)의 대소문자가 정확한지 확인하세요.
- 파일명이나 경로의 대소문자가 일치하지 않으면 템플릿을 찾지 못할 수 있습니다.
- 추가 로그 확인:
- 여전히 문제가 해결되지 않는 경우, 추가 로그를 확인해 더 많은 힌트를 얻을 수 있습니다.
heroku logs --tail
을 사용해 실시간으로 로그를 확인하면서 추가적인 오류가 있는지 찾아보세요.
- 여전히 문제가 해결되지 않는 경우, 추가 로그를 확인해 더 많은 힌트를 얻을 수 있습니다.
이 단계를 시도한 후에도 문제가 해결되지 않으면 알려주세요. 추가적인 문제 해결을 도와드리겠습니다.
PS C:\_Fractal Trail> git status
On branch master
nothing to commit, working tree clean
현재 git status
명령어에서 “nothing to commit, working tree clean” 메시지가 나타났으므로, 모든 변경 사항이 이미 커밋되어 있다는 의미입니다. 따라서 index.html
파일은 Git에 올바르게 커밋되었고, Heroku에도 푸시된 상태입니다. 그럼에도 여전히 Heroku에서 템플릿을 찾지 못하는 이유는 몇 가지 가능성이 있습니다.
- Heroku 배포 캐시 문제:
- Heroku의 캐시 때문에 변경 사항이 제대로 반영되지 않았을 수 있습니다. 이를 해결하기 위해 캐시를 무시하고 다시 배포해 볼 수 있습니다.
git commit --allow-empty -m "Trigger Heroku redeploy"
git push heroku main
디렉터리 구조 문제:
- 디렉터리 구조를 다시 확인해 보세요.
templates
폴더와 그 안의 파일들이 Heroku에서 접근할 수 있는 위치에 있는지 확인해야 합니다. 구조가 잘못되면 템플릿을 찾을 수 없습니다.
템플릿 파일 권한 문제:
- 파일 권한 문제로 인해 Heroku에서 템플릿을 읽지 못하는 경우도 있을 수 있습니다. 권한이 잘못 설정되었다면, 다음 명령어로 모든 파일 권한을 확인하고 수정하세요.
chmod -R 755 .
- Heroku 로그 추가 확인:
heroku logs --tail
명령어로 추가적인 오류나 힌트가 있는지 확인하세요. 특정 권한 문제나 접근 문제에 대한 추가적인 로그가 있을 수 있습니다.
위의 단계를 따라 진행해보시고, 문제가 해결되는지 확인해 주세요. 추가적인 로그가 있다면 다시 공유해 주시면 더 도와드릴 수 있습니다.
``` PS C:\_Fractal Trail> heroku logs --tail
2024-11-30T11:52:43.763078+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2024-11-30T11:52:43.763078+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-11-30T11:52:43.763079+00:00 app[web.1]: File "/app/app.py", line 32, in index
2024-11-30T11:52:43.763079+00:00 app[web.1]: return render_template('index.html')
2024-11-30T11:52:43.763079+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2024-11-30T11:52:43.763081+00:00 app[web.1]: ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2024-11-30T11:52:43.763082+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py",
line 1081, in get_or_select_template
2024-11-30T11:52:43.763082+00:00 app[web.1]: return self.get_template(template_name_or_list, parent, globals)
2024-11-30T11:52:43.763082+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py",
line 1010, in get_template
2024-11-30T11:52:43.763083+00:00 app[web.1]: return self._load_template(name, globals)
2024-11-30T11:52:43.763083+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py",
line 969, in _load_template
2024-11-30T11:52:43.763083+00:00 app[web.1]: template = self.loader.load(self, name, self.make_globals(globals))
2024-11-30T11:52:43.763083+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:52:43.763095+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:52:43.763095+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:52:43.763095+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:52:43.763095+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:52:43.763095+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:52:43.763095+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:52:43.763516+00:00 app[web.1]: 10.1.29.84 - - [30/Nov/2024:11:52:43 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:52:43.763887+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=e67b6b55-8bbb-4234-8cbc-e90e8053bc47 fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=500 bytes=463 protocol=https
2024-11-30T11:52:43.995783+00:00 app[web.1]: 10.1.29.84 - - [30/Nov/2024:11:52:43 +0000] "GET /favicon.ico HTTP/1.1" 404 232 "https://fractaltrail20241130-b723087de37d.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:52:43.996001+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=e1d42fd4-ed39-40a1-a211-96898bfca96f fwd="222.98.167.222" dyno=web.1 connect=0ms service=1ms status=404 bytes=393 protocol=https
2024-11-30T11:52:47.338294+00:00 app[web.1]: [2024-11-30 11:52:47,337] ERROR in app: Exception on / [GET]
2024-11-30T11:52:47.338304+00:00 app[web.1]: Traceback (most recent call last):
2024-11-30T11:52:47.338307+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
2024-11-30T11:52:47.338307+00:00 app[web.1]: response = self.full_dispatch_request()
2024-11-30T11:52:47.338307+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2024-11-30T11:52:47.338308+00:00 app[web.1]: rv = self.handle_user_exception(e)
2024-11-30T11:52:47.338308+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2024-11-30T11:52:47.338308+00:00 app[web.1]: rv = self.dispatch_request()
2024-11-30T11:52:47.338331+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2024-11-30T11:52:47.338331+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-11-30T11:52:47.338332+00:00 app[web.1]: File "/app/app.py", line 32, in index
2024-11-30T11:52:47.338332+00:00 app[web.1]: return render_template('index.html')
2024-11-30T11:52:47.338332+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2024-11-30T11:52:47.338333+00:00 app[web.1]: ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2024-11-30T11:52:47.338334+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py",
line 1081, in get_or_select_template
2024-11-30T11:52:47.338334+00:00 app[web.1]: return self.get_template(template_name_or_list, parent, globals)
2024-11-30T11:52:47.338334+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py",
line 1010, in get_template
2024-11-30T11:52:47.338335+00:00 app[web.1]: return self._load_template(name, globals)
2024-11-30T11:52:47.338335+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py",
line 969, in _load_template
2024-11-30T11:52:47.338335+00:00 app[web.1]: template = self.loader.load(self, name, self.make_globals(globals))
2024-11-30T11:52:47.338335+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:52:47.338335+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:52:47.338336+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:52:47.338336+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:52:47.338336+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:52:47.338336+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:52:47.338336+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:52:47.365664+00:00 app[web.1]: 10.1.29.84 - - [30/Nov/2024:11:52:47 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:52:47.366372+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=160dfef9-f0f6-454e-bf9b-cb5787be5cd1 fwd="222.98.167.222" dyno=web.1 connect=0ms service=30ms status=500
bytes=463 protocol=https
2024-11-30T11:52:47.666003+00:00 app[web.1]: 10.1.29.84 - - [30/Nov/2024:11:52:47 +0000] "GET /favicon.ico HTTP/1.1" 404 232 "https://fractaltrail20241130-b723087de37d.herokuapp.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:52:47.666361+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=2b3ba048-66bc-4d70-91c8-7c2a8e051b02 fwd="222.98.167.222" dyno=web.1 connect=1ms service=1ms status=404 bytes=393 protocol=https
2024-11-30T11:53:02.542301+00:00 heroku[web.1]: Restarting
2024-11-30T11:53:02.591483+00:00 heroku[web.1]: State changed from up to starting
2024-11-30T11:53:03.122931+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2024-11-30T11:53:03.145855+00:00 app[web.1]: [2024-11-30 11:53:03 +0000] [10] [INFO] Worker exiting (pid: 10)
2024-11-30T11:53:03.145872+00:00 app[web.1]: [2024-11-30 11:53:03 +0000] [2] [INFO] Handling signal: term
2024-11-30T11:53:03.145885+00:00 app[web.1]: [2024-11-30 11:53:03 +0000] [9] [INFO] Worker exiting (pid: 9)
2024-11-30T11:53:03.346366+00:00 app[web.1]: [2024-11-30 11:53:03 +0000] [2] [INFO] Shutting down: Master
2024-11-30T11:53:03.402634+00:00 heroku[web.1]: Process exited with status 0
2024-11-30T11:53:06.708741+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2024-11-30T11:53:07.443968+00:00 app[web.1]: Python buildpack: Detected 512 MB available memory and 8 CPU cores.
2024-11-30T11:53:07.443980+00:00 app[web.1]: Python buildpack: Defaulting WEB_CONCURRENCY to 2 based on the available memory.
2024-11-30T11:53:07.755658+00:00 app[web.1]: [2024-11-30 11:53:07 +0000] [2] [INFO] Starting gunicorn 20.1.0
2024-11-30T11:53:07.755997+00:00 app[web.1]: [2024-11-30 11:53:07 +0000] [2] [INFO] Listening at: http://0.0.0.0:55956 (2)
2024-11-30T11:53:07.756028+00:00 app[web.1]: [2024-11-30 11:53:07 +0000] [2] [INFO] Using worker: sync
2024-11-30T11:53:07.758632+00:00 app[web.1]: [2024-11-30 11:53:07 +0000] [9] [INFO] Booting worker with pid: 9
2024-11-30T11:53:07.828025+00:00 heroku[web.1]: State changed from starting to up
2024-11-30T11:53:07.850224+00:00 app[web.1]: [2024-11-30 11:53:07 +0000] [17] [INFO] Booting worker with pid: 17
2024-11-30T11:53:50.276742+00:00 app[web.1]: [2024-11-30 11:53:50,270] ERROR in app: Exception on / [GET]
2024-11-30T11:53:50.276756+00:00 app[web.1]: Traceback (most recent call last):
2024-11-30T11:53:50.276757+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
2024-11-30T11:53:50.276758+00:00 app[web.1]: response = self.full_dispatch_request()
2024-11-30T11:53:50.276759+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2024-11-30T11:53:50.276760+00:00 app[web.1]: rv = self.handle_user_exception(e)
2024-11-30T11:53:50.276760+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2024-11-30T11:53:50.276761+00:00 app[web.1]: rv = self.dispatch_request()
2024-11-30T11:53:50.276761+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2024-11-30T11:53:50.276761+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-11-30T11:53:50.276761+00:00 app[web.1]: File "/app/app.py", line 32, in index
2024-11-30T11:53:50.276762+00:00 app[web.1]: return render_template('index.html')
2024-11-30T11:53:50.276762+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2024-11-30T11:53:50.276763+00:00 app[web.1]: ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2024-11-30T11:53:50.276764+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
2024-11-30T11:53:50.276765+00:00 app[web.1]: return self.get_template(template_name_or_list, parent, globals)
2024-11-30T11:53:50.276765+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
2024-11-30T11:53:50.276765+00:00 app[web.1]: return self._load_template(name, globals)
2024-11-30T11:53:50.276765+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
2024-11-30T11:53:50.276766+00:00 app[web.1]: template = self.loader.load(self, name, self.make_globals(globals))
2024-11-30T11:53:50.276766+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2024-11-30T11:53:50.276766+00:00 app[web.1]: source, filename, uptodate = self.get_source(environment, name)
2024-11-30T11:53:50.276766+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2024-11-30T11:53:50.276767+00:00 app[web.1]: return self._get_source_fast(environment, template)
2024-11-30T11:53:50.276767+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2024-11-30T11:53:50.276767+00:00 app[web.1]: raise TemplateNotFound(template)
2024-11-30T11:53:50.276767+00:00 app[web.1]: jinja2.exceptions.TemplateNotFound: index.html
2024-11-30T11:53:50.323199+00:00 app[web.1]: 10.1.86.240 - - [30/Nov/2024:11:53:50 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
2024-11-30T11:53:50.323227+00:00 heroku[router]: at=info method=GET path="/" host=fractaltrail20241130-b723087de37d.herokuapp.com request_id=226f6765-9a5f-41f3-a293-8f0e066ec225 fwd="222.98.167.222" dyno=web.1 connect=0ms service=53ms status=500 bytes=463 protocol=https ```
Heroku 로그에서 jinja2.exceptions.TemplateNotFound: index.html
오류가 계속 발생하고 있습니다. 이 문제의 해결을 위해 다음을 확인해보세요:
templates
디렉터리의 위치 확인:index.html
파일이templates
디렉터리 안에 있는지 다시 한 번 확인해주세요. 디렉터리 구조가 정확해야 Flask가 템플릿을 찾을 수 있습니다.
- Git 상태 확인 후 다시 푸시:
templates/index.html
이 Git에서 추적되고 있는지 확인하고, Heroku에 푸시하는 과정에서 파일이 누락되지 않도록 해야 합니다.- 다음 명령어를 통해
templates/index.html
을 Git에 추가하고 커밋한 뒤, Heroku에 다시 푸시해보세요.
git add templates/index.html templates/result.html
git commit -m "Add index.html and result.html to templates directory"
git push heroku master
템플릿 캐시 문제:
- 가끔 Heroku 배포에서 캐시 문제로 인해 파일 업데이트가 반영되지 않을 수 있습니다. 캐시를 무시하고 다시 배포하도록 아래 명령어를 사용할 수 있습니다.
git commit --allow-empty -m "Trigger Heroku redeploy"
git push heroku master
이 단계를 수행한 후 다시 Heroku 로그를 확인해보세요. 여전히 문제가 있다면 추가적인 로그를 공유해주시면 더 도와드릴 수 있습니다.