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

Could not retrieve information from environment production source #34

Open
danielburrell opened this issue Oct 12, 2014 · 3 comments
Open

Comments

@danielburrell
Copy link

Hi, when performing the following sequence I get the error shown:

root@localhost:/opt# cat d
wget::fetch { 'jungle':
source => 'https://www.dropbox.com/s/brk7zeszv3a8k2o/jungle.deb?dl=1',
destination => '/home/dan/jungle.deb',
cache_dir => '/var/cache/wget',
cache_file => 'jungle.deb',
}

root@localhost:/opt# puppet apply d
Notice: Compiled catalog for localhost.members.linode.com in environment production in 0.20 seconds
Notice: /Stage[main]/Main/Wget::Fetch[jungle]/Exec[wget-jungle]/returns: executed successfully
Error: /Stage[main]/Main/Wget::Fetch[jungle]/File[/home/dan/jungle.deb]: Could not evaluate: Could not retrieve information from environment production source(s) file:/var/cache/wget/jungle.deb
Notice: Finished catalog run in 2.97 seconds

@carlossg
Copy link
Member

/home/dan, /var/cache/wget/ exist?
try with --debug

@kgeis
Copy link

kgeis commented Jan 27, 2015

I'm having the same problem. This is happening because it gets cached as /var/cache/wget/jungle.deb?dl=1 and then it fails to find it in the cache as jungle.deb.

@enemarke
Copy link

This is happening because wget.
When wget uses options -N and -P it does not support --output-document and the $cache_file is not being used in the wget command. When puppet tries to create the file is will look for a file named like $cache_file, which does not exist.
Leaving out the $cache_file will work in cases where the wget url does not include a query path.

in fetch.pp line 141 the $cache_file only takes the path from the wget url and not the query. I have tried updating the line to:

undef   => inline_template('<%= require \'uri\'; require \'shellwords\'; File.basename(URI::parse(@source).path) -%>?<%= Shellwords.shellescape(File.basename(URI::parse(@source).query))-%>'),

But I cannot make it to work. Puppet complains about the escaped path and without the escaping linux cannot find the file.

Possible hack would be to make an exec that copies the cached file to a file name that puppet can handle.
Also note that the above will fail if the wget url does not have a query part. This should also be taken into consideration.

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

4 participants