Unable to sync plugin after syncing with new plugin_name

Bug #1649568 reported by Ekaterina Khomyakova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Alexander Kislitsky
Mitaka
Fix Released
High
Alexander Kislitsky
Newton
Fix Released
High
Alexey Shtokolov

Bug Description

Fuel 9.2 #600

Steps to reproduce:
  1. Install any plugin to fuel master node
  2. Change name to any other in metadata (/var/www/nailgun/plugins/${plugin}/metadata.yaml)
  3. `fuel plugins --sync` (Plugins were successfully synchronized.)
  4. `fuel plugins --sync`

Expected results:
  Plugins were successfully synchronized.

Actual result:
  500 Server Error: Internal Server Error for url: http://10.109.0.2:8000/api/v1/plugins/sync/ (Unexpected exception, please check logs)

logs:
  ...
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 214, in _assert_active
    % self._rollback_exception
InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.IntegrityError) duplicate key value violates unique constraint "_name_version_unique"
DETAIL: Key (name, version)=(fuel-plugin, 3.2.0) already exists.
 [SQL: 'INSERT INTO plugins (name, title, version, description, releases, fuel_version, groups, authors, licenses, homepage, package_version, is_hotpluggable) VALUES (%(name)s, %(title)s, %(version)s, %(description)s, %(releases)s, %(fuel_version)s, %(groups)s, %(authors)s, %(licenses)s, %(homepage)s, %(package_version)s, %(is_hotpluggable)s) RETURNING plugins.id'] [parameters: {'name': 'fuel-plugin', 'releases': '[{"repository_path": "repositories/ubuntu", "version": "mitaka-9.0", "os": "ubuntu", "mode": ["ha"], "deployment_scripts_path": "deployment_scripts/"}]', 'title': '...', 'package_version': '4.0.0', 'is_hotpluggable': False, 'version': '3.2.0', 'fuel_version': '["9.0"]', 'groups': '["network"]', 'authors': '["..."]', 'licenses': '["..."]', 'homepage': '...', 'description': '...'}]

Additional information:
  Even if you remove plugin, this error will appear after second --sync. Workaround is to remove directory with plugin (/var/www/nailgun/plugins/${plugin}). But after this you can not install rpm with this plugin anymore.

Tags: area-python
Revision history for this message
Ekaterina Khomyakova (ekhomyakova) wrote :
description: updated
description: updated
Changed in fuel:
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
status: New → Confirmed
tags: added: area-python
Changed in fuel:
importance: Medium → High
Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Alexander Kislitsky (akislitsky)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

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

Changed in fuel:
status: Confirmed → In Progress
Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
milestone: 9.2 → 11.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/414207
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=f7debcb38d63e6c3f9f38fa9d8bb4e7457d7cf91
Submitter: Jenkins
Branch: master

commit f7debcb38d63e6c3f9f38fa9d8bb4e7457d7cf91
Author: Alexander Kislitsky <email address hidden>
Date: Thu Dec 22 18:47:09 2016 +0300

    Plugin rename is denied

    Plugin name is uses as identifier in sync operations. Plugins data
    on the file system can be found only by it's name, so renaming of
    the plugin must be denied.

    Change-Id: I2864537770f27d3b95d0d093900c1a787fef107c
    Closes-Bug: #1649568

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/418315

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/418316

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/newton)

Reviewed: https://review.openstack.org/418316
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=849031ecd8083822ce586ab9f212775e80e014c9
Submitter: Jenkins
Branch: stable/newton

commit 849031ecd8083822ce586ab9f212775e80e014c9
Author: Alexander Kislitsky <email address hidden>
Date: Thu Dec 22 18:47:09 2016 +0300

    Plugin rename is denied

    Plugin name is uses as identifier in sync operations. Plugins data
    on the file system can be found only by it's name, so renaming of
    the plugin must be denied.

    Change-Id: I2864537770f27d3b95d0d093900c1a787fef107c
    Closes-Bug: #1649568
    (cherry picked from commit f7debcb38d63e6c3f9f38fa9d8bb4e7457d7cf91)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/mitaka)

Reviewed: https://review.openstack.org/418315
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=1fb731d26161eb47dbe880003145901fb9f65e11
Submitter: Jenkins
Branch: stable/mitaka

commit 1fb731d26161eb47dbe880003145901fb9f65e11
Author: Alexander Kislitsky <email address hidden>
Date: Thu Dec 22 18:47:09 2016 +0300

    Plugin rename is denied

    Plugin name is uses as identifier in sync operations. Plugins data
    on the file system can be found only by it's name, so renaming of
    the plugin must be denied.

    Change-Id: I2864537770f27d3b95d0d093900c1a787fef107c
    Closes-Bug: #1649568
    (cherry picked from commit f7debcb38d63e6c3f9f38fa9d8bb4e7457d7cf91)

tags: added: on-verification
Revision history for this message
Ekaterina Shutova (eshutova) wrote :

Verified on 9.2 snapshot #750.
Got ERROR when trying to synchronize:
[root@nailgun ~]# fuel plugins --sync
400 Client Error: Bad Request for url: http://10.109.15.2:8000/api/v1/plugins/sync/ (Plugin can't be renamed. Trying to change name of the plugin fuel_plugin_hidden to fuel_plugin_hidden_01)

tags: removed: on-verification
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 11.0.0.0rc1

This issue was fixed in the openstack/fuel-web 11.0.0.0rc1 release candidate.

Revision history for this message
Ekaterina Khomyakova (ekhomyakova) wrote :

Verified on Fuel 10 #1575

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.