Errno::ELOOP: Too many levels of symbolic links - "bash"

Hi All,

I am getting this error on few servers and the recipe works file on other servers.

its s simple bash code. whenever I use bash resource I am getting this error

[root@chefworkstation recipes]# cat /root/chef-repo/.chef/local-mode-cache/cache/chef-stacktrace.out
Generated at 2016-08-25 01:45:23 -0400
Errno::ELOOP: bash[/etc/sysconfig/network] (@recipe_files::/root/chef-repo/cookbooks/post_config/recipes/zeroconf.rb line 3) had an error: Errno::ELOOP: Too many levels of symbolic links - “bash” “/tmp/chef-script20160825-16448-p9f0ye”
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout/unix.rb:338:in exec' /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout/unix.rb:338:inblock in fork_subprocess’

I think we’ll need to see the bash script and the recipe to help you out.

the same bash script works fine locally and work fine from the other chefworkstation.

bash ‘/etc/resolv.conf’ do
code <<-EOH
echo “#{node[‘domain’]}”>>/etc/resolv.conf
EOH
not_if "grep -q #{node[‘domain’]} /etc/resolv.conf"
end

your actual /etc/resolv.conf file is most likely an endless loop of symlinks.

at any rate ELOOP is pretty unlikely to be a chef bug and you need to track down the file on the filesystem which has the infinite symlink loop and fix it and/or determine how it got created…