psycopg2.ProgrammingError: argument of AND must be type boolean, not type bigint

Bug #1680980 reported by Iain Lane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bileto
Fix Released
Undecided
Robert Bruce Park

Bug Description

I just tried to publish #2711 and got

2017-04-07 22:29:16,452 ERROR Unhandled exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
psycopg2.ProgrammingError: argument of AND must be type boolean, not type bigint
LINE 3: ...%' || '7.5.0+17.04.20170301-0ubuntu1' || '%') AND comment.ti...
                                                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/bileto/bileto/worker/main.py", line 61, in main
    action_obj(Manager(ticket))
  File "/var/lib/bileto/bileto/actions.py", line 75, in __init__
    manager.validate().prepublish().publish()
  File "/var/lib/bileto/bileto/worker/manager.py", line 307, in prepublish
    self.call_on_all_packages('prepublish')()
  File "/var/lib/bileto/bileto/worker/manager.py", line 210, in passthrough
    for name, package in self.packages().items()])
  File "/var/lib/bileto/bileto/worker/vcs.py", line 23, in parallelize
    return get_event_loop().run_until_complete(gather(*tasks))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
    return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/var/lib/bileto/bileto/worker/merge.py", line 372, in prepublish
    return await super().prepublish()
  File "/var/lib/bileto/bileto/worker/package.py", line 284, in prepublish
    return (self.id, await run_checks(checks, source=source))
  File "/var/lib/bileto/bileto/worker/package.py", line 34, in run_checks
    message = await check(*args, **kwargs)
  File "/var/lib/bileto/bileto/worker/merge.py", line 276, in check_destination_version
    if dest and self.already_published(dest.source_package_version):
  File "/var/lib/bileto/bileto/worker/merge.py", line 263, in already_published
    Comment.ticket_id == int(environ['TICKETID'])).all()
  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 2588, in all
    return list(self)
  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 2736, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/lib/python3/dist-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 189, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)
  File "/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 182, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) argument of AND must be type boolean, not type bigint
LINE 3: ...%' || '7.5.0+17.04.20170301-0ubuntu1' || '%') AND comment.ti...
                                                             ^
 [SQL: "SELECT comment.id AS comment_id, comment.ticket_id AS comment_ticket_id, comment.author AS comment_author, comment.text AS comment_text, comment.date AS comment_date, comment.log_url AS comment_log_url, comment.published_versions AS comment_published_versions \nFROM comment \nWHERE ((comment.published_versions LIKE '%%' || %(published_versions_1)s || '%%') AND (comment.published_versions LIKE '%%' || %(published_versions_2)s || '%%') AND comment.ticket_id) = %(param_1)s"] [parameters: {'param_1': 2711, 'published_versions_2': '7.5.0+17.04.20170301-0ubuntu1', 'published_versions_1': 'unity'}]
2017-04-07 22:29:16,461 INFO Failed in 0m 36s

See: https://bileto.ubuntu.com/log/2711/publish/2/

please do not publish this for me if you want to test fixing the bug; try a different silo or something

Changed in bileto:
assignee: nobody → Robert Bruce Park (robru)
status: New → Triaged
status: Triaged → In Progress
Revision history for this message
Robert Bruce Park (robru) wrote :

Apologies, just pushed a fix for this, should be live in five. Let me know if you see this again.

Changed in bileto:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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