Closed vchepkov closed 3 years ago
This is probably resolved by #75
Ideally it would fail a bit earlier, but it does fail, so I think we can close this
Starting: plan peadm::upgrade
Starting: task peadm::trusted_facts on puppet.chepkov.lan
Finished: task peadm::trusted_facts with 0 failures in 3.59 sec
Starting: task peadm::precheck on puppet.chepkov.lan
Finished: task peadm::precheck with 0 failures in 1.28 sec
Starting: plan peadm::util::retrieve_and_upload
Starting: task peadm::download on local://localhost
Finished: task peadm::download with 0 failures in 0.43 sec
Starting: task peadm::filesize on local://localhost
Finished: task peadm::filesize with 0 failures in 0.11 sec
Starting: task peadm::filesize on puppet.chepkov.lan
Finished: task peadm::filesize with 0 failures in 1.62 sec
Starting: file upload from /opt/staging/puppet-enterprise-2020.1.0-el-8-x86_64.tar.gz to /tmp/puppet-enterprise-2020.1.0-el-8-x86_64.tar.gz on puppet.chepkov.lan
Finished: file upload from /opt/staging/puppet-enterprise-2020.1.0-el-8-x86_64.tar.gz to /tmp/puppet-enterprise-2020.1.0-el-8-x86_64.tar.gz with 0 failures in 1.24 sec
Finished: plan peadm::util::retrieve_and_upload in 3.43 sec
Starting: task service on puppet.chepkov.lan
Finished: task service with 0 failures in 2.61 sec
Starting: task peadm::pe_install on puppet.chepkov.lan
Finished: task peadm::pe_install with 1 failure in 1.36 sec
Finished: plan peadm::upgrade in 12.34 sec
Finished: plan maint::upgrade in 16.32 sec
Failed on puppet.chepkov.lan:
The task failed with exit code 127:
tar: This does not look like a tar archive
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
dirname: missing operand
Try 'dirname --help' for more information.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
/bin/bash: /tmp//puppet-enterprise-installer: No such file or directory
Failed on 1 target: puppet.chepkov.lan
Ran on 1 target
It might be sufficient to just set -e
at the top of the bash script. I haven't tested or considered if there are any intermediate commands that are expected to return non-zero exit codes in normal circumstances. If we were able to use set -e
, it would fail immediately as soon as any command failed.
yep, that could be the proper solution.
Unfortunately, cloudfront returns 200 even when you download a garbage instead of archive, not much can be done here
This experience should now be further improved by error handling added to peadm::download in #92.
Fixed by #152
Seems I have started upgrading too early, file hasn't been properly uploaded on yet, so I got this content (consistently)
upgrade plan proceeded all the way to task peadm::pe_install and it executed successfully as well, without doing an upgrade.
debugging of the task showed that results of the tar command are ignored: