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

Navigating to tablemodelview from the Welcome screen causes Superset app to crash hard #2525

Closed
3 tasks done
ErikThoreson opened this issue Mar 30, 2017 · 9 comments
Closed
3 tasks done

Comments

@ErikThoreson
Copy link

ErikThoreson commented Mar 30, 2017

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.17.2

Expected results

Expected to be able to see from navigating from the welcome page
http://superset.local/tablemodelview/list/

Actual results

Superset Container crashes and 502 Gateway error returned from k8s ingress nginx proxy

Steps to reproduce

  1. Run Superset within Minikube or prod like Kubernetes with latest 0.17.2 docker image
  2. Expose Superset with Kubernetes ingress controller
  3. Set ENABLE_PROXY_FIX = True in superset_config.py
  4. Add at least 1 NEW datasource to /databaseview/list/
  5. Close browser clear cookies
  6. Log back in to superset
  7. From the Welcome page select Sources > Tables
  8. NGINX will throw a 502 bad gateway message and the pod/container with K8s will crash / restart

ADDITIONAL INFO:
Python stacktrace literally shows nothing before the crash. The container/process fails hard and kubernetes immediately restarts the container.

If I navigate to the tablemodelview from the databseview or the slicesview there is no crash.

Stack trace with DEBUG = TRUE and SILENCE_FAB = FALSE

$ kubectl logs superset-deployment -c superset
2017-03-30 03:17:25,229:DEBUG:flask_appbuilder.security.manager:OAuth providers init github
2017-03-30 03:17:25,417:INFO:flask_appbuilder.base:Registering class MyIndexView on menu 
2017-03-30 03:17:25,422:INFO:flask_appbuilder.base:Registering class UtilView on menu 
2017-03-30 03:17:25,425:INFO:flask_appbuilder.base:Registering class LocaleView on menu 
2017-03-30 03:17:25,429:INFO:flask_appbuilder.base:Registering class MyRegisterUserOAuthView on menu 
2017-03-30 03:17:25,433:INFO:flask_appbuilder.base:Registering class ResetPasswordView on menu 
2017-03-30 03:17:25,521:INFO:flask_appbuilder.base:Registering class ResetMyPasswordView on menu 
2017-03-30 03:17:25,534:INFO:flask_appbuilder.base:Registering class UserInfoEditView on menu 
2017-03-30 03:17:25,618:INFO:flask_appbuilder.base:Registering class AuthOAuthView on menu 
2017-03-30 03:17:25,627:INFO:flask_appbuilder.base:Registering class UserOAuthModelView on menu List Users
2017-03-30 03:17:25,737:INFO:flask_appbuilder.base:Registering class RoleModelView on menu List Roles
2017-03-30 03:17:25,917:INFO:flask_appbuilder.base:Registering class UserStatsChartView on menu User's Statistics
2017-03-30 03:17:25,943:INFO:flask_appbuilder.base:Registering class RegisterUserModelView on menu User's Statistics
2017-03-30 03:17:26,118:INFO:flask_appbuilder.base:Registering class PermissionModelView on menu Base Permissions
2017-03-30 03:17:26,222:INFO:flask_appbuilder.base:Registering class ViewMenuModelView on menu Views/Menus
2017-03-30 03:17:26,323:INFO:flask_appbuilder.base:Registering class PermissionViewModelView on menu Permission on Views/Menus
2017-03-30 03:17:29,935:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-03-30 03:17:29,938:INFO:flask_appbuilder.base:Registering class DatabaseView on menu Databases
2017-03-30 03:17:30,125:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-03-30 03:17:30,129:INFO:flask_appbuilder.base:Registering class DatabaseAsync on menu 
2017-03-30 03:17:30,230:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-03-30 03:17:30,233:INFO:flask_appbuilder.base:Registering class DatabaseTablesAsync on menu 
2017-03-30 03:17:30,337:INFO:flask_appbuilder.base:Registering class AccessRequestsModelView on menu Access requests
2017-03-30 03:17:30,529:INFO:flask_appbuilder.base:Registering class SliceModelView on menu Slices
2017-03-30 03:17:30,640:INFO:flask_appbuilder.base:Registering class SliceAsync on menu 
2017-03-30 03:17:30,817:INFO:flask_appbuilder.base:Registering class SliceAddView on menu 
2017-03-30 03:17:30,918:INFO:flask_appbuilder.base:Registering class DashboardModelView on menu Dashboards
2017-03-30 03:17:31,028:INFO:flask_appbuilder.base:Registering class DashboardModelViewAsync on menu 
2017-03-30 03:17:31,131:INFO:flask_appbuilder.base:Registering class LogModelView on menu Action Log
2017-03-30 03:17:31,241:INFO:flask_appbuilder.base:Registering class QueryView on menu Queries
2017-03-30 03:17:31,420:INFO:flask_appbuilder.base:Registering class KV on menu 
2017-03-30 03:17:31,425:INFO:flask_appbuilder.base:Registering class R on menu 
2017-03-30 03:17:31,430:INFO:flask_appbuilder.base:Registering class Superset on menu 
2017-03-30 03:17:31,723:INFO:flask_appbuilder.base:Registering class CssTemplateModelView on menu CSS Templates
2017-03-30 03:17:31,835:INFO:flask_appbuilder.base:Registering class CssTemplateAsyncModelView on menu 
2017-03-30 03:17:32,125:INFO:flask_appbuilder.base:Registering class TableColumnInlineView on menu 
2017-03-30 03:17:32,227:INFO:flask_appbuilder.base:Registering class SqlMetricInlineView on menu 
2017-03-30 03:17:32,329:INFO:flask_appbuilder.base:Registering class TableModelView on menu Tables
2017-03-30 03:17:32,939:INFO:flask_appbuilder.base:Registering class DruidColumnInlineView on menu 
2017-03-30 03:17:33,042:INFO:flask_appbuilder.base:Registering class DruidMetricInlineView on menu 
2017-03-30 03:17:33,142:INFO:flask_appbuilder.base:Registering class DruidClusterModelView on menu Druid Clusters
2017-03-30 03:17:33,328:INFO:flask_appbuilder.base:Registering class DruidDatasourceModelView on menu Druid Datasources
2017-03-30 03:17:33,437:INFO:flask_appbuilder.base:Registering class Druid on menu 
2017-03-30 03:17:33,722:INFO:werkzeug: * Running on http://0.0.0.0:8088/ (Press CTRL+C to quit)
2017-03-30 03:17:50,696:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:17:50] "GET /health HTTP/1.1" 200 -
2017-03-30 03:18:20,738:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:18:20] "GET /health HTTP/1.1" 200 -
2017-03-30 03:18:37,777:INFO:werkzeug:192.168.2.0 - - [30/Mar/2017 03:18:37] "GET / HTTP/1.1" 302 -
2017-03-30 03:18:38,438:INFO:werkzeug:192.168.2.0 - - [30/Mar/2017 03:18:38] "GET /superset/welcome HTTP/1.1" 200 -
/usr/lib/python3.5/site-packages/sqlalchemy/sql/compiler.py:624: SAWarning: Can't resolve label reference 'changed_on desc'; converting to text() (this warning may be suppressed after 10 occurrences)
  util.ellipses_string(element.element))
