File copy from Windows Share

Hi Chefs
I still cannot copy the file :frowning:
I’ve got round the path limitation thanks to Carlos’s suggestion but I’m getting a permission error.
I’m just using ruby libraries to copy the file here; FileUtils.cp_r(source, dest)
I’m getting the below error in the debug long from chef client
Using pure ruby it works, the path is fine. Access from the console on the node below works fine.

Can anyone shed any light on how this process happens via WinRM? Could it be an issue with the process on the node running with insufficient permissions?
Any further information that would be useful for me to add?

[2014-08-07T12:43:48-04:00] ERROR: Running exception handlers
[2014-08-07T12:43:48-04:00] ERROR: Exception handlers complete
[2014-08-07T12:43:48-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2014-08-07T12:43:48-04:00] DEBUG: Errno::EACCES: Permission denied - \ATLQ-CHEF01.airwatch.qa\server.installs\dll.drops\7.1_HF05_Overlay_SAML_fix.zip<file:///\ATLQ-CHEF01.airwatch.qa\server.installs\dll.drops\7.1_HF05_Overlay_SAML_fix.zip>

Thanks
Chris

Le 2014-08-07 18:52, ChristopherHall@air-watch.com a écrit :

Hi Chefs

I still cannot copy the file L

I've got round the path limitation thanks to Carlos's suggestion but I'm getting a permission error.

I'm just using ruby libraries to copy the file here; FileUtils.cp_r(source, dest)

I'm getting the below error in the debug long from chef client

Using pure ruby it works, the path is fine. Access from the console on the node below works fine.

Can anyone shed any light on how this process happens via WinRM? Could it be an issue with the process on the node running with insufficient permissions?

Any further information that would be useful for me to add?

[2014-08-07T12:43:48-04:00] ERROR: Running exception handlers

[2014-08-07T12:43:48-04:00] ERROR: Exception handlers complete

