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

tablemodelview 404 errors #462

Closed
alanmcruickshank opened this issue May 12, 2016 · 3 comments
Closed

tablemodelview 404 errors #462

alanmcruickshank opened this issue May 12, 2016 · 3 comments

Comments

@alanmcruickshank
Copy link
Contributor

I'm getting 404 errors on the tablemodelview edit and show pages (routes: /tablemodelview/show/xxx and /tablemodelview/edit/xxx). The list menu works fine. This the second time I've had this issue, the first time being several weeks ago and that time I only solved by wiping the config database and starting again.

The tables themselves continue to work in slices and I can still add and remove tables.

All tables are affected (regardless of datasource - I have two datasources set up, one MySQL and one Postgres), also regardless of whether they were created before or after the error started occuring.

In my deployment I run caravel inside a docker container and I'm on caravel 0.8.9. My production deployment shows this issue, however if I run locally I don't have the issue (they both point at the same configuration DB). I've run both the dev server and gunicorn locally and both are fine. Restarting the production server has no effect, likewise aws ecr get-login

Looking at the logs for our production version all I see is a worker timeout:
[2016-05-12 11:27:25 +0000] [10] [CRITICAL] WORKER TIMEOUT (pid:129) [2016-05-12 11:27:25 +0000] [129] [INFO] Worker exiting (pid: 129)

If I switch to the debug server in production it still doesn't work and I get this message when loading the tablemodelview/list view:
/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py:575: SAWarning: Can't resolve label reference u'changed_on desc'; converting to text() (this warning may be suppressed after 10 occurrences) util.ellipses_string(element.element)) /usr/local/lib/python2.7/site-packages/flask_appbuilder/fields.py:98: UserWarning: allow_blank=True does not do anything for QuerySelectMultipleField. warnings.warn('allow_blank=True does not do anything for QuerySelectMultipleField.')

@x4base
Copy link
Contributor

x4base commented May 12, 2016

I have a similar problem, not sure, but I guess it's the same problem.

Instead of TableView, my problem is on DruidDatasourceModelView: when I access /druiddatasourcemodelview/edit/5, it's always 404, when datasource with id 5 actually really exists.
After I traced the code, I figured out the cause: DruidMetricInlineView is one of the related views of DruidDatasourceModelView, when DruidMetricInlineView is rendered, its related views must be rendered as well. So the 404 error is not thrown when searching for the datasource, it's thrown when finding the DruidMetricInlineView. Flask AppBuilder wants to find a DruidMetricInlineView with id=93 according to one of the variable in the (probably cookie-based) session, but that record is actually deleted. So there is no chance to clean that variable in the session. I think it is a bad design of Flask AppBuilder to let the page to be dependent on the session, I would expect those information to be passed by the query string.
You can check whether your problem is the same as mine by checking whether there has been any deleted record in TableColumnInlineView or SqlMetricInlineView (both are related views of TableModelView). Or you can simply try cleaning the cookie in the browser.

But in the long term, there should be some way to fix this problem either by improving the design of caravel or Flask AppBuilder. It really harms the user experience for it's so confusing when the page is dependent on the session rather than the url.

@mistercrunch
Copy link
Member

Yes, it's a Flask App Builder bug that we should tackle in that code base. In the meantime the workaround is to clear your cookies for this domain.

@xrmx
Copy link
Contributor

xrmx commented Aug 9, 2016

Looks like it has been fixed already, closing.

@xrmx xrmx closed this as completed Aug 9, 2016
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
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

4 participants