Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-19057

"cinder-manage quota check/sync" fails in RHOSO 18

XMLWordPrintable

    • 0
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • openstack-cinder-22.3.1-18.0.20251112144731.ae2d250.el9osttrunk
    • rhos-storage-cinder
    • None
    • Hide
      Accurate quota management in the Block Storage service::

      Before this update, the `cinder-manage quota check` and `cinder-manage quota sync` commands failed when no `project-id` argument was specified, preventing accurate quota management in the Block Storage service (cinder). This update corrects the error in quota management commands, ensuring accurate management of quota usage, even when no `project-id` argument is specified.
      Show
      Accurate quota management in the Block Storage service:: Before this update, the `cinder-manage quota check` and `cinder-manage quota sync` commands failed when no `project-id` argument was specified, preventing accurate quota management in the Block Storage service (cinder). This update corrects the error in quota management commands, ensuring accurate management of quota usage, even when no `project-id` argument is specified.
    • Bug Fix
    • In Progress
    • Pending Verification (cinder)
    • 1
    • Important

      To Reproduce Steps to reproduce the behavior:

      1. Deploy RHOSO 18
      2. "cinder-manage quota check" command and "cinder-manage quota sync" command fail with the following errors.
      [root@util ~]# oc rsh cinder-scheduler-0 cinder-manage --config-dir /etc/cinder/cinder.conf.d quota check 
      Defaulted container "cinder-scheduler" out of: cinder-scheduler, probe
      2025-08-13 04:57:03.249 69 DEBUG oslo_db.sqlalchemy.engines [None req-74df24cd-f64d-4470-84ab-b141b4b5ea27 - - - - - -] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/lib/python3.9/site-packages/oslo_db/sqlalchemy/engines.py:335
      2025-08-13 04:57:03.347 69 CRITICAL cinder [None req-74df24cd-f64d-4470-84ab-b141b4b5ea27 - - - - - -] Unhandled error: sqlalchemy.exc.ArgumentError: Textual column expression 'project_id' should be explicitly declared with text('project_id'), or use column('project_id') for more specificity
      2025-08-13 04:57:03.347 69 ERROR cinder Traceback (most recent call last):
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/bin/cinder-manage", line 10, in <module>
      2025-08-13 04:57:03.347 69 ERROR cinder     sys.exit(main())
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 1160, in main
      2025-08-13 04:57:03.347 69 ERROR cinder     fn(**fn_kwargs)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 363, in check
      2025-08-13 04:57:03.347 69 ERROR cinder     result = self._check_sync(project_id, do_fix=False)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 505, in _check_sync
      2025-08-13 04:57:03.347 69 ERROR cinder     projects = self._get_quota_projects(ctxt, project_id)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib/python3.9/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1044, in wrapper
      2025-08-13 04:57:03.347 69 ERROR cinder     return fn(*args, **kwargs)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 410, in _get_quota_projects
      2025-08-13 04:57:03.347 69 ERROR cinder     projects = db_api.model_query(
      2025-08-13 04:57:03.347 69 ERROR cinder   File "<string>", line 2, in with_entities
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/sql/base.py", line 110, in _generative
      2025-08-13 04:57:03.347 69 ERROR cinder     x = fn(self, *args, **kw)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/orm/query.py", line 1452, in with_entities
      2025-08-13 04:57:03.347 69 ERROR cinder     self._set_entities(entities)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/orm/query.py", line 187, in _set_entities
      2025-08-13 04:57:03.347 69 ERROR cinder     self._raw_columns = [
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/orm/query.py", line 188, in <listcomp>
      2025-08-13 04:57:03.347 69 ERROR cinder     coercions.expect(
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 188, in expect
      2025-08-13 04:57:03.347 69 ERROR cinder     resolved = impl._literal_coercion(
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 388, in _literal_coercion
      2025-08-13 04:57:03.347 69 ERROR cinder     return self._text_coercion(element, argname, **kw)
      2025-08-13 04:57:03.347 69 ERROR cinder   File "/usr/lib64/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 841, in _text_coercion
      2025-08-13 04:57:03.347 69 ERROR cinder     raise exc.ArgumentError(
      2025-08-13 04:57:03.347 69 ERROR cinder sqlalchemy.exc.ArgumentError: Textual column expression 'project_id' should be explicitly declared with text('project_id'), or use column('project_id') for more specificity
      2025-08-13 04:57:03.347 69 ERROR cinder 
      command terminated with exit code 1
      
      [root@util ~]# oc rsh cinder-scheduler-0 cinder-manage --config-dir /etc/cinder/cinder.conf.d quota check --project-id 1b0c5ef1627147d3b3d77870f1598412
      Defaulted container "cinder-scheduler" out of: cinder-scheduler, probe
      2025-08-13 04:56:57.044 66 DEBUG oslo_db.sqlalchemy.engines [None req-41a2d8eb-39cf-4ce9-a264-585efc078447 - - - - - -] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/lib/python3.9/site-packages/oslo_db/sqlalchemy/engines.py:335
      Processing quota usage for project 1b0c5ef1627147d3b3d77870f1598412
      2025-08-13 04:56:57.157 66 CRITICAL cinder [None req-41a2d8eb-39cf-4ce9-a264-585efc078447 - - - - - -] Unhandled error: AttributeError: module 'cinder.context' has no attribute 'session'
      2025-08-13 04:56:57.157 66 ERROR cinder Traceback (most recent call last):
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/bin/cinder-manage", line 10, in <module>
      2025-08-13 04:56:57.157 66 ERROR cinder     sys.exit(main())
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 1160, in main
      2025-08-13 04:56:57.157 66 ERROR cinder     fn(**fn_kwargs)
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 363, in check
      2025-08-13 04:56:57.157 66 ERROR cinder     result = self._check_sync(project_id, do_fix=False)
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 510, in _check_sync
      2025-08-13 04:56:57.157 66 ERROR cinder     discrepancy &= self._check_project_sync(
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1044, in wrapper
      2025-08-13 04:56:57.157 66 ERROR cinder     return fn(*args, **kwargs)
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 536, in _check_project_sync
      2025-08-13 04:56:57.157 66 ERROR cinder     usages = self._get_usages(context, resources, project)
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/cmd/manage.py", line 426, in _get_usages
      2025-08-13 04:56:57.157 66 ERROR cinder     usages = db_api.model_query(
      2025-08-13 04:56:57.157 66 ERROR cinder   File "/usr/lib/python3.9/site-packages/cinder/db/sqlalchemy/api.py", line 294, in model_query
      2025-08-13 04:56:57.157 66 ERROR cinder     query = context.session.query(model, *args)
      2025-08-13 04:56:57.157 66 ERROR cinder AttributeError: module 'cinder.context' has no attribute 'session'
      2025-08-13 04:56:57.157 66 ERROR cinder 
      command terminated with exit code 1 

      Expected behavior

      • "cinder-manage quota check/sync" succeeds without errors

      Bug impact

      • We cannot fix Cinder quota usage when it shows wrong quota usage

      Known workaround

      • Nothing

      Additional context

              eharney@redhat.com Eric Harney
              rhn-support-yatanaka Yamato Tanaka
              Yosi Ben Shimon Yosi Ben Shimon
              rhos-storage-cinder
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated: