Foreman_smartproxy fails to evalute with "couldn't find HOME environment"
When running Puppet as a service, the Foreman_smartproxy type fails with:
puppet-agent: (/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"
puppet-foreman module is 2.2.0 from Git.
fixes #7063 - use explicit apipie-bindings cache dir as $HOME can't be expanded in a daemon
#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
#4 Updated by Dominic Cleal over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset puppet-foreman|4e1cd10df415e486323bfc0ea60f3f31237950fa.
#5 Updated by cristian falcas about 6 years ago
We are still seeing this error using this puppet modules:
[root@puppet ~]# rpm -qa | grep foreman | sort
#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
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.
#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.