2017-03-30 03:18:39,227:INFO:werkzeug:192.168.2.0 - - [30/Mar/2017 03:18:39] "GET /dashboardmodelviewasync/api/read?_oc_DashboardModelViewAsync=changed_on&_od_DashboardModelViewAsync=desc HTTP/1.1" 200 -
2017-03-30 03:18:50,776:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:18:50] "GET /health HTTP/1.1" 200 -
2017-03-30 03:19:20,825:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:19:20] "GET /health HTTP/1.1" 200 -
2017-03-30 03:19:50,865:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:19:50] "GET /health HTTP/1.1" 200 -
2017-03-30 03:20:20,912:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:20:20] "GET /health HTTP/1.1" 200 -
2017-03-30 03:20:50,956:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:20:50] "GET /health HTTP/1.1" 200 -
2017-03-30 03:21:20,997:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:21:20] "GET /health HTTP/1.1" 200 -
2017-03-30 03:21:51,043:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:21:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:22:21,081:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:22:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:22:51,121:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:22:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:23:21,162:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:23:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:23:51,201:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:23:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:24:21,246:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:24:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:24:51,287:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:24:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:25:21,334:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:25:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:25:51,376:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:25:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:26:21,415:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:26:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:26:51,461:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:26:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:27:21,504:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:27:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:27:51,546:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:27:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:28:21,586:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:28:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:28:51,634:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:28:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:29:21,677:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:29:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:29:51,716:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:29:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:30:21,757:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:30:21] "GET /health HTTP/1.1" 200 -
2017-03-30 03:30:51,799:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:30:51] "GET /health HTTP/1.1" 200 -
2017-03-30 03:31:21,843:INFO:werkzeug:127.0.0.1 - - [30/Mar/2017 03:31:21] "GET /health HTTP/1.1" 200 -
$ kubectl logs --previous superset-deployment -c superset
2017-03-30 03:16:39,733:DEBUG:flask_appbuilder.security.manager:OAuth providers init github
2017-03-30 03:16:39,921:INFO:flask_appbuilder.base:Registering class MyIndexView on menu 
2017-03-30 03:16:39,926:INFO:flask_appbuilder.base:Registering class UtilView on menu 
2017-03-30 03:16:39,929:INFO:flask_appbuilder.base:Registering class LocaleView on menu 
2017-03-30 03:16:39,933:INFO:flask_appbuilder.base:Registering class MyRegisterUserOAuthView on menu 
2017-03-30 03:16:39,937:INFO:flask_appbuilder.base:Registering class ResetPasswordView on menu 
2017-03-30 03:16:40,024:INFO:flask_appbuilder.base:Registering class ResetMyPasswordView on menu 
2017-03-30 03:16:40,036:INFO:flask_appbuilder.base:Registering class UserInfoEditView on menu 
2017-03-30 03:16:40,119:INFO:flask_appbuilder.base:Registering class AuthOAuthView on menu 
2017-03-30 03:16:40,128:INFO:flask_appbuilder.base:Registering class UserOAuthModelView on menu List Users
2017-03-30 03:16:40,240:INFO:flask_appbuilder.base:Registering class RoleModelView on menu List Roles
2017-03-30 03:16:40,422:INFO:flask_appbuilder.base:Registering class UserStatsChartView on menu User's Statistics
2017-03-30 03:16:40,521:INFO:flask_appbuilder.base:Registering class RegisterUserModelView on menu User's Statistics
2017-03-30 03:16:40,626:INFO:flask_appbuilder.base:Registering class PermissionModelView on menu Base Permissions
2017-03-30 03:16:40,728:INFO:flask_appbuilder.base:Registering class ViewMenuModelView on menu Views/Menus
2017-03-30 03:16:40,831:INFO:flask_appbuilder.base:Registering class PermissionViewModelView on menu Permission on Views/Menus
2017-03-30 03:16:44,434:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-03-30 03:16:44,438:INFO:flask_appbuilder.base:Registering class DatabaseView on menu Databases
2017-03-30 03:16:44,625:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-03-30 03:16:44,629:INFO:flask_appbuilder.base:Registering class DatabaseAsync on menu 
2017-03-30 03:16:44,726:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-03-30 03:16:44,729:INFO:flask_appbuilder.base:Registering class DatabaseTablesAsync on menu 
2017-03-30 03:16:44,829:INFO:flask_appbuilder.base:Registering class AccessRequestsModelView on menu Access requests
2017-03-30 03:16:44,942:INFO:flask_appbuilder.base:Registering class SliceModelView on menu Slices
2017-03-30 03:16:45,119:INFO:flask_appbuilder.base:Registering class SliceAsync on menu 
2017-03-30 03:16:45,219:INFO:flask_appbuilder.base:Registering class SliceAddView on menu 
2017-03-30 03:16:45,318:INFO:flask_appbuilder.base:Registering class DashboardModelView on menu Dashboards
2017-03-30 03:16:45,426:INFO:flask_appbuilder.base:Registering class DashboardModelViewAsync on menu 
2017-03-30 03:16:45,527:INFO:flask_appbuilder.base:Registering class LogModelView on menu Action Log
2017-03-30 03:16:45,639:INFO:flask_appbuilder.base:Registering class QueryView on menu Queries
2017-03-30 03:16:45,819:INFO:flask_appbuilder.base:Registering class KV on menu 
2017-03-30 03:16:45,823:INFO:flask_appbuilder.base:Registering class R on menu 
2017-03-30 03:16:45,828:INFO:flask_appbuilder.base:Registering class Superset on menu 
2017-03-30 03:16:46,120:INFO:flask_appbuilder.base:Registering class CssTemplateModelView on menu CSS Templates
2017-03-30 03:16:46,230:INFO:flask_appbuilder.base:Registering class CssTemplateAsyncModelView on menu 
2017-03-30 03:16:46,519:INFO:flask_appbuilder.base:Registering class TableColumnInlineView on menu 
2017-03-30 03:16:46,621:INFO:flask_appbuilder.base:Registering class SqlMetricInlineView on menu 
2017-03-30 03:16:46,723:INFO:flask_appbuilder.base:Registering class TableModelView on menu Tables
2017-03-30 03:16:47,337:INFO:flask_appbuilder.base:Registering class DruidColumnInlineView on menu 
2017-03-30 03:16:47,440:INFO:flask_appbuilder.base:Registering class DruidMetricInlineView on menu 
2017-03-30 03:16:47,540:INFO:flask_appbuilder.base:Registering class DruidClusterModelView on menu Druid Clusters
2017-03-30 03:16:47,726:INFO:flask_appbuilder.base:Registering class DruidDatasourceModelView on menu Druid Datasources
2017-03-30 03:16:47,838:INFO:flask_appbuilder.base:Registering class Druid on menu 
2017-03-30 03:16:48,127:INFO:werkzeug: * Running on http://0.0.0.0:8088/ (Press CTRL+C to quit)
@xrmx
Copy link
Contributor

