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

bad download (source_hash) left at destination #105

Open
phil-morrell-hmlr opened this issue Feb 19, 2019 · 0 comments
Open

bad download (source_hash) left at destination #105

phil-morrell-hmlr opened this issue Feb 19, 2019 · 0 comments

Comments

@phil-morrell-hmlr
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.8.7
  • Ruby: 2.0.0
  • Distribution: rhel7
  • Module version: 1.7.3

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

wget::fetch { 'http://www.google.com/':
	destination => '/tmp/google',
}

wget::fetch { 'https://www.google.com/':
	destination => '/tmp/google_bad',
	source_hash => 0,
}

What are you seeing

$ ls /tmp/google*
/tmp/google  /tmp/google_bad

What behaviour did you expect instead

$ ls /tmp/google*
/tmp/google

Output log

Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-source_hash-check-https://www.google.com/]/returns: executed successfully
Info: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-source_hash-check-https://www.google.com/]: Scheduling refresh of Exec[wget-https://www.google.com/]
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]/returns: 2019-02-19 12:47:08 URL:https://www.google.com/ [11192] -> "/tmp/google_bad" [1]
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]/returns: md5sum: standard input: no properly formatted MD5 checksum lines found
Error: wget --no-verbose --output-document="/tmp/google_bad" "https://www.google.com/" && echo '0  /tmp/google_bad' | md5sum -c --quiet returned 1 instead of one of [0]
Error: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]/returns: change from notrun to 0 failed: wget --no-verbose --output-document="/tmp/google_bad" "https://www.google.com/" && echo '0  /tmp/google_bad' | md5sum -c --quiet returned 1 instead of one of [0]
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Main/Wget::Fetch[http://www.google.com/]/Exec[wget-http://www.google.com/]/returns: executed successfully
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-source_hash-check-https://www.google.com/]/returns: executed successfully
Info: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-source_hash-check-https://www.google.com/]: Scheduling refresh of Exec[wget-https://www.google.com/]
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]/returns: 2019-02-19 12:48:41 URL:https://www.google.com/ [11213] -> "/tmp/google_bad" [1]
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]/returns: md5sum: standard input: no properly formatted MD5 checksum lines found
Error: wget --no-verbose --output-document="/tmp/google_bad" "https://www.google.com/" && echo '0  /tmp/google_bad' | md5sum -c --quiet returned 1 instead of one of [0]
Error: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]/returns: change from notrun to 0 failed: wget --no-verbose --output-document="/tmp/google_bad" "https://www.google.com/" && echo '0  /tmp/google_bad' | md5sum -c --quiet returned 1 instead of one of [0]
Notice: /Stage[main]/Main/Wget::Fetch[https://www.google.com/]/Exec[wget-https://www.google.com/]: Triggered 'refresh' from 1 events

Any additional information you'd like to impart

The reason for specifying the source_hash was to ensure the downloaded file was correct. This is especially important for executables. Current behaviour enforces the md5sum before the download, but not after (beyond notifying the puppet run).

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

1 participant