#230 Koji (koji-hub/kojira) fail in Fedora 25 with PostgreSQL syntax error at or near "ARRAY"
Closed: Fixed 5 years ago Opened 5 years ago by amessina.

I'm guessing the Fedora 25 PyGreSQL version is related:

2016-12-07 15:08:42,513 [ERROR] {4646} koji:331 Error in currency checker thread
Traceback (most recent call last):
File "/usr/sbin/kojira", line 328, in currencyChecker
    self.checkCurrentRepos(session)
File "/usr/sbin/kojira", line 315, in checkCurrentRepos
    changed = session.tagChangedSinceEvent(repo.event_id, repo.taglist)
File "/usr/lib/python2.7/site-packages/koji/__init__.py", line 1736, in __call__
    return self.__func(self.__name,args,opts)
File "/usr/lib/python2.7/site-packages/koji/__init__.py", line 2118, in _callMethod
    raise err
Fault: <Fault 1: 'Traceback (most recent call last):\n  File "/usr/share/koji-hub/kojixmlrpc.py", line 234, in _wrap_handler\n    response = handler(environ)\n  File "/usr/share/koji-hub/kojixmlrpc.py", line 277, in handle_rpc\n    return self._dispatch(method, params)\n  File "/usr/share/koji-hub/kojixmlrpc.py", line 314, in _dispatch\n    ret = koji.util.call_with_argcheck(func, params, opts)\n  File "/usr/lib/python2.7/site-packages/koji/util.py", line 154, in call_with_argcheck\n    return func(*args, **kwargs)\n  File "/usr/share/koji-hub/kojihub.py", line 2468, in tag_changed_since_event\n    if query.execute():\n  File "/usr/share/koji-hub/kojihub.py", line 7252, in execute\n    data = _multiRow(query, self.values, (self.aliases or self.columns))\n  File "/usr/share/koji-hub/kojihub.py", line 4067, in _multiRow\n    return [dict(zip(fields, row)) for row in _fetchMulti(query, values)]\n  File "/usr/share/koji-hub/kojihub.py", line 4039, in _fetchMulti\n    c.execute(query, values)\n  File "/usr/lib/python2.7/site-packages/koji/db.py", line 113, in execute\n    ret = self.cursor.execute(operation, parameters)\n  File "/usr/lib64/python2.7/site-packages/pgdb.py", line 913, in execute\n    return self.executemany(operation, [parameters])\n  File "/usr/lib64/python2.7/site-packages/pgdb.py", line 937, in executemany\n    rows = self._src.execute(sql)\nProgrammingError: ERROR:  syntax error at or near "ARRAY"\nLINE 6:    AND (tag_id IN ARRAY[1,2,3,13,14,15,18,19,21,22,23,25,27,...\n                          ^\n\n'>
2016-12-07 15:08:42,532 [ERROR] {4646} koji:650 Traceback (most recent call last):
File "/usr/sbin/kojira", line 632, in main
    repomgr.updateRepos()
File "/usr/sbin/kojira", line 491, in updateRepos
    'state':([koji.TASK_STATES[s] for s in ('FREE', 'OPEN')])})
File "/usr/lib/python2.7/site-packages/koji/__init__.py", line 1736, in __call__
    return self.__func(self.__name,args,opts)
File "/usr/lib/python2.7/site-packages/koji/__init__.py", line 2118, in _callMethod
    raise err
Fault: <Fault 1: 'Traceback (most recent call last):\n  File "/usr/share/koji-hub/kojixmlrpc.py", line 237, in _wrap_handler\n    response = dumps(response, methodresponse=1, allow_none=1)\n  File "/usr/lib64/python2.7/xmlrpclib.py", line 1094, in dumps\n    data = m.dumps(params)\n  File "/usr/lib64/python2.7/xmlrpclib.py", line 638, in dumps\n    dump(v, write)\n  File "/usr/lib64/python2.7/xmlrpclib.py", line 660, in __dump\n    f(self, value, write)\n  File "/usr/share/koji-hub/kojixmlrpc.py", line 52, in dump_generator\n    for v in value:\n  File "/usr/share/koji-hub/kojihub.py", line 7278, in _iterate\n    c.execute(query, values)\n  File "/usr/lib/python2.7/site-packages/koji/db.py", line 113, in execute\n    ret = self.cursor.execute(operation, parameters)\n  File "/usr/lib64/python2.7/site-packages/pgdb.py", line 913, in execute\n    return self.executemany(operation, [parameters])\n  File "/usr/lib64/python2.7/site-packages/pgdb.py", line 937, in executemany\n    rows = self._src.execute(sql)\nProgrammingError: ERROR:  syntax error at or near "ARRAY"\nLINE 5:  WHERE (state IN ARRAY[0,1])\n                         ^\n\n'>

And a call from a Koji builder...

2016-12-07 15:24:16,118 [WARNING] m=listBuildroots koji.xmlrpc: Traceback (most recent call last):
    File "/usr/share/koji-hub/kojixmlrpc.py", line 234, in _wrap_handler
      response = handler(environ)
    File "/usr/share/koji-hub/kojixmlrpc.py", line 277, in handle_rpc
      return self._dispatch(method, params)
    File "/usr/share/koji-hub/kojixmlrpc.py", line 314, in _dispatch
      ret = koji.util.call_with_argcheck(func, params, opts)
    File "/usr/lib/python2.7/site-packages/koji/util.py", line 154, in call_with_argcheck
      return func(*args, **kwargs)
    File "/usr/share/koji-hub/kojihub.py", line 4263, in query_buildroots
      return query.execute()
    File "/usr/share/koji-hub/kojihub.py", line 7252, in execute
      data = _multiRow(query, self.values, (self.aliases or self.columns))
    File "/usr/share/koji-hub/kojihub.py", line 4067, in _multiRow
      return [dict(zip(fields, row)) for row in _fetchMulti(query, values)]
    File "/usr/share/koji-hub/kojihub.py", line 4039, in _fetchMulti
      c.execute(query, values)
    File "/usr/lib/python2.7/site-packages/koji/db.py", line 113, in execute
      ret = self.cursor.execute(operation, parameters)
    File "/usr/lib64/python2.7/site-packages/pgdb.py", line 913, in execute
      return self.executemany(operation, [parameters])
    File "/usr/lib64/python2.7/site-packages/pgdb.py", line 937, in executemany
      rows = self._src.execute(sql)
ProgrammingError: ERROR:  syntax error at or near "ARRAY"
LINE 13:    AND (standard_buildroot.state IN ARRAY[0,1,2])

Downgrading to PyGreSQL-4.2-2.fc24.x86_64 temporarily resolves the issue.

@mikem, I can confirm that applying your patch https://pagure.io/fork/mikeb/koji/c/676db88a8bd4c729278ef4594c9174be5b554b2f (and removing PyGreSQL for good measure) resolves the issue on a Fedora 25 installation.

Reproducible for me as well, kojid and kojira both fail with ProgrammingError when trying to talk to hub deployed on Fedora 25.

(In my setup kojira, koji-web and kojid work fine on Fedora 25, as long as hub stays on Fedora 24.)

I've opened PR #240 for discussion about psycopg2 solution.

@mikem changed the status to Closed

5 years ago

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.12

5 years ago

Login to comment on this ticket.

Metadata