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

Augeas errors arise when applying yum settings on Cent OS 6 clients #47

Closed
weijianwen opened this issue May 24, 2017 · 14 comments
Closed

Comments

@weijianwen
Copy link

weijianwen commented May 24, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.0
  • Ruby: shippe with Puppet
  • Distribution: Cent OS 6
  • Module version: 1.0.0

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

Install puppet-yum:

# puppet module install puppet-yum

Assign yum module to all nodes in site.pp on puppetserver:

node default {
    class {yum:}

     file_line { 'yum_proxy':
       path => '/etc/yum.conf',
       line => "proxy=$proxy",
     }
}

Apply yum setting on the client node:

client# cat /dev/null > /etc/yum.conf; puppet agent --verbose --debug -t

What are you seeing

Debug: Augeas[yum.conf_main_keepcache](provider=augeas): Opening augeas with root /, lens path , flags 64                                 
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): Augeas version 1.4.0 is installed                                         
Warning: Augeas[yum.conf_main_keepcache](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output                  
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed                        
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7                                           
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2                                                    
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0                               
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input 
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): Will attempt to save and only run if files changed                      
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/keepcache", "0"]                             
Debug: Augeas[yum.conf_main_keepcache](provider=augeas): Closed the augeas connection                                             
Error: /Stage[main]/Yum/Yum::Config[keepcache]/Augeas[yum.conf_main_keepcache]: Could not evaluate: Saving failed, see debug     
Debug: Yum::Config[keepcache]: Resource is being skipped, unscheduling all events                                                     
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): Opening augeas with root /, lens path , flags 64                       
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): Augeas version 1.4.0 is installed                                         
Warning: Augeas[yum.conf_main_debuglevel](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output 
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed                        
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7                               
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2                                
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0                               
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/debuglevel", "2"]
Debug: Augeas[yum.conf_main_debuglevel](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Yum/Yum::Config[debuglevel]/Augeas[yum.conf_main_debuglevel]: Could not evaluate: Saving failed, see debug
Debug: Yum::Config[debuglevel]: Resource is being skipped, unscheduling all events
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): Augeas version 1.4.0 is installed
Warning: Augeas[yum.conf_main_exactarch](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/exactarch", "1"]
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Yum/Yum::Config[exactarch]/Augeas[yum.conf_main_exactarch]: Could not evaluate: Saving failed, see debug
Debug: Yum::Config[exactarch]: Resource is being skipped, unscheduling all events
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): Augeas version 1.4.0 is installed
Warning: Augeas[yum.conf_main_obsoletes](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/obsoletes", "1"]
Debug: Augeas[yum.conf_main_obsoletes](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Yum/Yum::Config[obsoletes]/Augeas[yum.conf_main_obsoletes]: Could not evaluate: Saving failed, see debug
Error: /Stage[main]/Yum/Yum::Config[obsoletes]/Augeas[yum.conf_main_obsoletes]: Could not evaluate: Saving failed, see debug
Debug: Yum::Config[obsoletes]: Resource is being skipped, unscheduling all events
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): Augeas version 1.4.0 is installed
Warning: Augeas[yum.conf_main_gpgcheck](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/gpgcheck", "1"]
Debug: Augeas[yum.conf_main_gpgcheck](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Yum/Yum::Config[gpgcheck]/Augeas[yum.conf_main_gpgcheck]: Could not evaluate: Saving failed, see debug
Debug: Yum::Config[gpgcheck]: Resource is being skipped, unscheduling all events
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): Opening augeas with root /, lens path , flags 64
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): Augeas version 1.4.0 is installed
Warning: Augeas[yum.conf_main_installonly_limit](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/installonly_limit", "5"]
Debug: Augeas[yum.conf_main_installonly_limit](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Yum/Yum::Config[installonly_limit]/Augeas[yum.conf_main_installonly_limit]: Could not evaluate: Saving failed, see debug
Debug: Yum::Config[installonly_limit]: Resource is being skipped, unscheduling all events
Notice: /Stage[main]/Yum/Exec[package-cleanup_oldkernels]: Dependency Augeas[yum.conf_main_installonly_limit] has failures: true
Warning: /Stage[main]/Yum/Exec[package-cleanup_oldkernels]: Skipping because of failed dependencies
Debug: /Stage[main]/Yum/Exec[package-cleanup_oldkernels]: Resource is being skipped, unscheduling all events

What behaviour did you expect instead

Yum settings should be applied on to the client node.

Output log

Any additional information you'd like to impart

The same configuration works well for Cent OS 7 clients.

@bastelfreak
Copy link
Member

Hi @weijianwen, thanks for the issue. Can you provide us the error message you get?

@weijianwen
Copy link
Author

@bastelfreak thank you for your quick response. I accidentally clicked the "Send" button in the middle of typing. Now more information is added. Please tell me if anything else if required.

@domcleal
Copy link

Can you run the agent with --debug? There should be more information for the Augeas[yum.conf_main_keepcache]` resource and others.

@weijianwen
Copy link
Author

Sure. I'll replace the logs with --debug option.

@weijianwen
Copy link
Author

Log updated. I am not sure what /augeas//error output refers to since I found no dirs with names like that.

@domcleal
Copy link

domcleal commented May 24, 2017

It refers to these lines in the debug output:

Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error = parse_failed
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/pos = 7
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/line = 2
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/char = 0
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:49.13-.41:
Debug: Augeas[yum.conf_main_exactarch](provider=augeas): /augeas/files/etc/yum.conf/error/message = Get did not match entire input

There's an issue with line two of the /etc/yum.conf file. Either:

  1. It has invalid syntax, edit and fix the file manually, then re-run the module.
  2. There's a bug in the Augeas lens for yum.conf, where it should accept something that's valid syntax and doesn't.
  3. Augeas is out of date (1.4.0 vs 1.8.0), which is being fixed in puppet-agent (edit: and there's some bug that's been fixed.)

@weijianwen
Copy link
Author

@domcleal I empty my /etc/yum.conf file then rerun it. The same issue persists. I guess I'll wait Augeas to be updated in puppet.

@domcleal
Copy link

What is the new error message precisely? It can't be exactly the same, as the previous error was about line two.

I didn't mean to say that just updating Augeas will fix it, just that if it were a bug fixed between those versions that it may start working.

@weijianwen
Copy link
Author

I figured out why. It is my fault. I tried to modify /etc/yum.conf outside yum module without specifying operation order between them. It seems Puppet scheduled to operate /etc/yum.conf concurrently (?) which leads to such issues. Adding require solves this issue. Issue description has been updated.

WRONG configuration:

node default {
    class {yum:}

     file_line { 'yum_proxy':
       path => '/etc/yum.conf',
       line => "proxy=$proxy",
     }
}

Correct configuration:

node default {
    class {yum:}

     file_line { 'yum_proxy':
       path => '/etc/yum.conf',
       line => "proxy=$proxy",
       require => Class['yum']
     }
}

@weijianwen
Copy link
Author

proxy setting in yum.conf is useful but not supported in puppet-yum yet. Any plan to add this variable? I am new to Puppet but I can help to send a PR.

@domcleal
Copy link

domcleal commented May 24, 2017

proxy and any valid yum.conf option can be set via config_options on the yum class or by using yum::config, no? (See usage: https://github.com/voxpupuli/puppet-yum#usage)

It seems Puppet scheduled to operate /etc/yum.conf concurrently (?) which leads to such issues. Adding require solves this issue.

More likely that the file can't be parsed by Augeas after being modified, perhaps the modification is creating invalid syntax or it's unable to parse whatever syntax is given. Can you attach the resulting file that fails?

@weijianwen
Copy link
Author

Sure. The generated /etc/yum.conf from the failing run has the following contents in which http://proxy.mysite.com:4000 is my proxy address.

proxy=http://proxy.mysite.com:4000

@domcleal
Copy link

If that's the entire file then it's missing a [main] section, which is why Augeas fails to parse it.

@weijianwen
Copy link
Author

Thank you, @domcleal . I'll close this issue.

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

No branches or pull requests

3 participants