Project

General

Profile

Actions

Bug #12889

closed

foreman-proxy fails with implicit conversion error message if sudo is not installed

Added by Tomas Agartz over 8 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
Low
Assignee:
-
Category:
Puppet
Target version:
-
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

Note: Debian does not install sudo by default if you do not select "system utilities", and foreman-installer does not install it either.

When clicking the "certificates" on the Infrastructure -> Smart Proxies page, nothing happens in the web browser.
In the log, the following error can be found:

2015-12-20T16:32:14 [app] [W] ProxyAPI operation FAILED
 | ProxyAPI::ProxyException: ERF12-5356 [ProxyAPI::ProxyException]: Unable to get PuppetCA certificates ([RestClient::NotAcceptable]: 406 Not Acceptable) for proxy https://foreman.agartz.net:8443/puppet/ca

Running the smart-proxy under strace reveals the following:

stat("/usr/bin/puppet", {st_mode=S_IFREG|0755, st_size=253, ...}) = 0
write(8, "D, [2015-12-20T16:32:14.900899 #10972] DEBUG -- : Found puppetca at /usr/bin/puppet\n", 84) = 84
stat("/usr/bin/sudo", 0x7fd9c62f0fe0)   = -1 ENOENT (No such file or directory)
stat("/usr/sbin/sudo", 0x7fd9c62f0fe0)  = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/sudo", 0x7fd9c62f0fe0) = -1 ENOENT (No such file or directory)
stat("/usr/local/sbin/sudo", 0x7fd9c62f0fe0) = -1 ENOENT (No such file or directory)
stat("/sbin/sudo", 0x7fd9c62f0fe0)      = -1 ENOENT (No such file or directory)
stat("/bin/sudo", 0x7fd9c62f0fe0)       = -1 ENOENT (No such file or directory)
write(8, "E, [2015-12-20T16:32:14.901864 #10972] ERROR -- : Failed to list certificates: no implicit conversion of false into String\n", 123) = 123

"apt-get install sudo" resolved the issue for me.

Actions #1

Updated by Tomas Agartz over 8 years ago

(checking tasksel in debian 8.2 and the "system utilities" or whatever the name used to be doesn't even exit any more it seems)

Actions #2

Updated by Dominic Cleal over 8 years ago

  • Subject changed from foreman-proxy fails with incorrect error message if sudo is not installed to foreman-proxy fails with implicit conversion error message if sudo is not installed
  • Category set to Puppet

Could you provide the log from the smart proxy itself? The strace is hard to read, and a copy of the log with debugging enabled (under /etc/foreman-proxy/settings.yml, log_level) would be clearer.

Actions #3

Updated by Tomas Agartz over 8 years ago

Even with log_leve set to DEBUG, there is nothing more interesting in the proxy log:

D, [2015-12-21T16:23:39.359569 #7070] DEBUG -- : verifying remote client 1.2.3.4 against trusted_hosts ["foreman.example.com"]
D, [2015-12-21T16:23:39.365554 #7070] DEBUG -- : Found puppetca at /usr/bin/puppet
E, [2015-12-21T16:23:39.366366 #7070] ERROR -- : Failed to list certificates: no implicit conversion of false into String
5.6.7.8 - - [21/Dec/2015 16:23:39] "GET /puppet/ca HTTP/1.1" 406 72 0.0094

What the strace says is that the proxy first looks for the puppet binary and finds it. It then searches for the sudo binary in several places and when it does not find it, it prints an error message.

There are two separate issues here, I guess:

1: The error message is wrong, it should say that sudo wasn't found, not "no implicit conversion of false into String"
2: the forman-proxy package should depend on the sudo package on Debian (Currently, sudo is listed as Recommends, not as Depends)

Actions #4

Updated by Dominic Cleal over 8 years ago

Tomas Agartz wrote:

2: the forman-proxy package should depend on the sudo package on Debian (Currently, sudo is listed as Recommends, not as Depends)

This is deliberate, since the Puppet CA module is just one of the many optional things it can do. sudo isn't required for say, the DNS management module.

Actions #5

Updated by Anonymous almost 7 years ago

  • Status changed from New to Rejected

works as designed.

Actions

Also available in: Atom PDF