Disabling all modules in the group

Hello,

I have setup the Foreman 2.0.1 with Puppet 6.17.0. on Ubuntu 18.04. I have configured the Puppet run provider using the - puppet_proxy_ssh - run puppet over SSH.

I am able to push the Puppet Classes and Modules using Puppet Run Option couple of times and after few iterations I am getting the below error.

Error: - Disabling all modules in the group [‘puppet’] due to a failure in one of them: (): did not find expected key while parsing a block mapping at line 3 column 1

Backtrace

/usr/lib/ruby/2.5.0/psych.rb:402:in parse' /usr/lib/ruby/2.5.0/psych.rb:402:in parse_stream’ /usr/lib/ruby/2.5.0/psych.rb:350:in parse' /usr/lib/ruby/2.5.0/psych.rb:263:in load’ /usr/share/foreman-proxy/lib/proxy/settings.rb:27:in read_settings_file' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:301:in load_configuration_file’ /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:272:in load_settings' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:264:in load_plugin_settings’ /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:80:in load_plugin_settings' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:167:in block in initialize_plugins’ /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:167:in each' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:167:in initialize_plugins’ /usr/share/foreman-proxy/lib/launcher.rb:168:in launch' /usr/share/foreman-proxy/bin/smart-proxy:6:in

Can you please help me, how to resolve it or any hints.

I will appreciate your help!!

This is from /var/log/foreman-proxy/proxy.log

2020-08-18T04:38:29 [I] WEBrick::HTTPServer#start: pid=1319 port=8443
2020-08-18T04:38:29 [I] Smart proxy has launched on 1 socket(s), waiting for requests
2020-08-18T04:42:04 a08a2cb4 [I] Started POST /puppet/run
2020-08-18T04:42:04 a08a2cb4 [I] Finished POST /puppet/run with 404 (47.7 ms)
2020-08-18T04:42:42 909b2293 [I] Started GET /version
2020-08-18T04:42:42 909b2293 [I] Finished GET /version with 200 (0.37 ms)
2020-08-18T04:42:45 7d5ea374 [I] Started GET /tftp/serverName
2020-08-18T04:42:45 7d5ea374 [I] Finished GET /tftp/serverName with 200 (0.48 ms)
2020-08-18T04:42:45 dc330558 [I] Started GET /logs/ from_timestamp=0
2020-08-18T04:42:45 dc330558 [I] Finished GET /logs/ with 200 (1.05 ms)
2020-08-18T04:42:46 3992ebc6 [I] Started GET /puppet/ca
2020-08-18T04:42:46 9f04d620 [I] Started GET /puppet/ca/autosign
2020-08-18T04:42:46 9f04d620 [I] Finished GET /puppet/ca/autosign with 200 (0.66 ms)
2020-08-18T04:42:46 69ada7ca [I] Started GET /puppet/ca
2020-08-18T04:42:46 aff64a69 [I] Started GET /puppet/environments
2020-08-18T04:42:46 aff64a69 [I] Finished GET /puppet/environments with 404 (0.44 ms)
2020-08-18T04:42:46 c528b8af [I] Started GET /puppet/ca
2020-08-18T04:42:47 69ada7ca [I] Finished GET /puppet/ca with 200 (803.45 ms)
2020-08-18T04:42:47 c528b8af [I] Finished GET /puppet/ca with 200 (380.35 ms)
2020-08-18T04:42:47 3992ebc6 [I] Finished GET /puppet/ca with 200 (965.65 ms)
2020-08-18T04:57:17 [I] going to shutdown …
2020-08-18T04:57:17 [I] WEBrick::HTTPServer#start done.
2020-08-18T05:44:20 [E] Disabling all modules in the group [‘puppet’] due to a failure in one of them: (): did not find expected key while parsing a block mappingat line 3 column 1

That suggests it can’t parse the Puppet configuration file. The message suggests it’s invalid YAML on line 3.

Can You please help with file path. I am new for foreman and puppet?

It will be one of the files you modified. I’d review /etc/foreman-proxy/settings.d/puppet_*.

Thanks for your quick response!!

I have updated below files from /etc/foreman-proxy/settings.d/

puppet_proxy_ssh.yml
puppet.yml

below are the file contains.

When I am pushing the classes or modules from Foreman UI. Packages are getting installed on nodes but still I am I am getting the same error.

image

The problem is in puppet.yml. You uncommented documentated rather than updating the use_provider option. Note that the foreman-installer can also set this up for you and is the recommended approach:

foreman-installer --foreman-proxy-puppetrun-provider ssh

It looks like you also modified the command, but I’d suggest to stick to the default unless you know what you’re doing.

1 Like

Thanks for giving this solution, it’s resolved my issue.

Now, When I ran the puppet Run command to apply the classes for Foreman UI, getting below message.

image

When I have checked by logging into the servers. I have seen packages are not installed and when i check the logs i found below error.

[ERROR]:- SSL_accept SYSCALL returned=5 errno=0 state=SSLv3/TLS write server done

Appreciate your help!!

Please note the the “Puppet Run” functionality has been deprecated and will be removed in Foreman 2.2, in part due to the difficulty of setting it up properly (as well as the fact this functionality was removed from puppet itself many years ago). The recommended way of triggering a one-off puppet agent execution is using the Remote Execution plugin. Dropping "Run puppet" button with a replacement using remote execution plugin has more information.

You should mention where exactly you found that error.

SSL Issue is resolved. Now i am not getting any errors. But the problem is.

Problem:
When I am applying the classes on nodes using the puppet run options its not getting applied on the puppet nodes. Even I am not able to show any error or warnings in to the logs.

When i tried to check nodes reports form the foreman UI, it’s not generating the reports as well.

Reports are generated after 30 minutes and packages are also applied after 30 mins.

When I run the sudo /opt/puppetlabs/bin/puppet agent -t by login to the nodes clssess are immediately applied on the nodes.

Can you please help me to investigate more on this? If you need any more information on this please let me know.

I will appreciate your help!!

@tbrisker I will check for remote execution plugin and update you.

Thanks

Is there anything in /var/log/foreman-proxy/proxy.log? Can you at least confirm Foreman sends the API request to Foreman Proxy? Is it making the SSH connection correctly? Can you see that on the target machine there is a log entry for that? Those are the steps that I would take.

Hi,

I have checked and able to ssh from foreman server to nodes.

Please refer the attached logs for more details.

Puppet Agents Logs.log (52.2 KB) Puppet Server Logs.log (7.4 KB)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.