Error on execute tacker-db-manage with Postgresql

Bug #1772667 reported by Paolo Narducci
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Won't Fix
Undecided
Unassigned

Bug Description

Hi! I hit a bug in the installation process for Tacker.

It is not possible to populate the database when the backend is Postgresql (at least as of version 9.6), because it does not support the modification of the length of a column of type TEXT (e.g. see https://www.postgresql.org/docs/9.6/static/datatype-character.html).

Please find attached the configuration file I used for Tacker. Below the error I got during the procedure:

$ /usr/bin/tacker-db-manage --config-file /etc/tacker/tacker.conf upgrade head
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 1c6b0d82afcd, add tables for tacker framework
INFO [alembic.runtime.migration] Running upgrade 1c6b0d82afcd -> 81ffa86020d, rpc_proxy
INFO [alembic.runtime.migration] Running upgrade 81ffa86020d -> 4c31092895b8, empty message
INFO [alembic.runtime.migration] Running upgrade 4c31092895b8 -> 13c0e0661015, add descrition to vnf
INFO [alembic.runtime.migration] Running upgrade 13c0e0661015 -> 5958429bcb3c, modify datatype of value
Traceback (most recent call last):
  File "/usr/bin/tacker-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/tacker/db/migration/cli.py", line 177, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.7/site-packages/tacker/db/migration/cli.py", line 67, in do_upgrade
    do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
  File "/usr/lib/python2.7/site-packages/tacker/db/migration/cli.py", line 46, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
    script.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 416, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/usr/lib/python2.7/site-packages/tacker/db/migration/alembic_migrations/env.py", line 84, in <module>
    run_migrations_online()
  File "/usr/lib/python2.7/site-packages/tacker/db/migration/alembic_migrations/env.py", line 76, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/lib/python2.7/site-packages/alembic/runtime/environment.py", line 807, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/lib/python2.7/site-packages/alembic/runtime/migration.py", line 321, in run_migrations
    step.migration_fn(**kw)
  File "/usr/lib/python2.7/site-packages/tacker/db/migration/alembic_migrations/versions/5958429bcb3c_modify_datatype_of_value.py", line 34, in upgrade
    'value', type_=sa.TEXT(length=65535), nullable=True)
  File "<string>", line 8, in alter_column
  File "<string>", line 3, in alter_column
  File "/usr/lib/python2.7/site-packages/alembic/operations/ops.py", line 1420, in alter_column
    return operations.invoke(alt)
  File "/usr/lib/python2.7/site-packages/alembic/operations/base.py", line 318, in invoke
    return fn(self, operation)
  File "/usr/lib/python2.7/site-packages/alembic/operations/toimpl.py", line 53, in alter_column
    **operation.kw
  File "/usr/lib/python2.7/site-packages/alembic/ddl/postgresql.py", line 91, in alter_column
    existing_nullable=existing_nullable,
  File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 118, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1002, in _execute_ddl
    compiled
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) type modifier is not allowed for type "text"
 [SQL: 'ALTER TABLE devicetemplateattributes ALTER COLUMN value TYPE TEXT(65535) ']

The following printout shows the packages I'm using:

$ rpm -qa | grep tacker
openstack-tacker-0.8.1-1.el7.noarch
openstack-tacker-common-0.8.1-1.el7.noarch
python-tacker-0.8.1-1.el7.noarch
python2-tackerclient-0.10.1-1.el7.noarch

Cheers, Paolo.

Revision history for this message
Paolo Narducci (paolo-narducci) wrote :
Revision history for this message
Cong Phuoc Hoang (hoangphuoc) wrote :

Hi Paolo, I think Tacker should remove limit value in TEXT. Are you using Tacker master version now? I will make a ps to fix this bug soon.

Revision history for this message
Paolo Narducci (paolo-narducci) wrote :

Hi Cong, no I'm not using the master version, I also believe that you have to eliminate the limits to TEXT, as I will be more discharged from the activity I'm going to restart the tests. I think tacker is an interesting and useful project in an NFV environment.

Yasufumi Ogawa (yasufum)
Changed in tacker:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.