RedHatOfficial / miq-RedHat-Satellite6

ManageIQ Automate Domain for integrating with Red Hat Satellite 6 developed by Red Hat Consulting.
GNU General Public License v3.0
18 stars 7 forks source link

Hostgroup lookup fails in the Service Dialog "Satellite Provisioning" #85

Closed sigbjornaib closed 5 years ago

sigbjornaib commented 5 years ago

Hostgroup lookup fails in the Service Dialog "Satellite Provisioning"

error from automation.log: [----] E, [2019-02-18T19:57:03.619786 #56199:54fa998] ERROR -- : RestClient::NotFound: 404 Not Found

error from foreman/production.log on the Satellite server: 2019-02-18 20:03:42 6d7590f9 [app] [E] ActiveRecord::RecordNotFound: Couldn't find Katello::KTEnvironment with 'id'=!

Adding Hostgroup to "fields to refresh" on the "Environment" is a workaround, however I guess it's no use to search for host groups for a certain KTEnvironment until the environment has actually been selected...?

itewk commented 5 years ago

@sigbjornaib can you provide more logs? it would be helpful to know exactly which part of this code is throwing the error as this is not something I have experienced.

sigbjornaib commented 5 years ago

Sure, please see attached below. [----] I, [2019-02-18T19:57:02.231484 #56199:128be54] INFO -- : Instantiating [/Integration/Satellite/DynamicDialogs/get_hostgroups?Array%3A%3Adialog_location_tags=%5B%5D&MiqServer%3A%3Amiq_server=1000000000003&ServiceTemplate%3A%3Aservice_template=1000000000009&User%3A%3Auser=1000000000002&dialog_number_of_vms=1&dialog_option_0_number_of_sockets=1&dialog_option_0_vm_memory=2048&dialog_os_tag=os%2Frhel7&dialog_satellite_environment_id=%21&dialog_satellite_hostgroup_id=0&dialog_satellite_organization_id=1&dialog_service_name=&dialog_vm_prefix=&object_name=get_hostgroups&vmdb_object_type=service_template] [----] I, [2019-02-18T19:57:02.263695 #56199:128be54] INFO -- : Updated namespace [/Integration/Satellite/DynamicDialogs/get_hostgroups?Array%3A%3Adialog_location_tags=%5B%5D&MiqServer%3A%3Amiq_server=1000000000003&ServiceTemplate%3A%3Aservice_template=1000000000009&User%3A%3Auser=1000000000002&dialog_number_of_vms=1&dialog_option_0_number_of_sockets=1&dialog_option_0_vm_memory=2048&dialog_os_tag=os%2Frhel7&dialog_satellite_environment_id=%21&dialog_satellite_hostgroup_id=0&dialog_satellite_organization_id=1&dialog_service_name=&dialog_vm_prefix=&object_name=get_hostgroups&vmdb_object_type=service_template RedHatConsulting_Satellite6/Integration/Satellite] [----] I, [2019-02-18T19:57:02.320130 #56199:128be54] INFO -- : Updated namespace [Integration/Satellite/DynamicDialogs/get_hostgroups RedHatConsulting_Satellite6/Integration/Satellite] [----] I, [2019-02-18T19:57:02.327915 #56199:128be54] INFO -- : Invoking [inline] method [/RedHatConsulting_Satellite6/Integration/Satellite/DynamicDialogs/get_hostgroups] with inputs [{}] [----] I, [2019-02-18T19:57:02.329555 #56199:128be54] INFO -- : <AEMethod [/RedHatConsulting_Satellite6/Integration/Satellite/DynamicDialogs/get_hostgroups]> Starting [----] I, [2019-02-18T19:57:02.770130 #56199:54fa998] INFO -- : Updated namespace [Integration/Satellite/Configuration/default Configuration/Integration/Satellite] [----] I, [2019-02-18T19:57:02.830965 #56199:54fa998] INFO -- : Updated namespace [Integration/Satellite/Configuration/get_satellite_configuration RedHatConsulting_Satellite6/Integration/Satellite] [----] I, [2019-02-18T19:57:02.862442 #56199:54fa998] INFO -- : Invoking [inline] method [/RedHatConsulting_Satellite6/Integration/Satellite/Configuration/get_satellite_configuration] with inputs [{}] [----] I, [2019-02-18T19:57:02.863255 #56199:54fa998] INFO -- : <AEMethod [/RedHatConsulting_Satellite6/Integration/Satellite/Configuration/get_satellite_configuration]> Starting [----] I, [2019-02-18T19:57:03.208557 #56199:54fa998] INFO -- : <AEMethod [/RedHatConsulting_Satellite6/Integration/Satellite/Configuration/get_satellite_configuration]> Ending [----] I, [2019-02-18T19:57:03.208786 #56199:54fa998] INFO -- : Method exited with rc=MIQ_OK [----] E, [2019-02-18T19:57:03.618539 #56199:54fa998] ERROR -- : <AEMethod get_hostgroups> The following error occurred during method evaluation: [----] E, [2019-02-18T19:57:03.619786 #56199:54fa998] ERROR -- : <AEMethod get_hostgroups> RestClient::NotFound: 404 Not Found [----] E, [2019-02-18T19:57:03.620665 #56199:54fa998] ERROR -- : <AEMethod get_hostgroups> /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:223:inexception_with_response' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:103:in return!' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:809:inprocess_result' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:725:in block in transmit' /opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:instart' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:715:in transmit' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:145:inexecute' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in execute' /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/resource.rb:51:inget' /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:285:in call_client' /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:216:inhttp_call' /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:161:in call' /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/resource.rb:14:incall' [----] E, [2019-02-18T19:57:03.623985 #56199:54fa998] ERROR -- : Method STDERR: /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:223:in exception_with_response': 404 Not Found (RestClient::NotFound) [----] E, [2019-02-18T19:57:03.624434 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:103:inreturn!' [----] E, [2019-02-18T19:57:03.624852 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:809:in process_result' [----] E, [2019-02-18T19:57:03.625267 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:725:inblock in transmit' [----] E, [2019-02-18T19:57:03.625678 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:in start' [----] E, [2019-02-18T19:57:03.626102 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:715:intransmit' [----] E, [2019-02-18T19:57:03.626525 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in execute' [----] E, [2019-02-18T19:57:03.626931 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/request.rb:52:inexecute' [----] E, [2019-02-18T19:57:03.627347 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/rest-client-2.0.2/lib/restclient/resource.rb:51:in get' [----] E, [2019-02-18T19:57:03.627985 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:285:incall_client' [----] E, [2019-02-18T19:57:03.628535 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:216:in http_call' [----] E, [2019-02-18T19:57:03.629003 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:161:incall' [----] E, [2019-02-18T19:57:03.629542 #56199:54fa998] ERROR -- : Method STDERR: from /opt/rh/cfme-gemset/gems/apipie-bindings-0.0.15/lib/apipie_bindings/resource.rb:14:in call' [----] E, [2019-02-18T19:57:03.630025 #56199:54fa998] ERROR -- : Method STDERR: from /RedHatConsulting_Satellite6/Integration/Satellite/DynamicDialogs/get_hostgroups:51:in

' [----] I, [2019-02-18T19:57:03.683969 #56199:128be54] INFO -- : <AEMethod [/RedHatConsulting_Satellite6/Integration/Satellite/DynamicDialogs/get_hostgroups]> Ending [----] E, [2019-02-18T19:57:03.684893 #56199:128be54] ERROR -- : Aborting instantiation (unknown method return code) because [Method exited with rc=Unknown RC: [1]]`

itewk commented 5 years ago

@sigbjornaib so it would seem then that two things need to happen:

  1. this line doesn't seem to be doing what it should, preventing a check if the ID isn't set: https://github.com/RedHatOfficial/miq-RedHat-Satellite6/blob/master/Automate/RedHatConsulting_Satellite6/Integration/Satellite/DynamicDialogs.class/__methods__/get_hostgroups.rb#L50

  2. update the dialogs in this repo to have the refresh from environment to hostgroup like you listed

agreed?

sigbjornaib commented 5 years ago

You're the expert. I trust your judgement. :)

itewk commented 5 years ago

@sigbjornaib expert is a strong word.

@A-Beck heyo buddy....friend....pal....EXPERT :)

Since you have an active development envionrment, would you mind doing the changes mentioned in https://github.com/RedHatOfficial/miq-RedHat-Satellite6/issues/85#issuecomment-465979207 ?

A-Beck commented 5 years ago

@itewk Yep, I'd be happy to

itewk commented 5 years ago

@sigbjornaib this is resolved by https://github.com/RedHatOfficial/miq-RedHat-Satellite6/pull/87

Thanks for the bug report!