electrical/puppet-lib-file_concat

Leakage between server and agent with puppet4

Closed this issue · 14 comments

This error appears to be a variable/env variable leakage from the server to the client.

Error: /Stage[main]/Logstash::Config/File_concat[ls-config]: Failed to generate additional resources using 'eval_generate': Could not find a directory environment named 'centos7' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?

This is using the logstash module using puppet server 2.0.0 and puppet agent 4.0.0 on a CentOS7 machine. This machine is using the environment centos7 and the environment directory is /etc/puppetlabs/code/environments. Making /etc/puppetlabs/code/environments/centos7 on the agent resolves the error.

@bmjen do you have any ideas ?

@jlambert121 do you remember against which version of the module this was?

This is happening on module version 1.0.1

@elmerfud @jlambert121 I'll try to do some digging this week.

bmjen commented

@elmerfud @jlambert121 Have you attempted to recreate this on the latest master? I believe a lot of the weirdness from the pl-concat divergence should have been fixed.

@electrical Is there going to be a release soon with what is in master?

@bmjen planning to do a release soon. want to add some minor tests.

I get the same error when running puppet4 with any environment except production... Error: /Stage[main]/Logstash::Config/File_concat[ls-config]: Failed to generate additional resources using 'eval_generate': Could not find a directory environment named 'dev' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?

Can we do anything about it ?

bmjen commented

@jsosic are you getting this error from the forge release or github master? Have you tried with github master?

Yes, I still have the same issue with the latest master.

Get the same error (master branch)

Error: /Stage[main]/Logstash::Config/File_concat[ls-config]: Failed to generate additional resources using 'eval_generate': Could not find a directory environment named 'logstash_refactor' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?

Found that error appears in this line:
https://github.com/electrical/puppet-lib-file_concat/blob/master/lib/puppet/type/file_concat.rb#L144

tmp = Puppet::FileServing::Content.indirection.find(@source, :environment => catalog.environment)

Sorry for the delay #34 has been merged which should solve this.

I am still getting this error when used with elasticsearch-logstash

elasticsearch-logstash (v0.6.4)
puppetlabs-concat (v1.2.5)

Error: /Stage[main]/Logstash::Config/File_concat[ls-config]: Failed to generate additional resources using 'eval_generate': Could not find a directory environment named 'develop' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?

This is from the logstash module:

file_concat { 'ls-config': ensure => 'present', tag => "LS_CONFIG_${::fqdn}", path => "${logstash::configdir}/conf.d/logstash.conf", owner => $logstash::logstash_user, group => $logstash::logstash_group, mode => '0644', notify => $notify_service, require => File[ "${logstash::configdir}/conf.d" ], }

Im unsure if this is a logstash or concat issue.

Hi, can you check which version of the library you have?
Also, puppetlabs-concat 2.x uses the native type now. I'm working on updating the logstash module ( own fork ) to use that one.

Unfortunately, 2.1 is incompatible with some other modules (icinga2). I am sorry to ask, but how do I get the lib version?

//EDIT//

stdlib, I assume: puppetlabs-stdlib (v4.12.0)