Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid relationship" when installing plugin #74

Closed
neoice opened this issue Jan 6, 2014 · 9 comments
Closed

"Invalid relationship" when installing plugin #74

neoice opened this issue Jan 6, 2014 · 9 comments

Comments

@neoice
Copy link

neoice commented Jan 6, 2014

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: File[/var/lib/jenkins/plugins/swarm.hpi] { require => Exec[download-swarm] }, because Exec[download-swarm] doesn't seem to be in the catalog

the offending code seems to be L51 on plugin.pp:

exec { download-${name} } being wrapped in an if statement. this results in the Exec["download-${name}"] not being part of the catalog making require => Exec["download-${name}"] impossible to fulfill.

@matthewbarr
Copy link
Contributor

Well, if you'd like to fix it, feel free :) (hint, use a before attribute on the exec resource.)

Else, i'll fix it when i have time soon.

@neoice
Copy link
Author

neoice commented Jan 6, 2014

honestly, I find this Puppet code pretty intimidating or I probably would have hacked up a pull request. I'm not terribly familiar with the stdlib functions or the create_resource idiom :/

@matthewbarr
Copy link
Contributor

OK, I was remembering the original code I wrote for this, vs the new shiny code that @jchristi wrote.

Can you give me the way you're calling this? are you just including jenkins::master?
What about the output of facter -p|grep jenkins_plugins

@neoice
Copy link
Author

neoice commented Jan 6, 2014

I just have a simple wrapper class (example_jenkins::master) applied to my host. we maintain our own java module, but it looks like setting install_java to false makes those calls get skipped. if needed, I can test with the puppetlabs-java module too.

# hiera data
---
jenkins::install_java: false
jenkins::swarm_version: 1.9

# example_jenkins::master.pp
class example_jenkins::master {
  # we have our own java class
  include 'java::example'
  include 'jenkins'
  include 'jenkins::master'
}

# facter output
root@uber-jenkins:~# facter -p|grep jenkins_plugins
jenkins_plugins => credentials 1.9.3, mailer 1.6, subversion 1.54, ldap 1.6, translation 1.10, swarm 1.9, javadoc 1.1, ssh-slaves 1.5, external-monitor-job 1.2, cvs 2.11, ssh-credentials 1.6, pam-auth 1.1, matrix-auth 1.1, maven-plugin 2.1, ant 1.2,

@matthewbarr
Copy link
Contributor

What this code is supposed to do is:

  1. Facter is supposed to get a list of the currently installed jenkins plugins.
  2. The if on L51 searches the array of installed plugins, and makes sure the one you've requested isn't installed already.
  3. And... the issue is that the exec may not be there, as you said. Might be best to just move the File resource into the if. Basically, we'd only do the exec & file if the plugin isn't installed already with the right version.

@jchristi
Copy link
Contributor

jchristi commented Jan 6, 2014

@matthewbarr my PR does as you suggest.

matthewbarr added a commit that referenced this issue Jan 6, 2014
Fix for #74 - 'Invalid relationship' when installing plugin
@jchristi
Copy link
Contributor

jchristi commented Jan 7, 2014

@neoice can you confirm #76 fixes this issue?

@neoice
Copy link
Author

neoice commented Jan 7, 2014

% git remote -v
origin  https://github.com/jchristi/puppet-jenkins (fetch)
origin  https://github.com/jchristi/puppet-jenkins (push)
commit 73fc86cb7a4deea43d1312839f1afe38648129d3

all my nodes are green :)

@jchristi
Copy link
Contributor

jchristi commented Jan 7, 2014

Someone with permissions close this issue. @matthewbarr @neoice or other?

@neoice neoice closed this as completed Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants