Red Hat Bugzilla – Bug 1003969
Failure to delete non-existent cartridge ERBs during processing should be non-fatal
Last modified: 2015-05-14 19:27:34 EDT
Description of problem:
When rendering ERBs for cartridges (https://github.com/openshift/origin-server/blob/master/node/lib/openshift-origin-node/model/v2_cart_model.rb#L660), a failure to delete the input file due to the file no longer being present (a possible race condition inherent to all File.exists checks) should not raise an exception back up the stack.
Version-Release number of selected component (if applicable):
Difficult; it's not clear under what circumstances the input is getting deleted following the actual ERB rendering but prior to the explicit delete call, but it happens every release during upgrades for some small portion of gear upgrades.
Steps to Reproduce:
"No such file or directory" exception from File.delete call to the input erb file.
Commit pushed to master at https://github.com/openshift/origin-server
Bug 1003969: Don't raise if processed ERBs no longer exist to delete
Checked on devenv-stage_461,
Manually delete the erb files from the gear home dir, when the gear dir just being created.
Check the log for the ERB processing. It will skip the Rendering ERB step and will not throw an exception.
For my cartridge, there are 5 erbs in total, and I deleted them manually in the middle of the process.
It will jump to the 'install' step directly.
September 04 02:01:54 INFO Processing ERB templates for php
September 04 02:01:55 INFO Shell command '/sbin/runuser -s /bin/sh 293753520653506126544896 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c0,c504' /bin/sh -c \"/usr/bin/oo-erb -S 2 -- /var/lib/openshift/293753520653506126544896/php/metadata/jenkins_shell_command.erb > /var/lib/openshift/293753520653506126544896/php/metadata/jenkins_shell_command\""' ran. rc=0 out=
September 04 02:01:55 INFO Running install for 293753520653506126544896/php
Move bug to verified.