正如我在此处创建的错误中所述:
https://github.com/test-kitchen/kitchen-vagrant/issues/407
当我在新创建的 Windows 10 盒子上执行厨房融合时,它会连接并开始在盒子上本地同步食谱,但失败并出现错误:
>>>>>> ------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
答案1
到目前为止我发现的解决此问题的一种方法是手动创建:
c:\tmp\厨房\食谱在运行 kitchen converge 之前,在 box 上清空目录。这解决了问题并使 converge 成功发生,但永久使用这种方法并不理想,因为您需要将其烘焙到图像中或在同步 cookbook 之前运行注入的某些内容。