[2014-08-07T12:43:48-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out

[2014-08-07T12:43:48-04:00] DEBUG: Errno::EACCES: Permission denied - \ATLQ-CHEF01.airwatch.qaserver.installsdll.drops7.1_HF05_Overlay_SAML_fix.zip [1]

Thanks

Chris

Hi,

Your problem is probably the multi-hop limitation in winrm

I did get around this using the mount ressource and a file resource to
manage file from network shares (The latest chef client (11.14.2 IIRC)
has a fix about the file uri file:///c:/ for ruby cp to work fine.)

Hope this helps.

Links:

[1]
file:///\ATLQ-CHEF01.airwatch.qaserver.installsdll.drops7.1_HF05_Overlay_SAML_fix.zip

Hi,
I’m not sure what is going on here.
I’ve tried the original recipe with the mods recommended by Microsoft in their article on getting WinRM to perform doublehops but to no avail, same error everytime.

I’ve also tried to use mount and file:
“pathto = “\dll.drops\” + fname
#copy = “\\” + managementServer + path + fname
#Chef::Log.warn(“Copying with #{copy}”)
Dir.chdir(“d:/installs/”)
mount “T:” do
action :mount
device "\\#{managementServer}\server.installs"
end
puts Dir.pwd
Dir.chdir(“T:”)
File “d:/installs/#{fname}” do
atomic_update false
content ::File.open(pathto).read
end”

Now I get an error when it tries to chdir to T:
It is still acting as if the mount is not there or could not connect but I have nothing in the logs to back this up. I have the knife command verbosed and the chef-client end in debug but I am getting nothing about a successful mapped drive or not.
Here is knife output:
“ATLQ-CHEF04.my.domain
DEBUG: :relay_output_from_backend => [“ATLQ-CHEF04.my.domain”, “\r\n================================================================================\r\nRecipe Compile Error in c:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb\r\n================================================================================\r\n\r\nErrno::ENOENT\r\n-------------\r\nNo such file or directory - T:\r\n\r\nCookbook Trace:\r\n---------------\r\n c:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb:37:in chdir'\r\n c:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb:37:infrom_file’\r\n\r\nRelevant File Content:\r\n----------------------\r\nc:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb:\r\n\r\n 30: #Chef::Log.warn(“Copying with #{copy}”)\r\n 31: Dir.chdir(“d:/installs/”)\r\n 32: mount “T:” do\r\n 33: action :mount\r\n 34: device “\\\\#{managementServer}\\server.installs”\r\n 35: end\r\n 36: puts Dir.pwd\r\n 37>> Dir.chdir(“T:”)\r\n 38: File “d:/installs/#{fname}” do \r\n 39: atomic_update false\r\n 40: content ::File.open(pathto).read\r\n 41: end\r\n 42: \r\n 43: #unless File.exists?(“D:\installs\#{fname}”)\r\n 44: # batch ‘dlldrop’ do\r\n 45: # code copy\r\n 46: # action :run\r\n\r\n”]
ATLQ-CHEF04.my.domain
ATLQ-CHEF04.my.domain ================================================================================
ATLQ-CHEF04.my.domain Recipe Compile Error in c:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb
ATLQ-CHEF04.my.domain ================================================================================
ATLQ-CHEF04.my.domainDEBUG: ATLQ-CHEF04.my.domain[F51C4F0F-1E18-4147-8498-054B6B7A28B4] => :command_cleanup[chef-client -l debug -L c:\chef\debug.log -c c:/chef/client.rb]

ATLQ-CHEF04.my.domain Errno::ENOENT
ATLQ-CHEF04.my.domain -------------
ATLQ-CHEF04.my.domain No such file or directory - T:
ATLQ-CHEF04.my.domain
ATLQ-CHEF04.my.domain Cookbook Trace:
ATLQ-CHEF04.my.domain ---------------
ATLQ-CHEF04.my.domain c:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb:37:in chdir' ATLQ-CHEF04.my.domain c:/chef/cache/cookbooks/AW_DLLDrop/recipes/default.rb:37:infrom_file’
ATLQ-CHEF04.my.domain”

Is there some way to get more output from it?

From: Tensibai [mailto:tensibai@iabis.net]
Sent: 11 August 2014 08:25
To: chef@lists.opscode.com
Subject: [chef] Re: File copy from Windows Share

Le 2014-08-07 18:52, ChristopherHall@air-watch.commailto:ChristopherHall@air-watch.com a écrit :
Hi Chefs
I still cannot copy the file :frowning:
I’ve got round the path limitation thanks to Carlos’s suggestion but I’m getting a permission error.
I’m just using ruby libraries to copy the file here; FileUtils.cp_r(source, dest)
I’m getting the below error in the debug long from chef client
Using pure ruby it works, the path is fine. Access from the console on the node below works fine.

Can anyone shed any light on how this process happens via WinRM? Could it be an issue with the process on the node running with insufficient permissions?
Any further information that would be useful for me to add?

[2014-08-07T12:43:48-04:00] ERROR: Running exception handlers
[2014-08-07T12:43:48-04:00] ERROR: Exception handlers complete
[2014-08-07T12:43:48-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2014-08-07T12:43:48-04:00] DEBUG: Errno::EACCES: Permission denied - \ATLQ-CHEF01.my.domain\server.installs\dll.drops\7.1_HF05_Overlay_SAML_fix.zip<file:///\ATLQ-CHEF01.airwatch.qa\server.installs\dll.drops\7.1_HF05_Overlay_SAML_fix.zip>

Thanks
Chris

Hi,

Your problem is probably the multi-hop limitation in winrm http://msdn.microsoft.com/en-us/library/ee309365(v=vs.85).aspx

I did get around this using the mount ressource and a file resource to manage file from network shares (The latest chef client (11.14.2 IIRC) has a fix about the file uri file:///c:/<file:///c:> for ruby cp to work fine.)

Hope this helps.

Can you try running the process monitor during the chef-client run and see which particular process is getting access denied?

-Kapil

From: ChristopherHall@air-watch.com [mailto:ChristopherHall@air-watch.com]
Sent: Thursday, August 7, 2014 12:53 PM
To: chef@lists.opscode.com
Subject: [chef] File copy from Windows Share

Hi Chefs
I still cannot copy the file :frowning:
I’ve got round the path limitation thanks to Carlos’s suggestion but I’m getting a permission error.
I’m just using ruby libraries to copy the file here; FileUtils.cp_r(source, dest)
I’m getting the below error in the debug long from chef client
Using pure ruby it works, the path is fine. Access from the console on the node below works fine.

Can anyone shed any light on how this process happens via WinRM? Could it be an issue with the process on the node running with insufficient permissions?
Any further information that would be useful for me to add?

[2014-08-07T12:43:48-04:00] ERROR: Running exception handlers
[2014-08-07T12:43:48-04:00] ERROR: Exception handlers complete
[2014-08-07T12:43:48-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2014-08-07T12:43:48-04:00] DEBUG: Errno::EACCES: Permission denied - \ATLQ-CHEF01.airwatch.qa\server.installs\dll.drops\7.1_HF05_Overlay_SAML_fix.zip<file:///\ATLQ-CHEF01.airwatch.qa\server.installs\dll.drops\7.1_HF05_Overlay_SAML_fix.zip>

Thanks
Chris