Problem with exported resources...

130 views
Skip to first unread message

Krist van Besien

unread,
Jan 9, 2014, 4:59:17 AM1/9/14
to puppet...@googlegroups.com
Hello all,

I am configuring a openstack swift cluster using puppet. For this I use exported resources, and here I run in to a problem...

I'm getting an error like this:


Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Another local or imported resource exists with the type and title Swift::Ringsync[account] on node dc2-05

Thought I could solve this by purging the exported resources, like described here:
https://ask.puppetlabs.com/question/88/how-can-i-purge-exported-resources-from-puppetdb/

However this did not do anything. It didn't even change the behaviour of puppet on my node in any way.

Am I wrong in my assumptions on what causes this problem? If so, what is the real cause and what do I do about it?

Krist



Stephan

unread,
Jan 9, 2014, 9:56:22 AM1/9/14
to puppet...@googlegroups.com
Sounds like the right assumption ... did you try "puppet node clean" as well?

jcbollinger

unread,
Jan 9, 2014, 12:20:08 PM1/9/14
to puppet...@googlegroups.com


Stale exported resources could contribute to such a problem, but they would not really the root cause, and they might not be a cause at all.

 
If so, what is the real cause and what do I do about it?



The error message says that the problem is two distinct declarations of a resource "Swift::Ringsync[account]".  The most likely cause is that you are both collecting that resource and declaring it locally for the same node.  For example you may be doing something like this:

swift::ringsync { 'account':
  # properties
}

Swift::Ringsync <<| |>>

where some node has exported a Swift::Ringsync['account'].

Purging exported resources would normally be an effective -- albeit not necessarily correct -- solution to such a problem, at least for one run.  If purging doesn't solve the problem even temporarily then it's likely that the node in question is the one exporting the resource, too.  In that case the correct solution would be for the node to rely on collecting the resource it itself exported instead of redeclaring it as a local resource:

# This exported resource assumed already present
@@swift::ringsync { 'account':
  # properties
}

# Removed the local redeclaration of Swift::Ringsync['account']

# Still want to collect all these,
# including those declared by this node:
Swift::Ringsync <<| |>>


John

Krist van Besien

unread,
Jan 10, 2014, 2:24:07 AM1/10/14
to puppet...@googlegroups.com


On Thursday, January 9, 2014 6:20:08 PM UTC+1, jcbollinger wrote:



The error message says that the problem is two distinct declarations of a resource "Swift::Ringsync[account]".  The most likely cause is that you are both collecting that resource and declaring it locally for the same node.  For example you may be doing something like this:


Thank you for your explanation. I will try out your suggestions.

Krist
 
Reply all
Reply to author
Forward
0 new messages