The Puppet Labs Issue Tracker has Moved:

Bug #8415

script tmp file does not always exist when we try to scp it

Added by Dan Bode over 3 years ago. Updated about 1 year ago.

Status:ClosedStart date:07/13/2011
Priority:HighDue date:
Assignee:Dan Bode% Done:


Category:cloud provisioner
Target version:-
Keywords: cloud_provisioner Affected URL:
Branch: Affected PE version:

We've Moved!

Ticket tracking is now hosted in JIRA:

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


The symptom of this issue is the following error message:

err: No such file or directory - /var/folders/co/coFoByf5E3GCBRvVpQOD6E+++TI/-Tmp-/install_script20110713-12603-hrci3m-0
err: Try 'puppet help node install' for usage

The problem appears to be that I was writing to a temporary file without closing it properly.

The following code seems to resolve the issue:

-      tmp_install_script ='install_script').path
-, 'w') do |fh|
-        fh.write(install_script)
+      # create a temp file to write compiled script to
+      # capture the name of the path as tmp_install_script
+      tmp_install_script = begin
+        f ='install_script')
+        f.write(install_script)
+        f.path
+      ensure
+        f.close


#1 Updated by Dan Bode over 3 years ago

  • Branch set to

#2 Updated by Jeff McCune over 3 years ago

  • Category set to cloudpack
  • Status changed from Unreviewed to Merged - Pending Release
  • Assignee set to Dan Bode
  • Target version set to 0.6.0


This has been merged into master as:

(Dan says he has tests pending, which will be another merge)

commit fe2449365d581e888961b4d29e04b87ffc3d4e75
Merge: ac2e540 b11d6a3
Author: Jeff McCune 
Date:   Thu Jul 14 14:06:20 2011 -0700

    Merge branch 'issue/master/8415_fix_tmp_file'
    * issue/master/8415_fix_tmp_file:
      (#8415) Clean up tmp script file

commit b11d6a31097d5ef5248716cb42ad9debbbdc21f3
Author: Dan Bode 
Date:   Wed Jul 13 19:13:38 2011 -0700

    (#8415) Clean up tmp script file
    Previously, I was using File to write to a file
    that I had created with Tempfile.
    This appeared to cause problems b/c I had not
    properly closed the Tempfile handle.
    Issue is resolved by using the Tempfile API for both
    creation and writing the file.
    I have also added code that explicitly closes the file
    Reviewed-by: Jeff McCune

#3 Updated by Jeff McCune over 3 years ago

  • Status changed from Merged - Pending Release to Closed

#4 Updated by Charlie Sharpsteen about 1 year ago

  • Project changed from Cloud-Provisioner to Puppet Enterprise (Public)
  • Category deleted (cloudpack)
  • Target version deleted (0.6.0)

#5 Updated by Kenn Hussey about 1 year ago

  • Category set to cloud provisioner

Also available in: Atom PDF