python manage.py db init;
all works, but:
python manage.py db migrate;
Fails with
(backend) cp-server@cp-backend-aec-stg:~/do-portal/backend$ python manage.py db migrate;
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
Traceback (most recent call last):
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 348, in _revision_for_ident
revision = self._revision_map[resolved_id]
KeyError: 'e034bab4fb56'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 129, in _catch_revision_errors
yield
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 192, in get_revisions
return self.revision_map.getrevisions(id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in get_revisions
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in get_revisions
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 358, in _revision_for_ident
resolved_id)
alembic.script.revision.ResolutionError: No such revision or branch 'e034bab4fb56'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 276, in
cli()
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 722, in call
return self.main(*args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask/cli.py", line 374, in main
return AppGroup.main(self, args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 535, in invoke
return callback(args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask/cli.py", line 251, in decorator
return __ctx.invoke(f, *args, *kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 535, in invoke
return callback(args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask_migrate/cli.py", line 88, in migrate
rev_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask_migrate/init.py", line 177, in migrate
version_path=version_path, rev_id=rev_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/command.py", line 117, in revision
script_directory.run_env()
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 407, in run_env
util.load_python_file(self.dir, 'env.py')
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
module = load_module_py(module_id, path)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/compat.py", line 68, in load_module_py
module_id, path).load_module(module_id)
File "", line 539, in _check_name_wrapper
File "", line 1614, in load_module
File "", line 596, in _load_module_shim
File "", line 1220, in load
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/home/cp-server/do-portal/backend/misc/migrations/env.py", line 87, in
run_migrations_online()
File "/home/cp-server/do-portal/backend/misc/migrations/env.py", line 80, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
self.get_context().run_migrations(**kw)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/runtime/migration.py", line 303, in run_migrations
for step in self._migrations_fn(heads, self):
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/command.py", line 97, in retrieve_migrations
revision_context.run_autogenerate(rev, context)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/autogenerate/api.py", line 369, in run_autogenerate
self._run_environment(rev, migration_context, True)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/autogenerate/api.py", line 379, in _run_environment
if set(self.script_directory.get_revisions(rev)) != \
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 192, in get_revisions
return self.revision_map.getrevisions(id)
File "/usr/lib/python3.4/contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 160, in _catch_revision_errors
compat.raise_from_cause(util.CommandError(resolution))
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/compat.py", line 121, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/compat.py", line 114, in reraise
raise value.with_traceback(tb)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 129, in _catch_revision_errors
yield
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 192, in get_revisions
return self.revision_map.getrevisions(id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in get_revisions
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in get_revisions
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 358, in _revision_for_ident
resolved_id)
alembic.util.exc.CommandError: Can't locate revision identified by 'e034bab4fb56'
Following the instructions from docs/01_INSTALL.md (previously README.md) for the backend:
python manage.py db migrate;
Fails withDuring handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 129, in _catch_revision_errors yield File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 192, in get_revisions return self.revision_map.getrevisions(id) File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in get_revisions return sum([self.get_revisions(id_elem) for idelem in id], ()) File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in get_revisions
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 358, in _revision_for_ident
resolved_id)
alembic.script.revision.ResolutionError: No such revision or branch 'e034bab4fb56'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "manage.py", line 276, in
cli()
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 722, in call
return self.main(*args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask/cli.py", line 374, in main
return AppGroup.main(self, args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 535, in invoke
return callback(args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask/cli.py", line 251, in decorator
return __ctx.invoke(f, *args, *kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/click/core.py", line 535, in invoke
return callback(args, kwargs)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask_migrate/cli.py", line 88, in migrate
rev_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/flask_migrate/init.py", line 177, in migrate
version_path=version_path, rev_id=rev_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/command.py", line 117, in revision
script_directory.run_env()
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 407, in run_env
util.load_python_file(self.dir, 'env.py')
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
module = load_module_py(module_id, path)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/compat.py", line 68, in load_module_py
module_id, path).load_module(module_id)
File "", line 539, in _check_name_wrapper
File "", line 1614, in load_module
File "", line 596, in _load_module_shim
File "", line 1220, in load
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/home/cp-server/do-portal/backend/misc/migrations/env.py", line 87, in
run_migrations_online()
File "/home/cp-server/do-portal/backend/misc/migrations/env.py", line 80, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
self.get_context().run_migrations(**kw)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/runtime/migration.py", line 303, in run_migrations
for step in self._migrations_fn(heads, self):
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/command.py", line 97, in retrieve_migrations
revision_context.run_autogenerate(rev, context)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/autogenerate/api.py", line 369, in run_autogenerate
self._run_environment(rev, migration_context, True)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/autogenerate/api.py", line 379, in _run_environment
if set(self.script_directory.get_revisions(rev)) != \
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 192, in get_revisions
return self.revision_map.getrevisions(id)
File "/usr/lib/python3.4/contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 160, in _catch_revision_errors
compat.raise_from_cause(util.CommandError(resolution))
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/compat.py", line 121, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/util/compat.py", line 114, in reraise
raise value.with_traceback(tb)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 129, in _catch_revision_errors
yield
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/base.py", line 192, in get_revisions
return self.revision_map.getrevisions(id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in get_revisions
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 298, in
return sum([self.get_revisions(id_elem) for idelem in id], ())
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in get_revisions
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 303, in
for rev_id in resolved_id)
File "/home/cp-server/do-portal/backend/lib/python3.4/site-packages/alembic/script/revision.py", line 358, in _revision_for_ident
resolved_id)
alembic.util.exc.CommandError: Can't locate revision identified by 'e034bab4fb56'