Bug #11331
closed
foreman_smartproxy: failed to call refresh: missing param 'id' in parameters after ensure failure
Added by Jan Hutař over 9 years ago.
Updated almost 9 years ago.
Description
# katello-installer --foreman-admin-email '<email>' --foreman-admin-username '<user>' --foreman-admin-password '<pass>' --capsule-parent-fqdn <fqdn> --capsule-dns true --capsule-dns-forwarders <ip1> --capsule-dns-forwarders <ip2> --capsule-dns-forwarders <ip3> --capsule-dns-interface virbr1 --capsule-dns-zone katellolabs.org --capsule-dhcp true --capsule-dhcp-interface virbr1 --capsule-tftp true --capsule-puppet true --capsule-puppetca true --capsule-register-in-foreman true --capsule-foreman-oauth-secret <secret> --capsule-pulp false
[...]
Notice: /Stage[main]/Certs::Foreman/Exec[foreman_c: 668/669, 99%, 0.0/s, elapsed: 00:10:23
[31m Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
[0mError: Could not set 'present' on ensure: 422 Unpr: 668/669, 99%, 0.0/s, elapsed: 00:11:04
[31m Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
[0m[31m /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]/ensure: change from absent to present failed: Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
[0m[31m /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]: Failed to call refresh: missing param 'id' in parameters
[0m[31m /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]: missing param 'id' in parameters
[0m[32mDone [0m: 669/669, 100%, 0.0/s, elapsed: 00:11:08
[32mDone [0m: 669/669, 100%, 0.0/s, elapsed: 00:11:08
[1m[31mSomething went wrong![0m Check the log for ERROR-level output
The full log is at [1m[36m/var/log/katello-installer/katello-installer.log[0m
This comes from Satellite 6 compose Satellite-6.1.0-RHEL-7-20150808.1-Satellite-x86_64
Files
Just for a record:
# firewall-cmd --list-all
public (default, active)
interfaces: enp6s0
sources:
services: dhcpv6-client ssh
ports: 12432/tcp 443/tcp 80/tcp 8140/tcp 9090/tcp 5647/tcp 5646/tcp 67/udp 8000/tcp 8443/tcp 5910-5930/tcp 53/tcp 69/udp 53/udp 5671/tcp 5674/tcp 68/udp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
- Project changed from Foreman to Installer
- Category set to Foreman modules
- Subject changed from katello-installer fails with: Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp to katello-installer fails with: Could not set 'present' on ensure: 422 Unprocessable Entity -- Failed to call refresh: missing param 'id' in parameters
It happens randomly, not everytime, right.
- Description updated (diff)
- Status changed from New to Need more information
The refresh/notify is irrelevant, given that it failed to set the ensure property, so the proxy isn't even registered.
"422 Unprocessable Entity" is an error from Foreman's API, so please provide its logs. It should show why the proxy failed to be added.
Dominic, the error message is present in the logs. It reads: "missing param 'id' in parameters". This happens when you call refresh with emty id: "//refresh"
I mean, this error is likely from apipie bindings. I think 'id' is set to nil.
Sure, but that's because it failed to register the smart proxy. See the first error message:
[0m[31m /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]/ensure: change from absent to present failed: Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
If it couldn't register the smart proxy, then it's going to fail to refresh it too. Ignore the refresh message and figure out why it didn't register in the first place.
(We could certainly handle the failed refresh when the proxy isn't registered better, but I don't think that's the problem you're reporting here.)
This error tends to be one of the biggest misnomers out there, because if it reaches this step and the server throws an error due to something else having potentially failed prior then the user sees this. Would changing the puppet provider code to display the error response from the server when registering so that it is indicated to the user be an acceptable change?
It does now (#10466), but I suspect that this pre-dates that feature.
- Related to Bug #10466: Proxy registration puppet error is not clear added
Dominic Cleal wrote:
The refresh/notify is irrelevant, given that it failed to set the ensure property, so the proxy isn't even registered.
"422 Unprocessable Entity" is an error from Foreman's API, so please provide its logs. It should show why the proxy failed to be added.
I'm sorry. I have lost the system and do not have the logs any more.
- Status changed from Need more information to Rejected
Ok, closing. If you can reproduce it on a current 1.9 or nightly release you should see a clearer error message. On old versions you will need to provide production.log and/or the installer debug log IIRC.
I asked Jan to fill this bug because I believe it is not correct to try to call refresh when it's clear that id cannot be retrieved. If you think erroring out is better, we could consider giving a nicer error like "Proxy has not been registred yet".
- Subject changed from katello-installer fails with: Could not set 'present' on ensure: 422 Unprocessable Entity -- Failed to call refresh: missing param 'id' in parameters to foreman_smartproxy: failed to call refresh: missing param 'id' in parameters after ensure failure
- Status changed from Rejected to New
- Priority changed from Normal to Low
Sure, will reopen. I thought the initial failure and cause was being ignored.
The refresh method could certainly have a check added to raise an error if being refreshed for a proxy that doesn't exist. The ordering though is correct.
Encountered it again. Attaching production.log.
And katello-installer.log from same run as in comment #15 above
- Status changed from New to Need more information
Can you attach the foreman-proxy log? Is the service running after the installer has run? If not, test it and check why it isn't starting.
/var/log/foreman-proxy/access.log is empty and proxy.log only have this:
- Logfile created on Mon Aug 17 16:49:18 -0400 2015 by logger.rb/1.2.6
This failure comes from mine automation and system was already returned so I can not test it. I'll fire 5 - 10 of these to see if I'll have some luck.
OK, did 10 installs and 9th failed (10th still running).
On the failed system:
# katello-service status
mongod (pid 10623) is running...
listening on 127.0.0.1:27017
connection test successful
qdrouterd (pid 10846) is running...
celery init v10.0.
Using config script: /etc/default/pulp_workers
node reserved_resource_worker-0 (pid 11216) is running...
node reserved_resource_worker-1 (pid 11239) is running...
node reserved_resource_worker-2 (pid 11280) is running...
node reserved_resource_worker-3 (pid 11306) is running...
node reserved_resource_worker-4 (pid 11342) is running...
node reserved_resource_worker-5 (pid 11381) is running...
node reserved_resource_worker-6 (pid 11408) is running...
node reserved_resource_worker-7 (pid 11450) is running...
celery init v10.0.
Using config script: /etc/default/pulp_resource_manager
node resource_manager (pid 12751) is running...
elasticsearch (pid 12373) is running...
tomcat6 (pid 12027) is running... [ OK ]
foreman-proxy (pid 10918) is running...
celery init v10.0.
Using configuration: /etc/default/pulp_workers, /etc/default/pulp_celerybeat
pulp_celerybeat (pid 12310) is running.
dynflow_executor is running.
dynflow_executor_monitor is running.
httpd (pid 12832) is running...
Some services failed: qpidd
# service foreman-proxy status
foreman-proxy (pid 10918) is running...
# tail /var/log/katello-installer/katello-installer.log
[ INFO 2015-08-18 06:36:55 main] All hooks in group post finished
[DEBUG 2015-08-18 06:36:55 main] Exit with status code: 6 (signal was 6)
[ERROR 2015-08-18 06:36:55 main] Repeating errors encountered during run:
[ERROR 2015-08-18 06:36:55 main] Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
[ERROR 2015-08-18 06:36:55 main] Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
[ERROR 2015-08-18 06:36:55 main] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]/ensure: change from absent to present failed: Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/usr/share/katello-installer/modules/foreman_proxy/manifests/register.pp
[ERROR 2015-08-18 06:36:55 main] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]: Failed to call refresh: missing param 'id' in parameters
[ERROR 2015-08-18 06:36:55 main] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<fqdn>]: missing param 'id' in parameters
[DEBUG 2015-08-18 06:36:55 main] Cleaning /etc/katello-installer/d20150818-2722-11iainy
[DEBUG 2015-08-18 06:36:55 main] Cleaning /tmp/default_values.yaml
# tail /var/log/foreman-proxy/*
==> /var/log/foreman-proxy/access.log <==
==> /var/log/foreman-proxy/proxy.log <==
# Logfile created on Tue Aug 18 06:31:20 -0400 2015 by logger.rb/1.2.6
10.16.65.242 - - [18/Aug/2015 06:36:51] "GET /features HTTP/1.1" 200 60 0.0059
# tail -f /var/log/messages &
[2] 14807
# service qpidd start
Starting Qpid AMQP daemon:
# service qpidd status
Aug 18 09:05:14 <short> qpidd[10768]: 2015-08-18 09:05:14 [Security] error Rejected un-encrypted connection.
Aug 18 09:05:14 <short> qpidd[10768]: 2015-08-18 09:05:14 [Protocol] error Connection qpid.127.0.0.1:5672-127.0.0.1:33483 closed by error: connection-forced: Connection must be encrypted.(320)
This was on Satellite-6.1.0-RHEL-6-20150812.0-Satellite-x86_64
Does the smart proxy register if you do it now, manually? (since it now says foreman-proxy (pid 10918) is running...)
- Status changed from Need more information to Resolved
Also available in: Atom
PDF