500 when attempting to provision newly discovered machine

Relevant bits from the pastebin:

2021-09-27T19:30:00 [W|app|aa1dee76] undefined method `puppet' for nil:NilClass
2021-09-27T19:30:00 [I|app|aa1dee76] Backtrace for 'undefined method `puppet' for nil:NilClass' error (ActionView::Template::Error): undefined method `puppet' for nil:NilClass
 aa1dee76 | /usr/share/gems/gems/foreman_puppet-1.0.1/app/views/hosts/_form_puppet_enc_tab.html.erb:3:in `_0429e47b0fd5632dbae334f9be8a72ce'

@ezr-ondrej @nadjaheitmann have you seen this?

I thought this should have been fixed in discovery 18.0.0. Did you restart the foreman service after upgrading the packages?

Is the problem occurring for discovered hosts only?

Reproduced, Puppet 1.0.1 is likely missing a commit.

I tested with Discovery 18.0 and Puppet develop branch and it works, but Puppet 1.0.1 branch does not and I experience the very same issue. @ezr-ondrej there is likely a commit that needs to be backported into Foreman 3.0 version of the puppet plugin.

I tested 18.0 against develop when I was testing it, both via Quick provision and Customize host. I should have done this against 1.0.1, my bad.

Yup, this should be already resolved in 1.0.3, tho we are still on 1.0.1 in Foreman 3.0, the Puppet plugin 1.0.3 got merged into packaging yesterday, I’ll backport those into 3.0, but it will go with Foreman 3.0.1 anyway.

1 Like

FYI you do not need to wait, when something is utterly broken (like in this case) just release it, ask our packaging team to trigger the pipeline.

But if you have some regressions concerns, sure, wait for it.

Hi, thanks for responding. I reboot the entire box after installing and post configs pass.

Thanks @lzap

Just ended up on the same issue with a discovered host.

Thanks to the team for the quick patch!

Foreman 3.0 of Ubuntu 20.04 version of the puppet plugin is still retaining 1.0.0.

On Centos, the latest packages available are foreman 3.0.0 and foreman_puppet 1.0.1.

Foreman_puppet 1.0.3 is available in the nightly repository.

Which is the best approach to patch foreman 3.0.0 with this fix? Wait for foreman 3.0.1 (any idea on when it will be released)? Use the foreman_puppet package from the nightly repository?

We have just merged 1.0.3 puppet plugin into 3.0 branch, the release is near. Just a bit more, sorry about that.

Requested the release: Release pipeline for Foreman Puppet 1.0.3

Many thanks for the update!

Thanks for the quick release of the updated package.

Now I ended up in another issue. Will report it in the right thread (looks like this issue)

Sorry, mea culpa. I had to reboot the foreman master to have the foreman puppet plugin refreshed from 1.0.1 to 1.0.3. And then the customize host problem disappeared.

We are tracking another issue - provisioning of puppet related data will not work over CLI/API. In the meantime, use hostgroups that should work.

Thanks for the notification.

For the server I provisioned yesterday, I used Discovered Hosts → Provision → Customize Host → selected the right hostgroup → and then further customization in the host page.

Actually, I found a bug on the Host Parameters page. When you click on Override, a new empty line is added. If you add multiple overrides, the values (key/value) in the previous ones are cleared. Probably something in the javascript.

Workaround is to add x overrides, and then fill manually all the fields.

Should I report this in a new thread?

Do you see the same if you edit an existing (provisioned) host? If so, file against Foreman core - Hosts. If you only see this for discovery then file it against Discovery Redmine project.

Ok done. Bug 33698 created.

1 Like