gnocchixyz / gnocchi

Timeseries database
Apache License 2.0
302 stars 85 forks source link

Execution of the gnocchi-upgrade failed with an old sqlalchemy #1349

Closed LazyMan145 closed 6 months ago

LazyMan145 commented 1 year ago

gnocchi-upgrade built with constraint of sqlalchemy 1.4.23 failed with:


2023-10-14 20:50:21,394 [1035] INFO     gnocchi.cli.manage: Upgrading incoming storage RedisStorage: Redis<SentinelConnectionPool<service=kolla(master)>,
2023-10-14 20:50:21,396 [1035] CRITICAL root: Traceback (most recent call last):,
  File \"/var/lib/kolla/venv/bin/gnocchi-upgrade\", line 8, in <module>,
    sys.exit(upgrade())",
  File \"/var/lib/kolla/venv/lib/python3.8/site-packages/gnocchi/cli/manage.py\", line 79, in upgrade,
    and not index.list_archive_policies(),
  File \"/var/lib/kolla/venv/lib/python3.8/site-packages/gnocchi/indexer/sqlalchemy.py\", line 635, in list_archive_policies,
    return list(session.scalars(stmt).all()),
AttributeError: 'Session' object has no attribute 'scalars',```
tobias-urdin commented 1 year ago

Hello @LazyMan145 thank for your find – I'm ok with merging the one for master and stable/4.6 branches, the other ones does not include that code since it was added for SQLAlchemy 2.0 support.

LazyMan145 commented 1 year ago

Hello, thank for clarification, will rebase broken code, but actually code in stable/4.4 and stable/4.5 braches also needed as described in the commit messages.