[all] CHEF 3694 WARN: Cloning resource attributes for . from prior resource

Bug #1409921 reported by Mark Vanderwiel
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack + Chef
Fix Released
Low
Mark Vanderwiel

Bug Description

There are server places where this warning occurs during a basic all-in-one cookbook deploy. Of those, several cases are easily fixable:

Case 1: resource is re-declared when it should be looked up instead:
Example: ops-database mysql-server recipe

WARN: Cloning resource attributes for mysql_service[default] from prior resource (CHEF-3694)
WARN: Previous mysql_service[default]: /tmp/kitchen/cache/cookbooks/openstack-ops-database/recipes/mysql-server.rb:48:in `from_file'
WARN: Current mysql_service[default]: /tmp/kitchen/cache/cookbooks/openstack-ops-database/recipes/mysql-server.rb:64:in `from_file'

Line 48 the mysql_service resource is defined, and then it's redefined on 64 causing the warning.
server_resource = mysql_service node['mysql']['service_name']

Instead this should be looked up like this:
resources('mysql_service [node['mysql']['service_name']]')

Case 2: resource has duplicate name, but it trying to do something different, reiterate the same execution, or same logical resource with possible different options.

WARN: Cloning resource attributes for mysql_database[FLUSH PRIVILEGES] from prior resource (CHEF-3694)
WARN: Previous mysql_database[FLUSH PRIVILEGES]: /tmp/kitchen/cache/cookbooks/openstack-ops-database/recipes/mysql-server.rb:81:in `from_file'
WARN: Current mysql_database[FLUSH PRIVILEGES]: /tmp/kitchen/cache/cookbooks/openstack-ops-database/recipes/mysql-server.rb:103:in `from_file'

Two flush operations are wanted, should be better named (pre/post?)

WARN: Cloning resource attributes for database_user[nova] from prior resource (CHEF-3694)
WARN: Previous database_user[nova]: /tmp/kitchen/cache/cookbooks/openstack-common/libraries/database.rb:99:in `db_create_with_user'
WARN: Current database_user[nova]: /tmp/kitchen/cache/cookbooks/openstack-common/libraries/database.rb:107:in `db_create_with_user'

Different user operations, create and grant, fix names

WARN: Cloning resource attributes for package[MySQL-python] from prior resource (CHEF-3694)
WARN: Previous yum_package[MySQL-python]: /tmp/kitchen/cache/cookbooks/openstack-ops-database/recipes/mysql-client.rb:27:in `block in from_file'
WARN: Current yum_package[MySQL-python]: /tmp/kitchen/cache/cookbooks/openstack-identity/recipes/server.rb:38:in `block in from_file'

Same package installed from multiple resource declares. Can switch to make resource name specific to cookbook and use
package_name to specify package name.
Or if the cookbooks are dependent, the lower level on can do the install and the dependent one can assume it's being handled by the other.

Case 3: resource is used the same way by two different recipes in same cookbook

WARN: Cloning resource attributes for directory[/var/cache/glance] from prior resource (CHEF-3694)
WARN: Previous directory[/var/cache/glance]: /tmp/kitchen/cache/cookbooks/openstack-image/recipes/api.rb:101:in `from_file'
WARN: Current directory[/var/cache/glance]: /tmp/kitchen/cache/cookbooks/openstack-image/recipes/registry.rb:81:in `from_file'

This is a classic DRY bug that should be move into a common place. Either a common recipe or in the default recipe if needed by all the recipes.

JJ Asghar (d-jj)
Changed in openstack-chef:
status: New → Confirmed
importance: Low → Medium
Changed in openstack-chef:
status: Confirmed → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cookbook-openstack-ops-database (master)

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

