Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the puppet-zabbix module on Gentoo gives an ExecutionFailure #531

Closed
lordievader opened this issue Aug 31, 2018 · 4 comments · Fixed by #535
Closed

Running the puppet-zabbix module on Gentoo gives an ExecutionFailure #531

lordievader opened this issue Aug 31, 2018 · 4 comments · Fixed by #535

Comments

@lordievader
Copy link
Contributor

Adding the zabbix::agent module to a Gentoo machine gives the following error

Error: /Stage[main]/Zabbix::Agent/Package[zabbix-agent]: Could not evaluate: undefined method `encoding' for #Puppet::ExecutionFailure:0x000055d35eb923a0>

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.3
  • Ruby: 2.3.7p456 (2018-03-28 revision 63024)
  • Distribution: Gentoo
  • Module version: 6.4.1

How to reproduce (e.g Puppet code you use)

I've included the class like so:

class {'zabbix::agent':
    server       => 'zabbix.mini.true',
    serveractive => 'zabbix.mini.true',
    logfile      => '/var/log/zabbix/zabbix_agentd.log',
    logfilesize  => '0',
    hostname     => $::hostname,
    include_dir  => '/etc/zabbix/zabbix_agentd.d/',
    manage_repo  => false,
}

The same code works fine for Debian and Ubuntu hosts.

What are you seeing

A puppet run crashes with:

Error: /Stage[main]/Zabbix::Agent/Package[zabbix-agent]: Could not evaluate: undefined method `encoding' for #Puppet::ExecutionFailure:0x000055d35eb923a0>

What behaviour did you expect instead

A normal error free run.

@bastelfreak
Copy link
Member

Hi @lordievader, this might be a bug in Puppet rather than the module. Can you do a puppet run with --debug and a minimal catalog? As an optimal testcase, only with the zabbix agent class. Do you know if other package resources work?

@lordievader
Copy link
Contributor Author

Hi @bastelfreak.
Below you can see the lines of output around the error. This was during a Puppet run with only the 'zabbix::agent' class. Included as above since else the repo.pp complains that Gentoo is not supported ;)

Debug: Prefetching portage resources for package
Debug: Executing: '/usr/bin/eix --nocolor --pure-packages --format '<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] [<installedversions:LASTSLOTVERSIONS>] [<installedversions:INSTALLEDVERSIONS>] [<availableversions:STABLEVERSIONS>] [<bestslotversions:LASTSLOTVERSIONS>] <homepage> <description>
' --installed'
Debug: Executing: '/usr/bin/qatom zabbix-agent --format "[%{CATEGORY}] [%{PN}] [%{PV}] [%[PR]] [%[SLOT]] [%[pfx]] [%[sfx]]"'
Debug: Executing: '/usr/bin/emerge --list-sets'
Debug: Executing: '/usr/bin/eix --nocolor --pure-packages --format '<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] [<installedversions:LASTSLOTVERSIONS>] [<installedversions:INSTALLEDVERSIONS>] [<availableversions:STABLEVERSIONS>] [<bestslotversions:LASTSLOTVERSIONS>] <homepage> <description>
' --exact --name zabbix-agent'
Error: /Stage[main]/Zabbix::Agent/Package[zabbix-agent]: Could not evaluate: undefined method `encoding' for #<Puppet::ExecutionFailure:0x000055cb59b37d40>
Debug: Zabbix::Startup[zabbix-agent]: Resource is being skipped, unscheduling all events
Notice: /Stage[main]/Zabbix::Agent/File[/etc/zabbix/zabbix_agentd.conf]: Dependency Package[zabbix-agent] has failures: true
Warning: /Stage[main]/Zabbix::Agent/File[/etc/zabbix/zabbix_agentd.conf]: Skipping because of failed dependencies

Running that last command manually did point me to something. On Gentoo the Zabbix agent package resides in the package named zabbix with a useflag for agent. Hence, the search for zabbix-agent returns nothing. Could this be the source of the trouble?

@lordievader
Copy link
Contributor Author

So I forked the project and updated params.pp with variables for Gentoo. With the correct package title the error vanishes. However, it is replaced with the fact that Puppet failed the start the zabbix-agent service. This is because the service is called zabbix-agentd in Gentoo. If I have some more time I'll make a pull-request to fix these things. Unfortunately the service name is hardcoded, so I have some more work to do.

@bastelfreak
Copy link
Member

Thanks for the investigation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants