[Bug 2108994] Re: apscheduler retrieving decimal.Decimal via sqlalchemy

Seyeong Kim 2108994 at bugs.launchpad.net
Tue Dec 16 06:41:38 UTC 2025


** Also affects: watcher (Ubuntu)
   Importance: Undecided
       Status: New

** No longer affects: apscheduler (Ubuntu Focal)

** No longer affects: apscheduler (Ubuntu)

** Changed in: apscheduler (Ubuntu Noble)
     Assignee: Seyeong Kim (seyeongkim) => (unassigned)

** Changed in: apscheduler (Ubuntu Jammy)
     Assignee: Seyeong Kim (seyeongkim) => (unassigned)

** No longer affects: apscheduler (Ubuntu Jammy)

** Changed in: watcher (Ubuntu Resolute)
       Status: New => Fix Released

** Changed in: watcher (Ubuntu Questing)
       Status: New => Fix Released

** Changed in: watcher (Ubuntu Plucky)
       Status: New => Fix Released

** Changed in: watcher (Ubuntu Noble)
     Assignee: (unassigned) => Seyeong Kim (seyeongkim)

** Changed in: watcher (Ubuntu Noble)
       Status: New => In Progress

** No longer affects: apscheduler (Ubuntu Noble)

** No longer affects: apscheduler (Ubuntu Plucky)

** No longer affects: apscheduler (Ubuntu Questing)

** No longer affects: apscheduler (Ubuntu Resolute)

** Also affects: cloud-archive
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to watcher in Ubuntu.
https://bugs.launchpad.net/bugs/2108994

Title:
  apscheduler retrieving decimal.Decimal via sqlalchemy

Status in Ubuntu Cloud Archive:
  New
Status in watcher package in Ubuntu:
  Fix Released
Status in watcher source package in Focal:
  New
Status in watcher source package in Jammy:
  New
Status in watcher source package in Noble:
  In Progress
Status in watcher source package in Plucky:
  Fix Released
Status in watcher source package in Questing:
  Fix Released
Status in watcher source package in Resolute:
  Fix Released

Bug description:
  Kolla-Ansible: 2023.2
  Ubuntu 22.04.5 LTS

  I have a fresh installation in a three-node testing environment with
  Watcher enabled (deployed via Kolla Ansible).

  When creating a continuous audit, the watcher_engine container logs
  the following traceback:

  Exception in thread APScheduler:
  Traceback (most recent call last):
    File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
      self.run()
    File "/usr/lib/python3.10/threading.py", line 953, in run
      self._target(*self._args, **self._kwargs)
    File "/var/lib/kolla/venv/lib/python3.10/site-packages/apscheduler/schedulers/blocking.py", line 32, in _main_loop
      wait_seconds = self._process_jobs()
    File "/var/lib/kolla/venv/lib/python3.10/site-packages/apscheduler/schedulers/base.py", line 1005, in _process_jobs
      jobstore_next_run_time = jobstore.get_next_run_time()
    File "/var/lib/kolla/venv/lib/python3.10/site-packages/apscheduler/jobstores/sqlalchemy.py", line 86, in get_next_run_time
      return utc_timestamp_to_datetime(next_run_time)
    File "/var/lib/kolla/venv/lib/python3.10/site-packages/apscheduler/util.py", line 179, in utc_timestamp_to_datetime
      return datetime.fromtimestamp(timestamp, utc)
  TypeError: 'decimal.Decimal' object cannot be interpreted as an integer

  Source:
  https://github.com/agronholm/apscheduler/blob/be291699755e58ff398f90b5e71bff1e163df1db/apscheduler/jobstores/sqlalchemy.py#L85

  For some reason, this line retrieves a decimal.Decimal, even though
  there’s no explicit configuration for float columns to default to
  asdecimal=False.

  This behavior aligns with the note by danms in the following commit:
  https://opendev.org/openstack/watcher/commit/d6f169197efc5b4f6c8a2e6bc38177b0641ca05c

  But danms assumes SQLAlchemy 2.0 stuff, which definetly isn't in my
  case.

  I also tested minimal Python scripts within the container to verify
  whether the issue is related to the versions of APScheduler (3.10.1)
  or SQLAlchemy (1.4.41), but I was unable to reproduce the problem. In
  those tests, float values were correctly returned from float-type
  columns.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/2108994/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list