Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby Chef powershell\u out SystemCaller错误文件名或扩展名太长。-CreateProcessAsUserW失败_Ruby_Windows_Powershell_Chef Infra - Fatal编程技术网

Ruby Chef powershell\u out SystemCaller错误文件名或扩展名太长。-CreateProcessAsUserW失败

Ruby Chef powershell\u out SystemCaller错误文件名或扩展名太长。-CreateProcessAsUserW失败,ruby,windows,powershell,chef-infra,Ruby,Windows,Powershell,Chef Infra,我创建了一个自定义资源gmsa,以创建Windows Active Directory组管理的服务帐户。调用此自定义资源时,我收到了一条有趣的错误消息,我目前在Jenkins管道厨房测试中获得的消息非常一致,但在本地厨房测试中却没有: ================================================================================ Error executing action `create` on resource 'gmsa[g

我创建了一个自定义资源
gmsa
,以创建Windows Active Directory组管理的服务帐户。调用此自定义资源时,我收到了一条有趣的错误消息,我目前在Jenkins管道厨房测试中获得的消息非常一致,但在本地厨房测试中却没有:

================================================================================
Error executing action `create` on resource 'gmsa[gMSA.sql]'
================================================================================

SystemCallError
---------------
The filename or extension is too long. - CreateProcessAsUserW failed.

Cookbook Trace:
---------------
C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/adr_env_common/resources/gmsa.rb:123:in `ps_ad_object'
C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/adr_env_common/resources/gmsa.rb:154:in `alternate_id_from_dn'
C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/adr_env_common/resources/gmsa.rb:241:in `block in class_from_file'
gmsa.rb
文件中第123行的引用是对
powershell\u out

我很好奇
powershell\u out
是否正在尝试创建临时文件,并且它是否达到了文件路径字符限制(我相信对于Windows来说这是260个字符)

有没有其他人在使用
powershell\u out
方法时遇到过类似的情况?如果是这样的话,您对解决方案有何想法

非常感谢您的帮助


编辑(2020年7月8日):

在调用自定义资源之前,我尝试添加以下注册表设置,以查看它是否允许绕过260个字符的文件名限制,但没有成功:

registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem' do
  values [{
    name: 'LongPathsEnabled',
    type: :dword,
    data: 1
  }]
  action :create
  notifies :reboot_now, 'reboot[Reboot For Registry Setting]', :immediately
end

reboot 'Reboot For Registry Setting' do
  action :nothing
  reason 'Cannot continue Chef run without a reboot.'
  delay_mins 1
end

事实证明,在我的情况下,这个错误是一个完全错误的方向。在我们的测试域中有一个广告安全组,在重复管道运行且没有清理之后,该组基本上“填满”。从该组中清除成员并再次运行管道后,一切正常