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

No such file or directory errors #83

Closed
blackknight36 opened this issue Nov 21, 2016 · 10 comments
Closed

No such file or directory errors #83

blackknight36 opened this issue Nov 21, 2016 · 10 comments
Assignees
Labels

Comments

@blackknight36
Copy link
Contributor

There appears to be an error when this module is first run that causes errors to show up in our puppet reports. For example, the following errors occur during the first puppet run on a new host.

Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock at /etc/puppetlabs/code/environments/ovirt_test/forge_modules/snmp/manifests/client.pp:85
Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock at /etc/puppetlabs/code/environments/ovirt_test/forge_modules/snmp/manifests/client.pp:85
Wrapped exception:
No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock
Error: /Stage[main]/Snmp::Client/File[snmp.conf]/ensure: change from absent to present failed: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock at /etc/puppetlabs/code/environments/ovirt_test/forge_modules/snmp/manifests/client.pp:85
Info: Class[Snmp::Client]: Unscheduling all events on Class[Snmp::Client]Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock at /etc/puppetlabs/code/environments/ovirt_test/forge_modules/snmp/manifests/client.pp:85
Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock at /etc/puppetlabs/code/environments/ovirt_test/forge_modules/snmp/manifests/client.pp:85
Wrapped exception:
No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock
Error: /Stage[main]/Snmp::Client/File[snmp.conf]/ensure: change from absent to present failed: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/snmp/snmp.conf20161121-20105-1teyemp.lock at /etc/puppetlabs/code/environments/ovirt_test/forge_modules/snmp/manifests/client.pp:85
Info: Class[Snmp::Client]: Unscheduling all events on Class[Snmp::Client]

@razorsedge
Copy link
Contributor

@blackknight36 What versions of Puppet, Puppet server, and OS are we dealing with? Which version of the razorsedge/snmp module?

@razorsedge razorsedge self-assigned this Apr 22, 2017
@blackknight36
Copy link
Contributor Author

@razorsedge We're running puppetserver 2.7.2 with puppet-agent 1.9.10 on CentOS 7.2. I've also seen this error on Fedora based systems. I believe the issue is that the snmp::client class attempts to create a config file before the /etc/snmp directory exists. This directory is provided by the net-snmp package so it may be possible to fix this by adding a package requirement on the file resource.

@razorsedge
Copy link
Contributor

@blackknight36 Odd. I'm looking at the latest code and the File['snmp.conf'] is using a require as long as you are not on Suse. Either the $req is not getting set, or maybe Puppet 4 has issues with package aliases.

@blackknight36
Copy link
Contributor Author

I'll have to set up a VM and run some more tests. The error only occurs on the first puppet run, once the /etc/snmp directory is created the error goes away.

@blackknight36
Copy link
Contributor Author

I believe I see the issue. $req is set to require the snmp-client package which does not create the /etc/snmp directory. /etc/snmp is provided by the net-snmp package on redhat based systems as shown by the rpm command.

username@dev27:/etc/snmp$ rpm -qf .
net-snmp-5.7.3-13.fc25.x86_64

$req should most likely be changed to $snmp::params::package_name since that is the correct package which manages the directory.

@blackknight36
Copy link
Contributor Author

I've submitted PR #98 which should fix this on Redhat and Fedora based systems.

@elisiano
Copy link

I'm seeing this too. Since the PR has been merged, is there an ETA for when this can hit the forge?

@razorsedge
Copy link
Contributor

I hope to get this pushed to the Forge by this weekend.

@razorsedge
Copy link
Contributor

Closed by #98

@razorsedge
Copy link
Contributor

3.8.0 has been pushed to the Forge.

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

No branches or pull requests

3 participants