Changed in openstack-chef:
status: Triaged → In Progress
JJ Asghar (d-jj)
summary: - CHEF 3694 WARN: Cloning resource attributes for . from prior resource
+ [all] CHEF 3694 WARN: Cloning resource attributes for . from prior
+ resource
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cookbook-openstack-common (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cookbook-openstack-ops-database (master)

Reviewed: https://review.openstack.org/146653
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-ops-database/commit/?id=408ad33b3f7d467f9c21dceb83f6bc4b89cbf63e
Submitter: Jenkins
Branch: master

commit 408ad33b3f7d467f9c21dceb83f6bc4b89cbf63e
Author: Mark Vanderwiel <email address hidden>
Date: Mon Jan 12 15:59:24 2015 -0600

    Cleanup CHEF-3694 cloning warnings

    * lookup mysql service resource instead of re-declaring it
    * use unique name for flush resource as it's two separate uses

    Change-Id: I8746e5001ea5cefc497049111f4d2e5e250f26de
    Partial-Bug: #1409921

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cookbook-openstack-common (master)

Reviewed: https://review.openstack.org/147598
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-common/commit/?id=15eddd2a789e91d747ba96e5b1692dbf6e1ba6cb
Submitter: Jenkins
Branch: master

commit 15eddd2a789e91d747ba96e5b1692dbf6e1ba6cb
Author: Mark Vanderwiel <email address hidden>
Date: Thu Jan 15 11:24:00 2015 -0600

    Cleanup CHEF-3694 cloning warnings

    Use unique name for database resources.

    Change-Id: Ibff252c7e35d532cd2ad133068387701ef9bb2c4
    Partial-Bug: #1409921

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cookbook-openstack-common (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/151719

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cookbook-openstack-common (master)

Reviewed: https://review.openstack.org/151719
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-common/commit/?id=3c55a8fc314a02e4547129b6689894939ff10a85
Submitter: Jenkins
Branch: master

commit 3c55a8fc314a02e4547129b6689894939ff10a85
Author: Mark Vanderwiel <email address hidden>
Date: Fri Jan 30 11:56:36 2015 -0600

    Fix bug wth missing username on database_user resource

    I missed a commit with last change to this part. The
    change was to make the resource unique, but the username attribute
    was not added to the resource so it will fail.

    Change-Id: I78e84078ab1f1e2919131a6a443a14d8815c02a6
    Related-Bug: #1409921

Changed in openstack-chef:
status: In Progress → Fix Released
Revision history for this message
Mark Vanderwiel (vanderwl) wrote :
Download full text (11.5 KiB)

Still more low hanging fruit here.

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[MySQL-python] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[MySQL-python]: /var/chef/cache/cookbooks/openstack-ops-database/recipes/mysql-client.rb:32:in `block in from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[MySQL-python]: /var/chef/cache/cookbooks/openstack-identity/recipes/server.rb:38:in `block in from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[python-keystoneclient] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[python-keystoneclient]: /var/chef/cache/cookbooks/openstack-image/recipes/api.rb:37:in `from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[python-keystoneclient]: /var/chef/cache/cookbooks/openstack-image/recipes/registry.rb:33:in `from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[curl] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[curl]: /var/chef/cache/cookbooks/openstack-image/recipes/api.rb:42:in `from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[curl]: /var/chef/cache/cookbooks/openstack-image/recipes/registry.rb:61:in `from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[MySQL-python] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[MySQL-python]: /var/chef/cache/cookbooks/openstack-identity/recipes/server.rb:38:in `block in from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[MySQL-python]: /var/chef/cache/cookbooks/openstack-image/recipes/registry.rb:68:in `block in from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[openstack-glance] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[openstack-glance]: /var/chef/cache/cookbooks/openstack-image/recipes/api.rb:48:in `block in from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[openstack-glance]: /var/chef/cache/cookbooks/openstack-image/recipes/registry.rb:75:in `block in from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[cronie] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[cronie]: /var/chef/cache/cookbooks/openstack-image/recipes/api.rb:48:in `block in from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[cronie]: /var/chef/cache/cookbooks/openstack-image/recipes/registry.rb:75:in `block in from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for yum_package[python-glanceclient] from prior resource (CHEF-3694)
[2015-03-11T19:11:26+00:00] WARN: Previous yum_package[python-glanceclient]: /var/chef/cache/cookbooks/openstack-image/recipes/api.rb:48:in `block in from_file'
[2015-03-11T19:11:26+00:00] WARN: Current yum_package[python-glanceclient]: /var/chef/cache/cookbooks/openstack-image/recipes/registry.rb:75:in `block in from_file'

[2015-03-11T19:11:26+00:00] WARN: Cloning resource attributes for directory[/var/cache/glance...

Changed in openstack-chef:
status: Fix Released → In Progress
importance: Medium → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cookbook-openstack-identity (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cookbook-openstack-identity (master)

Reviewed: https://review.openstack.org/163585
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-identity/commit/?id=f95f93970be8f5eb498e2edea78924b58c641c47
Submitter: Jenkins
Branch: master

commit f95f93970be8f5eb498e2edea78924b58c641c47
Author: Mark Vanderwiel <email address hidden>
Date: Wed Mar 11 14:36:41 2015 -0500

    WARN-3694 cleanup

    Give package resources unique names within this cookbook.
    See for 3 warning this fixes.

    Change-Id: Ia191c909b2a7e0b5376d70c32bc5dd57c2673f53
    Partial-Bug: #1409921

Changed in openstack-chef:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to cookbook-openstack-identity (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/178326

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cookbook-openstack-identity (master)

Reviewed: https://review.openstack.org/178326
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-identity/commit/?id=4f7480542d6d6bd6243eeb579f1d823bb19c641a
Submitter: Jenkins
Branch: master

commit 4f7480542d6d6bd6243eeb579f1d823bb19c641a
Author: Mark Vanderwiel <email address hidden>
Date: Tue Apr 28 13:44:58 2015 -0500

    Fix up specs to match full resource name

    The package resources were changed to have cookbook specific names
    to avoid the WARN-3694, but the specs were missed.

    Change-Id: I48715b443308adcee84005e075663e63683f474f
    Related-Bug: #1409921

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.