#198 Sync borked after migration to the latest develop
Closed: Invalid 2 months ago by kparal. Opened 2 months ago by frantisekz.

Migration "went fine" (RC==0), but sync now fails with:

[root@blockerbugs01 frantisekz][STG]# sudo -u blockerbugs blockerbugs sync
[blockerbugs            :37 ] 2021-08-11 17:23:05 DEBUG   Using production config
[blockerbugs            :47 ] 2021-08-11 17:23:05 INFO    Loading configuration from /etc/blockerbugs/settings.py
[bugzilla.base  ] 2021-08-11 17:23:06 INFO    Using RHBugzilla for URL containing .redhat.com
[bz_interface   ] 2021-08-11 17:23:06 INFO    Using bugzilla URL: https://bugzilla.stage.redhat.com/xmlrpc.cgi
[bug_sync       ] 2021-08-11 17:23:06 INFO    Starting blocker sync
[bug_sync       ] 2021-08-11 17:23:06 INFO    Syncing blockers for milestone: 35-beta
[bug_sync       ] 2021-08-11 17:23:06 INFO    Cleaning up Blocker for Fedora 35 beta (1891953)
Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column bug.depends_on does not exist
LINE 1: SELECT bug.depends_on AS bug_depends_on, bug.id AS bug_id, b...
               ^


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

Traceback (most recent call last):
  File "/usr/bin/blockerbugs", line 33, in <module>
    sys.exit(load_entry_point('blockerbugs==1.3.1', 'console_scripts', 'blockerbugs')())
  File "/usr/lib/python3.9/site-packages/blockerbugs/cli.py", line 348, in main
    args.func(args)
  File "/usr/lib/python3.9/site-packages/blockerbugs/cli.py", line 216, in sync
    sync_bugs(args)
  File "/usr/lib/python3.9/site-packages/blockerbugs/cli.py", line 197, in sync_bugs
    sync.update_active(full_sync=fullsync)
  File "/usr/lib/python3.9/site-packages/blockerbugs/util/bug_sync.py", line 234, in update_active
    self.cleanup_milestone(milestone, 'Blocker')
  File "/usr/lib/python3.9/site-packages/blockerbugs/util/bug_sync.py", line 189, in cleanup_milestone
    blockers = Bug.query.filter_by(milestone=milestone).filter(
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/orm/query.py", line 3373, in all
    return list(self)
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column bug.depends_on does not exist
LINE 1: SELECT bug.depends_on AS bug_depends_on, bug.id AS bug_id, b...
               ^

[SQL: SELECT bug.depends_on AS bug_depends_on, bug.id AS bug_id, bug.bugid AS bug_bugid, bug.url AS bug_url, bug.summary AS bug_summary, bug.status AS bug_status, bug.component AS bug_component, bug.active AS bug_active, bug.last_bug_sync AS bug_last_bug_sync, bug.needinfo AS bug_needinfo, bug.needinfo_requestee AS bug_needinfo_requestee, bug.last_whiteboard_change AS bug_last_whiteboard_change, bug.proposed_blocker AS bug_proposed_blocker, bug.proposed_fe AS bug_proposed_fe, bug.rejected_blocker AS bug_rejected_blocker, bug.rejected_fe AS bug_rejected_fe, bug.accepted_blocker AS bug_accepted_blocker, bug.accepted_0day AS bug_accepted_0day, bug.accepted_prevrel AS bug_accepted_prevrel, bug.accepted_fe AS bug_accepted_fe, bug.prioritized AS bug_prioritized, bug.milestone_id AS bug_milestone_id, bug.discussion_link AS bug_discussion_link, bug.votes AS bug_votes 
FROM bug 
WHERE %(param_1)s = bug.milestone_id AND (bug.proposed_blocker = true OR bug.accepted_blocker = true OR bug.accepted_0day = true OR bug.accepted_prevrel = true)]
[parameters: {'param_1': 1}]
(Background on this error at: http://sqlalche.me/e/13/f405)

FYI: This breaks even the app itself, DB is @ latest rev.

Issue tagged with: next

2 months ago

I and @frantisekz tested this again with the latest develop, and everything works OK. I assume there was some migration confusion originally (the db doesn't seem to be at $head, even though it claims it). Closing.

Metadata Update from @kparal:
- Issue untagged with: next
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

2 months ago

Login to comment on this ticket.

Metadata