Project

General

Profile

Bug #7063

Foreman_smartproxy fails to evalute with "couldn't find HOME environment"

Added by Gavin Williams over 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

When running Puppet as a service, the Foreman_smartproxy type fails with:

puppet-agent[7955]: (/Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[act-lg-tdns01.test.card.co.uk]) Could not evaluate: couldn't find HOME environment -- expanding `~/.cache'

Running Puppet manually works as expected.

Running on a CentOS 6.5 host, using following versions:

$ rpm -qa |grep "foreman\|puppet"
puppetlabs-release-6-7.noarch
puppet-3.5.1-1.el6.noarch
rubygem-foreman_api-0.1.11-1.el6.noarch
foreman-proxy-1.5.2-1.el6.noarch

puppet-foreman module is 2.2.0 from Git.

Associated revisions

Revision 4e1cd10d (diff)
Added by Dominic Cleal over 6 years ago

fixes #7063 - use explicit apipie-bindings cache dir as $HOME can't be expanded in a daemon

Closes GH-215

Revision f3f67bb4 (diff)
Added by Dominic Cleal about 6 years ago

refs #7063 - change cache path so installer (root) doesn't conflict with master (puppet) user

History

#1 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

I opened this against apipie-bindings, so we can override the base directory it uses for caching: https://github.com/Apipie/apipie-bindings/pull/14. Once that's in, we can set the option to Puppet's vardir or something.

#2 Updated by Dominic Cleal over 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Target version set to 1.7.5

#3 Updated by Dmitri Dolguikh over 6 years ago

  • Target version changed from 1.7.5 to 1.7.4

#4 Updated by Dominic Cleal over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by cristian falcas about 6 years ago

We are still seeing this error using this puppet modules:
- theforeman-foreman-2.2.3
- theforeman-puppet-2.2.1
- theforeman-foreman_proxy-2.0.1

[root@puppet ~]# rpm -qa | grep foreman | sort
foreman-1.6.0-1.el6.noarch
foreman-compute-1.6.0-1.el6.noarch
foreman-postgresql-1.6.0-1.el6.noarch
foreman-proxy-1.6.0-1.el6.noarch
foreman-selinux-1.6.0-1.el6.noarch
foreman-vmware-1.6.0-1.el6.noarch
ruby193-rubygem-foreman_bootdisk-3.2.0-1.el6.noarch
ruby193-rubygem-foreman_setup-2.1.0-1.el6.noarch
ruby193-rubygem-puppetdb_foreman-0.0.9-1.el6.noarch
rubygem-foreman_api-0.1.11-1.el6.noarch

#6 Updated by Dominic Cleal about 6 years ago

Ensure you have rubygem-apipie-bindings 0.0.9 or higher too.

#7 Updated by Elisiano Petrini about 6 years ago

Dominic Cleal wrote:

Ensure you have rubygem-apipie-bindings 0.0.9 or higher too.

I'm also affected by this, running the latest version of the module (taken from the foreman-installer package) and all the latest packages from the foreman repository.

It seems that the repo is not updated (the most recent version of foreman is 1.6.1, where on the site is 1.6.2). Also, the packaged version of rubygem-apipie-bindings is 0.0.8 ( http://yum.theforeman.org/releases/latest/el6/x86_64/ ).

Although I know I could install the 'package' using the gem provider, I'd rather stay with RPMs.

Do you have an idea when the new releases will be packaged?

#8 Updated by Dominic Cleal about 6 years ago

We probably won't put a newer version of apipie-bindings into the 1.6 release repos, just so we don't disrupt the stability. We had some complexity with 0.0.9 and above, because you need this module fix (https://github.com/theforeman/puppet-foreman/commit/a50b3e477076d59b701d36c331931874f88e46ee) and that's not in the current released installer (the module with this fix however is on the Forge). I don't plan on another 1.6.x release at the moment, otherwise would include it.

I'd suggest either:

  • use a newer apipie-bindings from our nightly repo, plus a newer version of 'foreman' from the Puppet Forge or git
  • install rubygem-foreman_api (should still be in the repo) and set the provider on the resource to 'rest' (resource defaults?)

Regarding 1.6.1 vs 1.6.2, 1.6.2 was only a release of the smart proxy and installer, not core Foreman. See http://theforeman.org/manuals/1.6/index.html#Releasenotesfor1.6.2

#9 Updated by Elisiano Petrini about 6 years ago

Hi Dominic,
thanks for pointing out the nightly repo, I was not aware of that!

Just by installing apipie-bindings 0.0.10 solved the issue (there was no need to upgrade the module)!
I was surprised it worked without updating the module, but checking lib/puppet/provider/foreman_smartproxy/rest_v2.rb I confirm it's still the old version.

Also, about the versioning, apologies about the mixup, I got confused by the sentence "We strongly recommend that users update to Foreman 1.6.2 as soon as possible due to the security issue that has been fixed in this version".

Thanks a lot for your help.

Best Regards,
Elisiano Petrini

#10 Updated by Dominic Cleal about 6 years ago

No problem. The versioning does cause some confusion which I might try and address from 1.7 onwards by always releasing all projects together. I've been trying to optimise our release process so this is possible without much extra work, as you're not the first to have questioned it.

#11 Updated by Elisiano Petrini about 6 years ago

I take it back! :/

Running "puppet agent -t" works fine, but when it runs from the daemon I get the same error (even though I restarted the puppet agents).

I'll try to upgrade the module.

#12 Updated by Elisiano Petrini about 6 years ago

Confirmed working (upgrading the module), apologies for the noise.

Thanks again for your help.

Also available in: Atom PDF