superset icon indicating copy to clipboard operation
superset copied to clipboard

an error when upgrade from caravel to superset. Pls help!

Open xiaoidea opened this issue 9 years ago • 10 comments

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.16.0

Expected results

show my slices

Actual results

500 - Internal Server Error

Steps to reproduce

  1. upgrade from caravel to superset 0.16.0
  2. use same SQLALCHEMY_DATABASE_URI(postgresql)
  3. db upgrade
  4. when I click 'Slices' menu, the error happens:
[2017-03-23 20:53:49,430] ERROR in app: Exception on /slicemodelview/list/ [GET]
Traceback (most recent call last):
  File "/home/www/superset/superset/utils.py", line 107, in __call__
    return self.cache[args]
KeyError: (5min order create test,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/www/ENV/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/www/ENV/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
psycopg2.ProgrammingError: column datasources.filter_select_enabled does not exist
LINE 1: ..., datasources.is_hidden AS datasources_is_hidden, datasource...


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/www/ENV/lib/python3.4/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/www/ENV/lib/python3.4/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/www/ENV/lib/python3.4/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/www/ENV/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/www/ENV/lib/python3.4/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/www/ENV/lib/python3.4/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/www/ENV/lib/python3.4/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
    return f(self, *args, **kwargs)
  File "/home/www/ENV/lib/python3.4/site-packages/flask_appbuilder/views.py", line 453, in list
    widgets=widgets)
...

xiaoidea avatar Mar 23 '17 13:03 xiaoidea

Reproduce with latest release please

xrmx avatar Mar 23 '17 13:03 xrmx

@xrmx ,thanks for your reply! I just tried version 0.17.1 and I encounter the same error, it seems there's some problem with db table . when I run superset db upgrade ,there is nothing wrong. when I run superset init , the following error happens:

Traceback (most recent call last):
  File "/home/www/ENV/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/home/www/ENV/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
psycopg2.ProgrammingError: column dbs.expose_in_sqllab does not exist
LINE 1: ...create_table_as AS dbs_select_as_create_table_as, dbs.expose...
                                                             ^


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/www/ENV/bin/superset", line 4, in <module>
    __import__('pkg_resources').run_script('superset==0.16.0rc3', 'superset')
  File "/home/www/ENV/lib/python3.4/site-packages/pkg_resources/__init__.py", line 738, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/www/ENV/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1499, in run_script
    exec(code, namespace, namespace)
  File "/home/www/ENV/lib/python3.4/site-packages/superset-0.16.0rc3-py3.4.egg/EGG-INFO/scripts/superset", line 15, in <module>
    manager.run()
  File "/home/www/ENV/lib/python3.4/site-packages/flask_script/__init__.py", line 412, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/home/www/ENV/lib/python3.4/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/home/www/ENV/lib/python3.4/site-packages/flask_script/commands.py", line 216, in __call__

xiaoidea avatar Mar 23 '17 13:03 xiaoidea

Looks like you are not using 0.17.1:

    __import__('pkg_resources').run_script('superset==0.16.0rc3', 'superset')

xrmx avatar Mar 23 '17 13:03 xrmx

I'm sorry, but when I installed v0.17.1 and run superset db upgrade, it tells me no No script named 'superset

Traceback (most recent call last):
  File "/home/www/env/bin/superset", line 4, in <module>
    __import__('pkg_resources').run_script('superset==0.17.1', 'superset')
  File "/home/www/env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 738, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/www/env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1491, in run_script
    raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'superset'

xiaoidea avatar Mar 23 '17 16:03 xiaoidea

@xrmx I find the reason lead to the crash of my superset. it does not take effect when I run superset db upgrade to upgrade from caravel to superset! the first pic is the structure of table dbs after upgrade from caravel, it lacks several columns compared to the ideal structure of table dbs of superset shows in the second pic. superset_true superset_real it is strange that there is't any wrong message when I run superset db upgrade So, why?

xiaoidea avatar Mar 24 '17 02:03 xiaoidea

@xiaoidea are you pointing to the same db?

xrmx avatar Mar 24 '17 08:03 xrmx

No, they are on different machine, although they have same name 'superset' @xrmx I mean , the second one is the right structure I want, while my data is in the first DB, but the table structure does not satisfy superset(after I run superset db upgrade)

xiaoidea avatar Mar 24 '17 08:03 xiaoidea

@xiaoidea are you sure that when you are doing superset db upgrade you are pointing to the db with caravel installed?

xrmx avatar Mar 24 '17 08:03 xrmx

May be due to my misuse of db upgrade, the version_num in alembic_version is chaotic now, the table structure cann't correspond to the version_num , anyway, is there any method to transfer my data in caravel to superset while db upgrade not make sense?

xiaoidea avatar Mar 24 '17 08:03 xiaoidea

Notice: this issue has been closed because it has been inactive for 395 days. Feel free to comment and request for this issue to be reopened.

mistercrunch avatar Apr 23 '18 17:04 mistercrunch