简体   繁体   English

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

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

I'm transitioning from berkshelf to the Policyfile workflow, and everything was running fine until I attempted to resolve all the dependencies. 我正在从berkshelf过渡到Policyfile工作流程,并且一切运行良好,直到尝试解决所有依赖关系为止。 Two of my dependencies are from git, so when I run chef install in the cookbook directory, I get the following error: 我的两个依赖项来自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'.

Predictably, removing the cache folder had zero effect on the problem. 可以预期,删除缓存文件夹对该问题的影响为零。 I'm in the middle of checking whether I can get it working in the ubuntu subsystem and/or docker atm, but it'd be nice to be able to run it natively on Windows. 我正在检查是否可以在ubuntu子系统和/或docker atm上运行它,但是很高兴能够在Windows上本地运行它。

I don't get this problem using "git bash" (MINGW64) packaged in Git for windows installer. 使用Windows安装程序的Git打包的“ git bash” (MINGW64),我没有遇到这个问题。

As an example: 举个例子:

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

Managed to work around the issue by making a local cookbooks folder and checking out the dependencies to there and referencing them by path. 通过制作一个本地Cookbooks文件夹并检查其中的依赖项并按路径引用它们,从而解决了该问题。 It's not pretty, but it does the trick. 它不漂亮,但是可以解决问题。

暂无
暂无

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

相关问题 如何克服`文件名或扩展名太长`错误与Windows中的Gradle - How to overcome `The filename or extension is too long` error with Gradle in windows Windows 10-在eclipse(Oxygen版本)中,createProcess错误= 206,文件名或扩展名过长 - Windows 10- In eclipse (Oxygen version), createProcess error=206, The filename or extension is too long 如何克服 - 在 windows 上 pip install ansible 失败,文件名或扩展名在 windows 上过长 - How to overcome - pip install ansible on windows failing with filename or extension too long on windows 如何对 Visual Studio .net 核心 Windows 10 Docker 容器进行故障排除,错误为“本地主机响应时间过长”(ERR_CONNECTION_TIMED_OUT) - How do I troubleshoot Visual Studio .net core Windows 10 Docker containers with error "localhost took too long to respond" (ERR_CONNECTION_TIMED_OUT)? Grails 4 在 WIndows 上运行应用程序 10 抛出错误 = 206 文件名或扩展名太长,但 Grails 3 与相同的应用程序很好。 如何修复 grails 4? - Grails 4 run-app on WIndows 10 throws error = 206 filename or extension is too long, yet Grails 3 with the same app is fine. How to fix grails 4? Git 中的文件名太长,对于 Windows - Filename too long in Git for Windows 如何在 git clone 期间修复“文件名太长错误” - How to fix "Filename too long error" during git clone Windows上的GIT问题(文件名或扩展名太长) - GIT Issue on Windows (The filename or extension is too long) 如何在Windows上安装厨师服务器 - how to install chef server on windows 如何解决 Windows 10 上的 pip 安装错误? - How can i resolve a pip install error on windows 10?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM