Traceback (most recent call last):


 "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity

await entity.async_device_update(warning=False)


 "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update

await self.hass.async_add_executor_job(self.update)


 "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run

result = self.fn(*self.args, **self.kwargs)


 "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/tplink.py", line 145, in update

self.get_features()


 "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/tplink.py", line 204, in get_features

self.smartbulb.valid_temperature_range[1])


 "/usr/local/lib/python3.6/site-packages/homeassistant/util/color.py", line 516, in color_temperature_kelvin_to_mired

return math.floor(1000000 / kelvin_temperature)
ZeroDivisionError: division by zero

Traceback (most recent call last):


 "/usr/local/bin/tsctl", line 33, in <module>

sys.exit(load_entry_point('timesketch==20210224', 'console_scripts', 'tsctl')())


 "/usr/local/lib/python3.6/dist-packages/timesketch/tsctl.py", line 465, in main

shell_manager.run()


 "/usr/local/lib/python3.6/dist-packages/flask_script/__init__.py", line 417, in run

result = self.handle(argv[0], argv[1:])


 "/usr/local/lib/python3.6/dist-packages/flask_script/__init__.py", line 386, in handle

res = handle(*args, **config)


 "/usr/local/lib/python3.6/dist-packages/flask_script/commands.py", line 216, in __call__

return self.run(*args, **kwargs)


 "/usr/local/lib/python3.6/dist-packages/flask_migrate/__init__.py", line 95, in wrapped

f(*args, **kwargs)


 "/usr/local/lib/python3.6/dist-packages/flask_migrate/__init__.py", line 280, in upgrade

command.upgrade(config, revision, sql=sql, tag=tag)


 "/usr/local/lib/python3.6/dist-packages/alembic/command.py", line 298, in upgrade

script.run_env()


 "/usr/local/lib/python3.6/dist-packages/alembic/script/base.py", line 489, in run_env

util.load_python_file(self.dir, "env.py")


 "/usr/local/lib/python3.6/dist-packages/alembic/util/pyfiles.py", line 98, in load_python_file

module = load_module_py(module_id, path)


 "/usr/local/lib/python3.6/dist-packages/alembic/util/compat.py", line 173, in load_module_py

spec.loader.exec_module(module)


 "<frozen importlib._bootstrap_external>", line 678, in exec_module


 "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed


 "migrations/env.py", line 91, in <module>

run_migrations_online()


 "migrations/env.py", line 84, in run_migrations_online

context.run_migrations()


 "<string>", line 8, in run_migrations


 "/usr/local/lib/python3.6/dist-packages/alembic/runtime/environment.py", line 846, in run_migrations

self.get_context().run_migrations(**kw)


 "/usr/local/lib/python3.6/dist-packages/alembic/runtime/migration.py", line 518, in run_migrations

step.migration_fn(**kw)


 "/tmp/timesketch-20210224/timesketch/migrations/versions/be32626451fb_.py", line 22, in upgrade

op.add_column('searchindex_accesscontrolentry', sa.Column('group_id', sa.Integer(), nullable=True))


 "<string>", line 8, in add_column


 "<string>", line 3, in add_column


 "/usr/local/lib/python3.6/dist-packages/alembic/operations/ops.py", line 1906, in add_column

return operations.invoke(op)


 "/usr/local/lib/python3.6/dist-packages/alembic/operations/base.py", line 345, in invoke

return fn(self, operation)


 "/usr/local/lib/python3.6/dist-packages/alembic/operations/toimpl.py", line 131, in add_column

operations.impl.add_column(table_name, column, schema=schema)


 "/usr/local/lib/python3.6/dist-packages/alembic/ddl/impl.py", line 231, in add_column

self._exec(base.AddColumn(table_name, column, schema=schema))


 "/usr/local/lib/python3.6/dist-packages/alembic/ddl/impl.py", line 134, in _exec

return conn.execute(construct, *multiparams, **params)


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 982, in execute

return meth(self, multiparams, params)


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection

return connection._execute_ddl(self, multiparams, params)


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1044, in _execute_ddl

compiled,


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1250, in _execute_context

e, statement, parameters, cursor, context


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception

util.raise_from_cause(sqlalchemy_exception, exc_info)


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause

reraise(type(exception), exception, tb=exc_tb, cause=cause)


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/compat.py", line 152, in reraise

raise value.with_traceback(tb)


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1246, in _execute_context

cursor, statement, parameters, context


 "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/default.py", line 581, in do_execute

cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column "group_id" of relation "searchindex_accesscontrolentry" already exists
