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

Template Not Found error on upgrading Re:dash #1200

Closed
kchhina opened this issue Jul 21, 2016 · 12 comments
Closed

Template Not Found error on upgrading Re:dash #1200

kchhina opened this issue Jul 21, 2016 · 12 comments

Comments

@kchhina
Copy link

kchhina commented Jul 21, 2016

Issue Summary

Upgrading Re:dash throws TemplateNotFound error

Steps to Reproduce

  1. Followed the upgrade steps mentioned in the manual. Upgraded from 0.9 to 0.11.0.b2016
  2. Restarted using the redash_supervisord command
  3. Re:dash gives a 500 Internal error. On looking at api_error.log, I get this error:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask_restful/init.py", line 271, in error_router
return original_handler(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 792, in decorated_view
return func(_args, *_kwargs)
File "/opt/redash/redash.0.11.0.b2016/redash/handlers/static.py", line 60, in index
client_config=json.dumps(client_config))
File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 127, in render_template
return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 851, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 812, in get_template
return self._load_template(name, self.make_globals(globals))
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 774, in _load_template
cache_key = self.loader.get_source(self, name)[1]
File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 64, in get_source
raise TemplateNotFound(template)
TemplateNotFound: index.html

Technical details:

  • Redash Version: 0.11.0.b2016
  • Browser/OS: Chrome / Mac
  • How did you install Redash: Amazon EC2 instance
@arikfr
Copy link
Member

arikfr commented Jul 24, 2016

Does the /opt/redash/current/rd_ui/dist folder exist on your server?

@shaneog
Copy link

shaneog commented Jul 25, 2016

I have the same error. I started with the GCE image and ran the fabfile upgrade script.
The folder /opt/redash/current/rd_ui/dist does exist on my server.

@arikfr
Copy link
Member

arikfr commented Jul 27, 2016

And /opt/redash/current/rd_ui/dist/index.html exists?

@shaneog
Copy link

shaneog commented Jul 27, 2016

Sorry @arikfr, I killed it and stopped trying to Re:dash to work.
If I have time in the next few days I'll try to start again and I'll update if I still have issues.

@arikfr
Copy link
Member

arikfr commented Aug 23, 2016

Closing due to lack of feedback.

@arikfr arikfr closed this as completed Aug 23, 2016
@JAINMANISH512
Copy link

same error And /opt/redash/current/rd_ui/dist/index.html exists

@arikfr
Copy link
Member

arikfr commented Aug 26, 2016

If you get this error and the file exists, it might be that it loads wrong config for some reason. I recommend killing all Redash related processes (grep for redash in process list) and the run sudo /etc/init.d/supervisord_redash restart.

@JAINMANISH512
Copy link

I have tried that but the issue holds

@44px
Copy link
Contributor

44px commented Nov 30, 2016

Hello.

I have same problem.

My setup:
Vagrant box ubuntu/trusty64 updated to latest version, with 2Gb memory.
Redash installed using provisioning script from this page: https://redash.io/help-onpremise/setup/setting-up-redash-instance.html
Updated to 0.12.0.b2449 using fabric script from this page https://redash.io/help-onpremise/maintenance/how-to-upgrade-redash.html (but I had this problem on 0.11 also)

Here are exception from logs:

==> /opt/redash/logs/api_error.log <==
[2016-11-30 21:27:05,604][PID:26579][ERROR][redash] Exception on /login [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/redash/redash.0.12.0.b2449/redash/handlers/authentication.py", line 120, in login
    show_remote_user_login=settings.REMOTE_USER_LOGIN_ENABLED)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 127, in render_template
    return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 851, in get_or_select_template
    return self.get_template(template_name_or_list, parent, globals)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 812, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 774, in _load_template
    cache_key = self.loader.get_source(self, name)[1]
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 64, in get_source
    raise TemplateNotFound(template)
TemplateNotFound: login.html
[2016-11-30 21:27:05,606][PID:26579][INFO][metrics] method=GET path=/login endpoint=redash.login status=500 content_type=? content_length=-1 duration=5.58 query_count=0 query_duration=0.00

index.html on its place:

vagrant@vagrant-ubuntu-trusty-64:~$ ll /opt/redash/current/rd_ui/dist/
total 84
drwxrwxr-x  7 ubuntu ubuntu  4096 Nov 20 08:59 ./
drwxrwxr-x  4 ubuntu ubuntu  4096 Nov 20 08:58 ../
-rw-rw-r--  1 ubuntu ubuntu  2408 Nov 20 08:59 app_layout.html
-rw-rw-r--  1 ubuntu ubuntu  1394 Nov 20 08:59 embed.html
-rwxrwxr-x  1 ubuntu ubuntu  1150 Nov 20 08:58 favicon.ico*
drwxrwxr-x  3 ubuntu ubuntu  4096 Nov 20 08:58 fonts/
-rw-rw-r--  1 ubuntu ubuntu 18254 Nov 20 08:58 google_login.png
drwxrwxr-x  2 ubuntu ubuntu  4096 Nov 20 08:59 images/
-rw-rw-r--  1 ubuntu ubuntu   188 Nov 20 08:59 index.html
-rw-rw-r--  1 ubuntu ubuntu  1762 Nov 20 08:59 login.html
-rw-rw-r--  1 ubuntu ubuntu   399 Nov 20 08:59 public.html
-rw-rw-r--  1 ubuntu ubuntu    31 Nov 20 08:58 robots.txt
drwxrwxr-x  2 ubuntu ubuntu  4096 Nov 20 08:59 scripts/
-rw-rw-r--  1 ubuntu ubuntu  1496 Nov 20 08:59 signed_out_layout.html
drwxrwxr-x  3 ubuntu ubuntu  4096 Nov 20 08:59 styles/
-rw-rw-r--  1 ubuntu ubuntu    53 Nov 20 08:59 vendor_scripts.html
drwxrwxr-x 12 ubuntu ubuntu  4096 Nov 20 08:58 views/

I tried:
sudo supervisorctl restart all
killed all processes with redash in name

What can I try else?

@arikfr
Copy link
Member

arikfr commented Dec 1, 2016

@44px Add this line: export REDASH_STATIC_ASSETS_PATH="../rd_ui/dist/" to /opt/redash/.env and then restart everything again.

@44px
Copy link
Contributor

44px commented Dec 1, 2016

@arikfr, yes, it helps. Thank you!

Maybe it should be added by default to .env by provisioning script?

@ranonah
Copy link

ranonah commented Dec 1, 2016

thanks @arikfr finally what i need just to add that line on .env
so stress before try to install on all ubuntu12, ubuntu 14 but have same result all day long hahahah...
Thanks!

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

6 participants