Bug 1465511 - Pagure 2.90.1 createdb.py gives sqlalchemy.exc.OperationalError
Summary: Pagure 2.90.1 createdb.py gives sqlalchemy.exc.OperationalError
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: pagure
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pierre-YvesChibon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-27 14:32 UTC by Paul Jakma
Modified: 2017-12-12 10:31 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:31:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Paul Jakma 2017-06-27 14:32:50 UTC
Description of problem:

Running pagure_createdb.py from the pagure 2.90.1 RPM package from koji (on F25), appears to fix bug #1465490. However, it still does not succeed. Rather it errors out with an sqlalchemy.exc.OperationalError.

Version-Release number of selected component (if applicable):

pagure-2.90.1-1.el7.noarch installed on F25

MySQL:

Server version:         10.1.24-MariaDB MariaDB Server


How reproducible:

100%

Steps to Reproduce:
1. Install pagure and pagure-{ev,webhooks} 2.90.1-1.el7
2. Configure DB_URL as per DB_URL='mysql://pagure:blah.0.1/pagure'
3. Run PAGURE_CONFIG=/etc/pagure/pagure.cfg  python /usr/share/pagure/pagure_createdb.py

Actual results:

<it succeeds in creating many tables, then...>
2017-06-27 14:30:24,391 INFO sqlalchemy.engine.base.Engine 
CREATE TABLE issue_keys (
        id INTEGER NOT NULL AUTO_INCREMENT, 
        project_id INTEGER NOT NULL, 
        name TEXT NOT NULL, 
        key_type VARCHAR(255) NOT NULL, 
        key_data TEXT, 
        key_notify BOOL NOT NULL, 
        CONSTRAINT issue_keys_pkey PRIMARY KEY (id), 
        CONSTRAINT issue_keys_project_id_key UNIQUE (project_id, name), 
        CONSTRAINT issue_keys_project_id_fkey FOREIGN KEY(project_id) REFERENCES projects (id) ON DELETE CASCADE ON UPDATE CASCADE, 
        CHECK (key_notify IN (0, 1))
)


2017-06-27 14:30:24,391 [INFO] sqlalchemy.engine.base.Engine: 
CREATE TABLE issue_keys (
        id INTEGER NOT NULL AUTO_INCREMENT, 
        project_id INTEGER NOT NULL, 
        name TEXT NOT NULL, 
        key_type VARCHAR(255) NOT NULL, 
        key_data TEXT, 
        key_notify BOOL NOT NULL, 
        CONSTRAINT issue_keys_pkey PRIMARY KEY (id), 
        CONSTRAINT issue_keys_project_id_key UNIQUE (project_id, name), 
        CONSTRAINT issue_keys_project_id_fkey FOREIGN KEY(project_id) REFERENCES projects (id) ON DELETE CASCADE ON UPDATE CASCADE, 
        CHECK (key_notify IN (0, 1))
)


2017-06-27 14:30:24,391 INFO sqlalchemy.engine.base.Engine ()
2017-06-27 14:30:24,391 [INFO] sqlalchemy.engine.base.Engine: ()
2017-06-27 14:30:24,392 INFO sqlalchemy.engine.base.Engine ROLLBACK
2017-06-27 14:30:24,392 [INFO] sqlalchemy.engine.base.Engine: ROLLBACK
Traceback (most recent call last):
  File "/usr/share/pagure/pagure_createdb.py", line 14, in <module>
    debug=True)
  File "/usr/lib/python2.7/site-packages/pagure/lib/model.py", line 76, in create_tables
    BASE.metadata.create_all(engine)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/schema.py", line 3762, in create_all
    tables=tables)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1856, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1481, in _run_visitor
    **kwargs).traverse_single(element)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 730, in visit_metadata
    _is_metadata_operation=True)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 764, in visit_table
    include_foreign_key_constraints=include_foreign_key_constraints
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, 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 968, in _execute_ddl
    compiled
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, 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 1139, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 226, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorvalue
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1170, "BLOB/TEXT column 'name' used in key specification without a key length") [SQL: u'\nCREATE TABLE issue_keys (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tproject_id INTEGER NOT NULL, \n\tname TEXT NOT NULL, \n\tkey_type VARCHAR(255) NOT NULL, \n\tkey_data TEXT, \n\tkey_notify BOOL NOT NULL, \n\tCONSTRAINT issue_keys_pkey PRIMARY KEY (id), \n\tCONSTRAINT issue_keys_project_id_key UNIQUE (project_id, name), \n\tCONSTRAINT issue_keys_project_id_fkey FOREIGN KEY(project_id) REFERENCES projects (id) ON DELETE CASCADE ON UPDATE CASCADE, \n\tCHECK (key_notify IN (0, 1))\n)\n\n']


Expected results:

I wasn't expecting it to error with sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError).

Additional info:

Comment 1 Fedora End Of Life 2017-11-16 18:51:25 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2017-12-12 10:31:18 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.