xrmx commented Mar 30, 2017

Where's the stacktrace? Without it there's no crash.

@ErikThoreson
Copy link
Author

those were the only logs I could get while following the container as it dies. Its very similar to the two issues below but localized to a single page and only when the proxy fix is enabled.

#462
dpgaspar/Flask-AppBuilder#322

@ErikThoreson
Copy link
Author

hello, has anyone been able to check this one out? i see it was flagged and then un-flagged. I can share minikube instructions if you are interested.

thanks.

@ErikThoreson
Copy link
Author

I do have some additional information on the issue. the /queryview/list page has the same problem. as the tablemodelview page.

Also, interestingly if I FIRST go to the /databaseview/list page, then go to the /tablemodelview/list or the /queryview/list page it WONT crash.

I suspect the some session information isn't getting passed properly to these views like they are with the databaseview, slices.

@ErikThoreson
Copy link
Author

ErikThoreson commented Apr 11, 2017

More information:

I can now reproduce this without PROXYFIX enabled or behind an NGINX proxy.

It can be reproduced with ANY additional middleware passed in from superset_config.py.

My example:

class MyMiddleware(object):
    def __init__(self, app):
        self.app = app
    def __call__(self, environ, start_response):
        return self.app(environ, start_response)

ADDITIONAL_MIDDLEWARE = [MyMiddleware]

