Incubator-superset: FlushError

Created on 21 Oct 2020  路  4Comments  路  Source: apache/incubator-superset

Creating table [birth_names] reference
Creating some slices
Traceback (most recent call last):
  File "/home/clay/Desktop/incubator-superset/venv/bin/superset", line 11, in <module>
    load_entry_point('apache-superset', 'console_scripts', 'superset')()
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/superset/cli.py", line 172, in load_examples
    load_examples_run(load_test_data, only_metadata, force)
  File "/home/clay/Desktop/incubator-superset/superset/cli.py", line 116, in load_examples_run
    examples.load_birth_names(only_metadata, force)
  File "/home/clay/Desktop/incubator-superset/superset/examples/birth_names.py", line 125, in load_birth_names
    slices, _ = create_slices(obj)
  File "/home/clay/Desktop/incubator-superset/superset/examples/birth_names.py", line 461, in create_slices
    merge_slice(slc)
  File "/home/clay/Desktop/incubator-superset/superset/examples/helpers.py", line 61, in merge_slice
    db.session.commit()
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1042, in commit
    self.transaction.commit()
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 504, in commit
    self._prepare_impl()
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 483, in _prepare_impl
    self.session.flush()
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2523, in flush
    self._flush(objects)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2664, in _flush
    transaction.rollback(_capture_exception=True)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2624, in _flush
    flush_context.execute()
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 540, in execute
    self.dependency_processor.process_saves(uow, states)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/dependency.py", line 1131, in process_saves
    state, child, associationrow, False, uowcommit, "add"
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/dependency.py", line 1246, in _synchronize
    self._verify_canload(child)
  File "/home/clay/Desktop/incubator-superset/venv/lib/python3.6/site-packages/sqlalchemy/orm/dependency.py", line 253, in _verify_canload
    "collection %s" % (self.prop,)
sqlalchemy.orm.exc.FlushError: Can't flush None value found in collection Slice.owners
#bug

All 4 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.76. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@TeAmP0is0N
please try run superset db upgrade. This issue seems like the chart(Slice) don't have owners

I think it happens when you don't load users, then the owner (admin) is None. I also may suggest to take a look if users are created while superset load_test_users. If you have only one line Loading a set of users for unit tests and no info that admin was created, then it would be worth check if you have testing environment (export SUPERSET_CONFIG=tests.superset_test_config or for fish set -x SUPERSET_CONFIG tests.superset_test_config).

fixed via #11407

Was this page helpful?
0 / 5 - 0 ratings