Project

General

Profile

Actions

Bug #11331

closed

foreman_smartproxy: failed to call refresh: missing param 'id' in parameters after ensure failure

Added by Jan Hutař over 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Low
Assignee:
-
Category:
Foreman modules
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

production.log production.log 854 KB production.log Jan Hutař, 08/18/2015 02:33 AM
katello-installer.log katello-installer.log 1.59 MB katello-installer.log Jan Hutař, 08/18/2015 02:40 AM

Related issues 1 (0 open1 closed)

Related to Installer - Bug #10466: Proxy registration puppet error is not clearClosedLukas Zapletal05/11/2015Actions
Actions #1

Updated by Jan Hutař over 8 years ago

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:
Actions #2

Updated by Lukas Zapletal over 8 years ago

  • Project changed from Foreman to Installer
  • Category set to Foreman modules

I think something calls notify before proxy resource was created:

https://github.com/theforeman/puppet-foreman/commit/03978d6a5eb55da4fe5eb316db1833fbba344d14

Actions #3

Updated by Lukas Zapletal over 8 years ago

  • 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.

Actions #4

Updated by Dominic Cleal over 8 years ago

  • 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.

Actions #5

Updated by Lukas Zapletal over 8 years ago

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"

Actions #6

Updated by Lukas Zapletal over 8 years ago

I mean, this error is likely from apipie bindings. I think 'id' is set to nil.

Actions #7

Updated by Dominic Cleal over 8 years ago

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[&lt;fqdn&gt;]/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.)

Actions #8

Updated by Eric Helms over 8 years ago

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?

Actions #9

Updated by Dominic Cleal over 8 years ago

It does now (#10466), but I suspect that this pre-dates that feature.

Actions #10

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #10466: Proxy registration puppet error is not clear added
Actions #11

Updated by Jan Hutař over 8 years ago

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.

Actions #12

Updated by Dominic Cleal over 8 years ago

  • 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.

Actions #13

Updated by Lukas Zapletal over 8 years ago

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".

Actions #14

Updated by Dominic Cleal over 8 years ago

  • 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.

Actions #15

Updated by Jan Hutař over 8 years ago

Encountered it again. Attaching production.log.

Actions #16

Updated by Jan Hutař over 8 years ago

And katello-installer.log from same run as in comment #15 above

Actions #17

Updated by Dominic Cleal over 8 years ago

  • 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.

Actions #18

Updated by Jan Hutař over 8 years ago

/var/log/foreman-proxy/access.log is empty and proxy.log only have this:

  1. 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.

Actions #19

Updated by Jan Hutař over 8 years ago

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

Actions #20

Updated by Dominic Cleal over 8 years ago

Does the smart proxy register if you do it now, manually? (since it now says foreman-proxy (pid 10918) is running...)

Actions #21

Updated by Jan Hutař over 8 years ago

On https://&lt;fqdn&gt;/smart_proxies I have attempted to create proxy per

http://projects.theforeman.org/projects/smart-proxy/wiki/Installation_instructions#Add-the-smart-proxy-to-the-Foremans-Smart-Proxy-page

but nothing happened (I was back on the Capsues page and that was empty, refresh did not helped).

I was logged out multiple times during this process. I haven't spotted anything suspicious (traceback) in the logs.

Any chance this can be caused by not running qpidd as mentioned in comment #19?

Actions #22

Updated by Anonymous almost 8 years ago

what's the status here?

Actions #23

Updated by Dominic Cleal almost 8 years ago

  • Status changed from Need more information to Resolved

The original issue has been fixed in https://github.com/theforeman/puppet-foreman/commit/e74e1009, please open new tickets if you have registration problems (probably with Katello).

Actions

Also available in: Atom PDF