Support #20208
closedFailed puppet run: Dependency 'puppet_runner_impl' is undefined
Description
Hello tech people,
this is a weird issue I get while trying to push a manifest against any hosts from the foreman ui.
Ideally, I'd like to kick-off manifests against the host machines from the foreman ui, mcollective was configured on both master and nodes.
The full error message :
Error: failed to execute puppetrun: ERF12-4252 [ProxyAPI::ProxyException]: Unable to execute Puppet run ([RestClient::InternalServerError]: 500 Internal Server Error) for proxy https://devs0145.sc.intra:8443/puppet
and some specs : puppetserver --version puppetserver version: 2.7.2 puppet --version 4.10.4 rpm -qa | grep foreman tfm-rubygem-foreman-tasks-0.9.3-1.fm1_15.el7.noarch foreman-selinux-1.15.1-1.el7.noarch tfm-rubygem-foreman-tasks-core-0.1.3-1.fm1_15.el7.noarch foreman-debug-1.15.1-1.el7.noarch tfm-rubygem-hammer_cli_foreman-0.10.2-1.el7.noarch tfm-rubygem-foreman_remote_execution-1.3.1-1.fm1_15.el7.noarch foreman-cli-1.15.1-1.el7.noarch tfm-rubygem-foreman_setup-5.0.0-1.fm1_13.el7.noarch foreman-proxy-1.15.1-1.el7.noarch tfm-rubygem-foreman_cockpit-2.0.3-1.fm1_15.el7.noarch tfm-rubygem-foreman_remote_execution_core-1.0.4-1.fm1_15.el7.noarch foreman-1.15.1-1.el7.noarch foreman-installer-1.15.1-1.el7.noarch foreman-postgresql-1.15.1-1.el7.noarch
thanks for helping!
Files
Updated by Anonymous over 7 years ago
Could you post smart-proxy log on DEBUG level please? It would be useful to see both startup messages and messages when the request is made.
Updated by Mirco Santori over 7 years ago
Hi Dmitri, thanks for your reply.
I have just changed the debug level and restarted the foreman-proxy service. Here below the log during its boot (though it might be useful to inspect its configuration) :
I, [2017-07-05T10:21:08.843888 ] INFO -- : going to shutdown ... I, [2017-07-05T10:21:08.844207 ] INFO -- : WEBrick::HTTPServer#start done. D, [2017-07-05T10:21:09.384897 ] DEBUG -- : 'dynflow' settings: 'core_url': https://************:8008, 'database': /var/lib/foreman-proxy/dynflow/dynflow.sqlite, 'enabled': https D, [2017-07-05T10:21:09.389717 ] DEBUG -- : 'ssh' settings: 'enabled': https, 'local_working_dir': /var/tmp (default), 'remote_working_dir': /var/tmp (default), 'ssh_identity_key_file': /usr/share/foreman-proxy/.ssh/id_rsa_foreman_proxy, 'ssh_user': root (default) D, [2017-07-05T10:21:09.399128 ] DEBUG -- : 'tftp' settings: 'enabled': https, 'tftproot': /var/lib/tftpboot (default) D, [2017-07-05T10:21:09.423349 ] DEBUG -- : 'puppetca' settings: 'enabled': https, 'puppetdir': /etc/puppetlabs/puppet, 'ssldir': /etc/puppetlabs/puppet/ssl D, [2017-07-05T10:21:09.430895 ] DEBUG -- : 'puppet' settings: 'enabled': https, 'puppet_provider': mcollective, 'puppet_version': 4.10.4, 'use_provider': [:puppet_proxy_puppet_api] D, [2017-07-05T10:21:09.435511 ] DEBUG -- : 'logs' settings: 'enabled': https D, [2017-07-05T10:21:09.436087 ] DEBUG -- : Providers ['puppet_proxy_puppet_api'] are going to be configured for 'puppet' D, [2017-07-05T10:21:09.530769 ] DEBUG -- : 'puppet_proxy_puppet_api' settings: 'api_timeout': 30 (default), 'classes_retriever': apiv3, 'environments_retriever': apiv3, 'puppet_provider': mcollective, 'puppet_ssl_ca': /etc/puppetlabs/puppet/ssl/certs/ca.pem, 'puppet_ssl_cert': /etc/puppetlabs/puppet/ssl/certs/******.pem, 'puppet_ssl_key': /etc/puppetlabs/puppet/ssl/private_keys/*******.pem, 'puppet_url': https://******, 'puppet_version': 4.10.4, 'use_provider': [:puppet_proxy_puppet_api] I, [2017-07-05T10:21:09.535518 ] INFO -- : Successfully initialized 'dynflow' I, [2017-07-05T10:21:09.539780 ] INFO -- : Successfully initialized 'ssh' I, [2017-07-05T10:21:09.539994 ] INFO -- : Successfully initialized 'foreman_proxy' I, [2017-07-05T10:21:09.540163 ] INFO -- : Successfully initialized 'tftp' I, [2017-07-05T10:21:09.540364 ] INFO -- : Successfully initialized 'puppetca' I, [2017-07-05T10:21:09.540896 ] INFO -- : Started puppet class cache initialization I, [2017-07-05T10:21:09.541950 ] INFO -- : Successfully initialized 'puppet_proxy_puppet_api' I, [2017-07-05T10:21:09.542496 ] INFO -- : Successfully initialized 'puppet' D, [2017-07-05T10:21:09.543064 ] DEBUG -- : Log buffer API initialized, available capacity: 2000/1000 I, [2017-07-05T10:21:09.543254 ] INFO -- : Successfully initialized 'logs' I, [2017-07-05T10:21:09.601771 ] INFO -- : WEBrick 1.3.1 I, [2017-07-05T10:21:09.602013 ] INFO -- : ruby 2.0.0 (2015-12-16) [x86_64-linux] D, [2017-07-05T10:21:09.602478 ] DEBUG -- : TCPServer.new(0.0.0.0, 8443) D, [2017-07-05T10:21:09.602642 ] DEBUG -- : TCPServer.new(::, 8443) W, [2017-07-05T10:21:09.602840 ] WARN -- : TCPServer Error: Address already in use - bind(2) I, [2017-07-05T10:21:09.603882 ] INFO -- : Certificate: Data: Version: 3 (0x2) Serial Number: 2 (0x2) Signature Algorithm: sha256WithRSAEncryption Issuer: CN=Puppet CA: ********* Validity Not Before: Apr 20 14:05:31 2017 GMT Not After : Apr 20 14:05:31 2022 GMT Subject: CN=****** Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (4096 bit) Modulus: **** **** Exponent: 65537 (0x10001) X509v3 extensions: Netscape Comment: Puppet Server Internal Certificate X509v3 Authority Key Identifier: keyid:26:C5:25:19:F3:77:93:CF:EA:59:49:20:FA:0A:C4:47:05:38:2E:6B X509v3 Subject Key Identifier: D0:63:8E:DD:F9:CC:66:B2:95:86:14:AD:64:D9:27:3E:84:1B:F0:CE X509v3 Subject Alternative Name: DNS:puppet, DNS:***** X509v3 Basic Constraints: critical CA:FALSE X509v3 Extended Key Usage: critical TLS Web Server Authentication, TLS Web Client Authentication X509v3 Key Usage: critical Digital Signature, Key Encipherment Signature Algorithm: sha256WithRSAEncryption **** D, [2017-07-05T10:21:09.606745 ] DEBUG -- : Rack::Handler::WEBrick is mounted on /. I, [2017-07-05T10:21:09.606992 ] INFO -- : WEBrick::HTTPServer#start: pid=31463 port=8443 D, [2017-07-05T10:21:09.673519 ] DEBUG -- : Initializing puppet class cache for 'production' environment D, [2017-07-05T10:21:09.674234 ] DEBUG -- : Initializing puppet class cache for 'common' environment D, [2017-07-05T10:21:09.675001 ] DEBUG -- : Initializing puppet class cache for 'development' environment I, [2017-07-05T10:21:10.923732 ] INFO -- : Finished puppet class cache initialization
and the log message during the "Run Puppet" execution :
D, [2017-07-05T10:27:50.208647 ] DEBUG -- : accept: ****:51876 D, [2017-07-05T10:27:50.211697 ] DEBUG -- : Rack::Handler::WEBrick is invoked. D, [2017-07-05T10:27:50.223915 ] DEBUG -- : verifying remote client **** against trusted_hosts ["****"] E, [2017-07-05T10:27:50.227254 ] ERROR -- : Failed puppet run: Dependency 'puppet_runner_impl' is undefined D, [2017-07-05T10:27:50.227361 ] DEBUG -- : Failed puppet run: Dependency 'puppet_runner_impl' is undefined I, [2017-07-05T10:27:50.229299 ] INFO -- : **** - - [05/Jul/2017:10:27:50 +0200] "POST /puppet/run HTTP/1.1" 500 63 0.0077 D, [2017-07-05T10:27:50.271143 ] DEBUG -- : close: ****:51876
Let me know if you need more and I will be more than happy to provide.
-mirco
Updated by Anonymous over 7 years ago
- Tracker changed from Bug to Support
Looks like you need to update puppet module's config file: "puppet_provider" is no longer being used, instead "use_provider" should be used. The name of the "mcollective" puppetrun provider is now "puppet_proxy_mcollective".
If this is a source-based installation, you can update smart-proxy configuration by executing "rake migrate_settings".
Updated by Mirco Santori over 7 years ago
The installation was made through yum on CentOS. can you kindly highlight the configuration files I need to change and the command to execute ?
Updated by Mirco Santori over 7 years ago
ok I found this /etc/foreman-proxy/settings.d/puppet.yml and change its content from puppet_provider mcollective to use_provider ...
Updated by Mirco Santori over 7 years ago
it is now getting better , but still an error arises - Do i need to enable or even change the auth file from the node for incoming connection from the master or viceversa ? That 500 status code made me thing about it ..
D, [2017-07-05T11:15:11.912946 ] DEBUG -- : accept: ****:52496 D, [2017-07-05T11:15:11.916852 ] DEBUG -- : Rack::Handler::WEBrick is invoked. D, [2017-07-05T11:15:11.930133 ] DEBUG -- : verifying remote client **** against trusted_hosts ["****"] D, [2017-07-05T11:15:11.931163 ] DEBUG -- : about to execute: ["/usr/bin/sudo", "-u", "root", "/opt/puppetlabs/bin/mco", "puppet", "runonce", "-I", "****"] W, [2017-07-05T11:15:11.942662 ] WARN -- : Non-null exit code when executing '["/usr/bin/sudo", "-u", "root", "/opt/puppetlabs/bin/mco", "puppet", "runonce", "-I", "****"]' E, [2017-07-05T11:15:11.945912 ] ERROR -- : Failed puppet run: Check Log files D, [2017-07-05T11:15:11.946044 ] DEBUG -- : Failed puppet run: Check Log files I, [2017-07-05T11:15:11.948159 ] INFO -- : **** - - [05/Jul/2017:11:15:11 +0200] "POST /puppet/run HTTP/1.1" 500 34 0.0212 D, [2017-07-05T11:15:11.989391 ] DEBUG -- : close: ****:52496
Updated by Anonymous over 7 years ago
I'm not sure. Check the puppet log; make sure you can execute 'sudo -u root /opt/puppetlabs/bin/mco puppet runonce +I <nodes here>" from under proxy account.
Updated by Daniel Kimsey over 7 years ago
I modified /etc/foreman-proxy/settings.d/puppet.yml
:
:use_provider: puppet_proxy_mcollective
I modified /etc/sudoers.d/foreman-proxy
:
foreman-proxy ALL = (root) NOPASSWD : /opt/puppetlabs/bin/mco puppet *
And it was still failing. When I tried by hand executing sudo -u foreman-proxy /opt/puppetlabs/bin/mco puppet runonce -I foo.example.com
:
The Marionette Collective version 2.9.1 Unknown command 'puppet', searched for applications in: /usr/libexec/mcollective /usr/share/mcollective/plugins /opt/puppetlabs/mcollective/plugins /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/specifications/lib /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/stomp-1.3.3/lib /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0 /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0/x86_64-linux /opt/puppetlabs/puppet/lib/ruby/site_ruby /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.1.0 /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.1.0/x86_64-linux /opt/puppetlabs/puppet/lib/ruby/vendor_ruby /opt/puppetlabs/puppet/lib/ruby/2.1.0 /opt/puppetlabs/puppet/lib/ruby/2.1.0/x86_64-linux /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/mcollective/vendor/systemu/lib Known commands: completion describe_filter facts find help inventory ping plugin rpc Type '/opt/puppetlabs/bin/mco help' for a detailed list of commands and '/opt/puppetlabs/bin/mco help command' to get detailed help for a command
Versions:
rpm -q puppet-agent puppetserver foreman-proxy puppet-agent-1.8.3-1.el7.x86_64 puppetserver-2.7.2-1.el7.noarch foreman-proxy-1.13.3-1.el7.noarch
Of which puppet-agent contains:
rpm -qi puppet-agent Name : puppet-agent Version : 1.8.3 Release : 1.el7 Architecture: x86_64 Install Date: Wed 25 Jan 2017 09:55:07 AM CST Group : System Environment/Base Size : 126786488 License : See components Signature : RSA/SHA1, Thu 19 Jan 2017 04:51:00 PM CST, Key ID 7f438280ef8d349f Source RPM : puppet-agent-1.8.3-1.el7.src.rpm Build Date : Thu 19 Jan 2017 02:43:30 PM CST Build Host : dwtx6m5a01l7xo7.delivery.puppetlabs.net Relocations : (not relocatable) Vendor : Puppet Labs URL : https://www.puppetlabs.com Summary : The Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, hiera and mcollective. Description : The Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, hiera and mcollective. Contains the following components: augeas 1.4.0 cpp-hocon 0.1.4 cpp-pcp-client 1.3.1 curl 7.51.0 dmidecode 2.12 facter 3.5.1 hiera 3.2.2 leatherman 0.10.1 libxml2 2.9.4 libxslt 1.1.29 marionette-collective 2.9.1 openssl 1.0.2j puppet 4.8.2 puppet-ca-bundle 1.0.7 pxp-agent 1.3.2 ruby-2.1.9 2.1.9 ruby-augeas 0.5.0 ruby-selinux 2.0.94 ruby-shadow 2.3.3 ruby-stomp 1.3.3 rubygem-deep-merge 1.0.1 rubygem-fast_gettext 1.1.0 rubygem-gettext 3.2.2 rubygem-gettext-setup 0.6 rubygem-hocon 0.9.3 rubygem-locale 2.1.2-2 rubygem-net-ssh 2.9.2 rubygem-semantic_puppet 0.1.2 rubygem-text 1.3.1 runtime shellpath 2015-09-18 virt-what 1.14
Updated by Mario Mayerle Filho over 7 years ago
Hello all.
Same problem here. Any help?
Updated by Anonymous over 7 years ago
I suspect that mcollective-specific puppet agent is missing. Puppetlabs changed how agents are installed in Puppet version 4, you may need to install puppet mco agent manually. Please see https://tickets.puppetlabs.com/browse/MCO-722 for more details.