@mistercrunch
Copy link
Member

You need to provide a stack trace or a paste of the Flask debug page

@ErikThoreson
Copy link
Author

@mistercrunch sorry. The log above is the full output from the debug. No stack trace is produced. The process just dies after that last line.

@ErikThoreson
Copy link
Author

@mistercrunch I've got it to stop... finally. And only by trial and error. I could not get any better logging to show up. Would love some logging tips, I'm capturing everything from stdout which appears to be the normal debug and flask messages.

Anyhow, I've been using the community docker file for superset here:
https://github.com/amancevice/superset

This runs a python at version 3.6. Looks like most of the QA for superset is done on 3.4 and 3.5.

So, I built my own using alpine 3.5... and boom... it no longer crashes when going to those views with middleware enabled.

Here is the resultant dockerfile:

FROM python:3.5-alpine

# Install
ENV SUPERSET_VERSION 0.17.0
RUN apk add --no-cache \
        curl \
        g++ \
        python-dev \
        libffi-dev \
        cyrus-sasl-dev \
        mariadb-dev \
        postgresql-dev && \
    ln -s /usr/include/locale.h /usr/include/xlocale.h && \
    pip3 install cython==0.25.2 numpy==1.12.0 && \
    pip3 install pandas==0.18.1 && \
    pip3 install \
        superset==$SUPERSET_VERSION \
        psycopg2==2.6.1 \
        redis==2.10.5 \
        sqlalchemy-redshift==0.5.0 \
        flask-oauth==0.12 \
        flask_oauthlib==0.9.3 \
        flask-mail==0.9.1

# Default config
ENV LANG=C.UTF-8 \
    LC_ALL=C.UTF-8 \
    PATH=$PATH:/home/superset/.bin \
    PYTHONPATH=/home/superset/superset_config.py:$PYTHONPATH

WORKDIR /home/superset
COPY superset .

# Deploy
EXPOSE 8088
HEALTHCHECK CMD ["curl", "-f", "http://localhost:8088/health"]
ENTRYPOINT ["superset"]
CMD ["runserver"]

@mistercrunch
Copy link
Member

Glad you got through this.

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

3 participants