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

Getting error while running puppet archive. #205

Closed
atmesh opened this issue Aug 30, 2016 · 6 comments
Closed

Getting error while running puppet archive. #205

atmesh opened this issue Aug 30, 2016 · 6 comments

Comments

@atmesh
Copy link

atmesh commented Aug 30, 2016

I am using puppet-archive to download my file from a repository.

archive { "/usrdata/archive/${tomcat::jreversion}":
  ensure       => present,
  extract      => true,
  extract_path => '/usrdata/apps/java/',
  source       => $tomcat::params::jredownloadpath,
  creates      => "/usrdata/apps/java/${tomcat::jdkversion}",
}

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.8.7
  • Ruby: 2.0.0
  • Module version: 1.1.0

How to reproduce (e.g Puppet code you use)

I am using puppet-archive to download my file from a repository.

archive { "/usrdata/archive/${tomcat::jreversion}":
  ensure       => present,
  extract      => true,
  extract_path => '/usrdata/apps/java/',
  source       => $tomcat::params::jredownloadpath,
  creates      => "/usrdata/apps/java/${tomcat::jdkversion}",
}

What are you seeing

But I get the following error on puppet run -:

Error: Could not set 'present' on ensure: no implicit conversion of nil into String at 26:/etc/puppet/modules/tomcat/manifests/javaora.pp
Error:Could not set 'present' on ensure: no implicit conversion of nil into String at 26:/etc/puppet/modules/tomcat/manifests/javaora.pp Wrapped exception: no implicit conversion of nil into String Error: /Stage[main]/Tomcat::Javaora/Archive[/usrdata/archive/jre-7]/ensure: change from absent to present failed: Could not set 'present' on ensure: no implicit conversion of nil into String at 26:/etc/puppet/modules/tomcat/manifests/javaora.pp

What behaviour did you expect instead

I expected it to download the archived file from the source and extract at desired location

@nanliu
Copy link
Contributor

nanliu commented Aug 31, 2016

Can you run this with --trace and provide line 26 of javaora.pp (or highlight the line in the manifest you provided)

@atmesh
Copy link
Author

atmesh commented Aug 31, 2016

@nanliu the closing curly brace just below creates is line:26 of my manifest.

@atmesh
Copy link
Author

atmesh commented Aug 31, 2016

can you explain the possible reason why I am experiencing this behaviour? Just hint on what could be wrong!

@nanliu
Copy link
Contributor

nanliu commented Aug 31, 2016

It's an issue converting a string, most likely source parameter is nil, or the conversion is failing to process part of that string. You can add a notify resource, and expand the variable:

notify { $tomcat::params::jredownloadpath: }

Can't provide more detail without the --trace to pinpoint the ruby source code line number and a stack trace. It would be much more helpful if you can provide an example resource without any puppet parameters (the direct values for the resource).

@nanliu
Copy link
Contributor

nanliu commented Aug 31, 2016

So I did a local test and your source parameter is undefined. I'll write a patch to make sure we raise a more meaningful error.

nanliu added a commit to nanliu/puppet-archive that referenced this issue Aug 31, 2016
nanliu added a commit to nanliu/puppet-archive that referenced this issue Aug 31, 2016
nanliu added a commit to nanliu/puppet-archive that referenced this issue Aug 31, 2016
@atmesh
Copy link
Author

atmesh commented Aug 31, 2016

Seems like it is not able to find the path! Closing the issue.

@atmesh atmesh closed this as completed Aug 31, 2016
alexjfisher added a commit that referenced this issue Aug 31, 2016
Fix GH-205 raise exception on bad source paramters
randradas pushed a commit to randradas/puppet-archive that referenced this issue Oct 30, 2016
cegeka-jenkins pushed a commit to cegeka/puppet-archive that referenced this issue Mar 26, 2021
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

2 participants