You have been subscribed to a public bug:

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.

** Affects: apscheduler (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: 2023.2 apscheduler kolla sqlalchemy watcher
-- 
apscheduler retrieving decimal.Decimal via sqlalchemy 
https://bugs.launchpad.net/bugs/2108994
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to