0

As described in the bug I created here:

https://github.com/test-kitchen/kitchen-vagrant/issues/407

When I perform a kitchen converge on a freshly created Windows 10 box, it connects and begins syncing the cookbooks locally on the box, but it fails with the error:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #converge action: [[WinRM::FS::Core::FileTransporter] Upload failed (exitcode: 0), but stderr present
Cannot create "C:\tmp\kitchen" because a file or directory with the same name already exists.
At line:12 char:40
+   $path | ? {-not (test-path $_)} | % {$null = mkdir $_}
+                                        ~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\tmp\kitchen\cookbooks:String) [New-Item], IOException
    + FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Commands.NewItemCommand
Could not find a part of the path 'C:\tmp\kitchen\cookbooks\'.
At line:47 char:17
+   dir $unpack | cp -dest "$dst/" -force -recurse
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (metadata.rb:FileInfo) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : CopyDirectoryInfoItemIOError,Microsoft.PowerShell.Commands.CopyItemCommand
Could not find a part of the path 'C:\tmp\kitchen\cookbooks\'.
At line:47 char:17
+   dir $unpack | cp -dest "$dst/" -force -recurse
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (README.md:FileInfo) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : CopyDirectoryInfoItemIOError,Microsoft.PowerShell.Commands.CopyItemCommand
Could not find a part of the path 'C:\tmp\kitchen\cookbooks\'.
At line:47 char:17
+   dir $unpack | cp -dest "$dst/" -force -recurse
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (default.rb:FileInfo) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : CopyDirectoryInfoItemIOError,Microsoft.PowerShell.Commands.CopyItemCommand
Cannot create "C:\tmp\kitchen" because a file or directory with the same name already exists.
At line:12 char:40
+   $path | ? {-not (test-path $_)} | % {$null = mkdir $_}
+                                        ~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\tmp\kitchen\cache:String) [New-Item], IOException
    + FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Commands.NewItemCommand
] on default-BPA-TEST
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
| improve this question | | | | |
0

One work around to this issue I've discovered so far is to manually create the:

c:\tmp\kitchen\cookbooks empty directory on the box before running kitchen converge. This fixes the issue and causes the converge to happen successfully, but using this approach permanently isn't ideal as you would need to either bake it into the image or run something injected prior to the synchronization of the cookbooks.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.