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
remote_file resource uses Tempfile from Chef::HTTP which does not obey file_staging_uses_destdir #2401
Comments
You're gonna have to include more information, e.g. a minimal, complete verifiable example: |
Hi There
Here is the output of my chef-client run:
Thank you |
This is the code being used and it needs to accept the remote_file injecting a tempfile to write to, or we need a different API that accepts injecting a tempfile (which stream_to_tempfile could then be refactored to use): https://github.com/opscode/chef/blob/69b3c83c3fed6fb18855c44854c2de90eccf2259/lib/chef/http.rb#L370 |
This has also come up before and is a dup of at least one old ticket in the old ticketing system |
Thank you...do you have an idea of when this may get fixed. I have some time before we go into production but if I run out of time is there a workaround? |
No, not that I'm aware of, and it won't be fixed in 12.0 and unlikely to be fixed in 12.2 |
I want to replace an executable, which is used by a process. Therefore it always returns Text File Busy error. My solution was to modify def fetch
http = Chef::HTTP::Simple.new(uri, http_client_opts)
tempfile = http.streaming_request(uri, headers)
if tempfile
update_cache_control_data(tempfile, http.last_response)
tempfile.close
stagefile = Chef::FileContentManagement::Tempfile.new(new_resource).tempfile
Chef::Log.debug("Staging #{tempfile} to #{stagefile}")
::FileUtils.mv(tempfile, stagefile)
tempfile = stagefile
end
tempfile
end While it continues to use |
+1 |
+1 |
use this to inject the tempfile from Chef::FileContentManagement::Tempfile closes #2401 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I rebuilt my chef-client as it appeared this issue was resolved sometime in Sept and stated to be fixed in 12.0.0.
It still tries to stage to /tmp with this set in my client.rb file.
The text was updated successfully, but these errors were encountered: