繁体   English   中英

在Windows 10上运行“ chef install”时如何解决“文件名太长”错误?

[英]How do I get around “Filename too long” error when running `chef install` on Windows 10?

我正在从berkshelf过渡到Policyfile工作流程,并且一切运行良好,直到尝试解决所有依赖关系为止。 我的两个依赖项来自git,因此当我在cookbook目录中运行chef install时,出现以下错误:

Error: Failed to generate Policyfile.lock
Reason: (CookbookOmnifetch::GitCommandError) Git error: command `git reset --hard 7e5e4bccf57718cacc246f1b4d501ff7de8ac13d` failed. If this error persists, 
try removing the cache directory at 'C:/Users/pcummuskey/AppData/Local/chefdk/cache/.cache/git/780b7dbee933c3a9efbfd3898d54cdf72784fa7e'.Output from the command:

error: unable to create file test/kitchen/.kitchen/tmp/librarian/cache/source/chef/site/877777683730772c36b1e6a3fc3aa2c3/windows/version-uri/a3432e93fb3c21cb7111fde71e435661/package/files/default/handlers/windows_reboot_handler.rb: Filename too long
Checking out files: 100% (389/389), done.
fatal: Could not reset index file to revision '7e5e4bccf57718cacc246f1b4d501ff7de8ac13d'.

可以预期,删除缓存文件夹对该问题的影响为零。 我正在检查是否可以在ubuntu子系统和/或docker atm上运行它,但是很高兴能够在Windows上本地运行它。

使用Windows安装程序的Git打包的“ git bash” (MINGW64),我没有遇到这个问题。

举个例子:

$ pwd
/c/Users/foobar/AppData/Local/chefdk/cache/.cache/git/13036489648c6f8811262c6a50ff6b03da2395b7/4416ca3886d025b3ead519f1ee53af03ecb630f64416ca3886d025b3ead519f1ee53af03ecb630f64416ca3886d025b3ead519f1ee53af03ecb630f64416ca3886d025b3ead519f1ee53af03ecb630f6/4416ca3886d025b3ead519f1ee53af03ecb630f64416ca3886d025b3ead519f1ee53af03ecb630f64416ca3886d025b3ead519f1ee53af03ecb630f61

通过制作一个本地Cookbooks文件夹并检查其中的依赖项并按路径引用它们,从而解决了该问题。 它不漂亮,但是可以解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM