furlongm/patchman

MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'reports_report.modules' in 'field list'")

jaydeepch15 opened this issue · 5 comments

I have ubuntu 22 LTS servers. On which it was running fine.

now when I run patchman -a it giving me below error

root@awslpatchman:~# /usr/bin/patchman -a
Cleaning Reports for all Hosts

awslansible01.waterfrontmedia.net
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 73, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 239, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'reports_report.modules' in 'field list'")

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

Traceback (most recent call last):
  File "/usr/bin/patchman", line 705, in <module>
    main()
  File "/usr/bin/patchman", line 699, in main
    showhelp = process_args(args)
  File "/usr/bin/patchman", line 656, in process_args
    clean_reports(args.host)
  File "/usr/bin/patchman", line 240, in clean_reports
    host.clean_reports(timestamp)
  File "/usr/lib/python3/dist-packages/hosts/models.py", line 122, in clean_reports
    remove_reports(self, timestamp)
  File "/usr/lib/python3/dist-packages/hosts/utils.py", line 50, in remove_reports
    for report in reports:
  File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 280, in __iter__
    self._fetch_all()
  File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 1324, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 51, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 98, in execute
    return super().execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 79, in _execute
    with self.db.wrap_database_errors:
  File "/usr/lib/python3/dist-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 73, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 239, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1054, "Unknown column 'reports_report.modules' in 'field list'")

Hello,
it was reported yesterday, with resolution
#538

enekux commented

+1

Added the v2 migrations in 97c93ff and released as v3.0.6

enekux commented

thanks it works now!

@julienleboeuf Your solution worked for me as well.
Thank you.
@furlongm Thank you too.