bad upgrading of resource reencoding

Bug #1662990 reported by gordon chung on 2017-02-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gnocchi
Fix Released
Critical
gordon chung

Bug Description

the script incorrectly looks at column rather than resource itself when deciding whether to upgrade or not

2017-02-08 17:56:43.598 WARNING oslo_config.cfg [-] Option "user_id" from group "statsd" is deprecated for removal. Its value may be silently ignored in the future.
2017-02-08 17:56:43.598 WARNING oslo_config.cfg [-] Option "project_id" from group "statsd" is deprecated for removal. Its value may be silently ignored in the future.
2017-02-08 17:56:43.909 INFO gnocchi.cli [-] Upgrading indexer <gnocchi.indexer.sqlalchemy.SQLAlchemyIndexer object at 0x7f83c992a9d0>
2017-02-08 17:56:43.924 INFO alembic.runtime.migration [-] Context impl MySQLImpl.
2017-02-08 17:56:43.925 INFO alembic.runtime.migration [-] Will assume non-transactional DDL.
2017-02-08 17:56:43.936 INFO alembic.runtime.migration [-] Context impl MySQLImpl.
2017-02-08 17:56:43.937 INFO alembic.runtime.migration [-] Will assume non-transactional DDL.
2017-02-08 17:56:43.950 INFO alembic.runtime.migration [-] Running upgrade 27d2a1d205ff -> 5c4f93e5bb4, mysql_float_to_timestamp
2017-02-08 17:56:44.282 INFO alembic.runtime.migration [-] Running upgrade 5c4f93e5bb4 -> aba5a217ca9b, merge_created_in_creator
2017-02-08 17:56:44.388 INFO alembic.runtime.migration [-] Running upgrade aba5a217ca9b -> 397987e38570, Remove slashes from original resource IDs, recompute their id with creator
2017-02-08 17:56:44.419 CRITICAL gnocchi [-] AttributeError: 'NoneType' object has no attribute 'replace'

2017-02-08 17:56:44.419 TRACE gnocchi Traceback (most recent call last):
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/bin/gnocchi-upgrade", line 10, in <module>
2017-02-08 17:56:44.419 TRACE gnocchi sys.exit(upgrade())
2017-02-08 17:56:44.419 TRACE gnocchi File "/opt/stack/gnocchi/gnocchi/cli.py", line 68, in upgrade
2017-02-08 17:56:44.419 TRACE gnocchi create_legacy_resource_types=conf.create_legacy_resource_types)
2017-02-08 17:56:44.419 TRACE gnocchi File "/opt/stack/gnocchi/gnocchi/indexer/sqlalchemy.py", line 329, in upgrade
2017-02-08 17:56:44.419 TRACE gnocchi command.upgrade(cfg, "head")
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
2017-02-08 17:56:44.419 TRACE gnocchi script.run_env()
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 416, in run_env
2017-02-08 17:56:44.419 TRACE gnocchi util.load_python_file(self.dir, 'env.py')
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
2017-02-08 17:56:44.419 TRACE gnocchi module = load_module_py(module_id, path)
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
2017-02-08 17:56:44.419 TRACE gnocchi mod = imp.load_source(module_id, path, fp)
2017-02-08 17:56:44.419 TRACE gnocchi File "/opt/stack/gnocchi/gnocchi/indexer/alembic/env.py", line 90, in <module>
2017-02-08 17:56:44.419 TRACE gnocchi run_migrations_online()
2017-02-08 17:56:44.419 TRACE gnocchi File "/opt/stack/gnocchi/gnocchi/indexer/alembic/env.py", line 78, in run_migrations_online
2017-02-08 17:56:44.419 TRACE gnocchi context.run_migrations()
2017-02-08 17:56:44.419 TRACE gnocchi File "<string>", line 8, in run_migrations
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/lib/python2.7/site-packages/alembic/runtime/environment.py", line 807, in run_migrations
2017-02-08 17:56:44.419 TRACE gnocchi self.get_context().run_migrations(**kw)
2017-02-08 17:56:44.419 TRACE gnocchi File "/usr/lib/python2.7/site-packages/alembic/runtime/migration.py", line 321, in run_migrations
2017-02-08 17:56:44.419 TRACE gnocchi step.migration_fn(**kw)
2017-02-08 17:56:44.419 TRACE gnocchi File "/opt/stack/gnocchi/gnocchi/indexer/alembic/versions/397987e38570_no_more_slash_and_reencode.py", line 119, in upgrade
2017-02-08 17:56:44.419 TRACE gnocchi new_original_resource_id = resource.original_resource_id.replace(
2017-02-08 17:56:44.419 TRACE gnocchi AttributeError: 'NoneType' object has no attribute 'replace'
2017-02-08 17:56:44.419 TRACE gnocchi

Fix proposed to branch: master
Review: https://review.openstack.org/431101

Changed in gnocchi:
status: Triaged → In Progress
gordon chung (chungg) wrote :

this bug isn't a huge issue. it will fail because of statsd resource but in general it will just end up doing a lot of encoding of stuff it doesn't need to do.

Reviewed: https://review.openstack.org/431101
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=f186f89a4b0c5b4e06c1bc07983e93f1f8ce5f15
Submitter: Jenkins
Branch: master

commit f186f89a4b0c5b4e06c1bc07983e93f1f8ce5f15
Author: gord chung <email address hidden>
Date: Wed Feb 8 18:10:00 2017 +0000

    fix bad slash migration

    we're incorrectly looking at the column when debating whether to
    reencode a resource.

    Closes-Bug: #1662990
    Change-Id: I84a78139ca6e5e049f70fd9c84033e60bc13e035

Changed in gnocchi:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/433388
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=840888be19b4c674550a98f6ca3e141c40861ac7
Submitter: Jenkins
Branch: stable/3.1

commit 840888be19b4c674550a98f6ca3e141c40861ac7
Author: gord chung <email address hidden>
Date: Wed Feb 8 18:10:00 2017 +0000

    fix bad slash migration

    we're incorrectly looking at the column when debating whether to
    reencode a resource.

    Closes-Bug: #1662990
    Change-Id: I84a78139ca6e5e049f70fd9c84033e60bc13e035
    (cherry picked from commit f186f89a4b0c5b4e06c1bc07983e93f1f8ce5f15)

This issue was fixed in the openstack/gnocchi 3.1.1 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers