Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Find index.html file on Running Application through Docker Compose Up #40

Open
xamelion opened this issue Apr 6, 2023 · 4 comments

Comments

@xamelion
Copy link

xamelion commented Apr 6, 2023

Problem Description

Upon running the application through docker compose up, the application is unable to find the index.html file. The following traceback error is generated:

alpaca-turbo-alpaca-1  | Traceback (most recent call last):
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2551, in __call__
alpaca-turbo-alpaca-1  |     return self.wsgi_app(environ, start_response)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask_socketio/__init__.py", line 43, in __call__
alpaca-turbo-alpaca-1  |     return super(_SocketIOMiddleware, self).__call__(environ,
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/engineio/middleware.py", line 74, in __call__
alpaca-turbo-alpaca-1  |     return self.wsgi_app(environ, start_response)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2531, in wsgi_app
alpaca-turbo-alpaca-1  |     response = self.handle_exception(e)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
alpaca-turbo-alpaca-1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app
alpaca-turbo-alpaca-1  |     response = self.full_dispatch_request()
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request
alpaca-turbo-alpaca-1  |     rv = self.handle_user_exception(e)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
alpaca-turbo-alpaca-1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
alpaca-turbo-alpaca-1  |     rv = self.dispatch_request()
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
alpaca-turbo-alpaca-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
alpaca-turbo-alpaca-1  |   File "/app/api.py", line 218, in index
alpaca-turbo-alpaca-1  |     return render_template("index.html")
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 146, in render_template
alpaca-turbo-alpaca-1  |     template = app.jinja_env.get_or_select_template(template_name_or_list)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
alpaca-turbo-alpaca-1  |     return self.get_template(template_name_or_list, parent, globals)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1010, in get_template
alpaca-turbo-alpaca-1  |     return self._load_template(name, globals)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 969, in _load_template
alpaca-turbo-alpaca-1  |     template = self.loader.load(self, name, self.make_globals(globals))
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/jinja2/loaders.py", line 126, in load
alpaca-turbo-alpaca-1  |     source, filename, uptodate = self.get_source(environment, name)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 62, in get_source
alpaca-turbo-alpaca-1  |     return self._get_source_fast(environment, template)
alpaca-turbo-alpaca-1  |   File "/usr/local/lib/python3.8/site-packages/flask/templating.py", line 98, in _get_source_fast
alpaca-turbo-alpaca-1  |     raise TemplateNotFound(template)
alpaca-turbo-alpaca-1  | jinja2.exceptions.TemplateNotFound: index.html

Solution

The issue is caused by the application's inability to locate the index.html file. To resolve this issue, please ensure that the index.html file is located in the correct file path and is accessible by the application.

@ViperX7
Copy link
Owner

ViperX7 commented Apr 6, 2023

did you clone the git repo

@berts83231
Copy link

I had the same issue. But then saw I need to download the zip instead of clone the repo directly.

@TheStoneMX
Copy link

please help, does not for me,

"ensure that the index.html file is located in the correct file path and is accessible by the application."

please explain, as it is located on :

\wsl.localhost\Ubuntu-22.04\home\orangel\alpaca-turbo\Alpaca-Turbo-main\gradio_impl\templates\index.html

Thanks!

@espressoelf
Copy link

espressoelf commented Apr 15, 2023

@TheStoneMX You're not supposed to clone the repository. Download the latest release zip instead.

The expected path is templates\index.html and not gradio_impl\templates\index.html

See #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants