Openshift provider refresh failed with Cloudforms 4.5


#1

Hello,

We are currently encountering an issue concerning refresh on our Cloudforms installation (CFME 5.8.0.17) with Openshift provider. We always have the following error for Openshift refresh (from evm.log):

[----] E, [2017-06-14T13:27:06.898512 #2877:10f9140] ERROR -- : MIQ(MiqQueue#deliver) Message id: [1000047668562], Error: [undefined method `collect' for nil:NilClass]
[----] E, [2017-06-14T13:27:06.898878 #2877:10f9140] ERROR -- : [EmsRefresh::Refreshers::EmsRefresherMixin::PartialRefreshError]: undefined method `collect' for nil:NilClass  Method:[rescue in deliver]
[----] E, [2017-06-14T13:27:06.899031 #2877:10f9140] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:50:in `refresh'
[----] E, [2017-06-14T13:28:29.565786 #2877:10f9140] ERROR -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::Refresher#refresh) EMS: [Kermit], id: [1000000000001] Refresh failed
[----] E, [2017-06-14T13:28:29.566924 #2877:10f9140] ERROR -- : [NoMethodError]: undefined method `collect' for nil:NilClass  Method:[rescue in block in refresh]
[----] E, [2017-06-14T13:28:29.567100 #2877:10f9140] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/openshift/container_manager/refresh_parser.rb:150:in `parse_template'
[----] E, [2017-06-14T13:28:29.567165 #2877:10f9140] ERROR -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::Refresher#refresh) EMS: [Kermit], id: [1000000000001] Unable to perform refresh for the following targets:
[----] E, [2017-06-14T13:28:29.567297 #2877:10f9140] ERROR -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::Refresher#refresh)  --- ManageIQ::Providers::Openshift::ContainerManager [Kermit] id [1000000000001]

It’s a blocking point for us because we are using Cloudforms with our Openshift provider in order to generate bills, and if refresh doesn’t work, we don’t see new Openshift projects created and their metrics consumptions are not collected.

What can we do about it ?

Thanks

RAKOTOARISOA Jérémy


#2

@cben See also the subsequent gitter chat: :point_right: June 14, 2017 7:59 AM


#3

@jerem28 thanks for reporting. I’m opening a bugzilla to make sure it’s fixed.

IIUC the whole point of templates is to contain an objects: list.
https://docs.openshift.org/latest/dev_guide/templates.html

It sounds like you have some template(s) without objects?
This should identify them:

oc get template --all-namespaces -o yaml | ruby -ryaml -e '
  puts YAML.load(STDIN)["items"].select{ |t| 
    t["objects"].nil? || t["objects"].empty? 
  }.to_yaml'

As an immediate workaround, you could try deleting these templates (or editing them to contain some objects).


#4

@cben thanks for your quick reply, actually we had one of our customer who created a template without object (we can actually set “null” for object value), that was the one which prevent us refreshing Openshift provider. I had an object on it and it works again ! So thanks for the workaround.


#5

https://bugzilla.redhat.com/show_bug.cgi?id=1461785
Didn’t know your email, add yourself to CC List if you want to follow along.

UPDATE: fixed on master https://github.com/ManageIQ/manageiq-providers-openshift/pull/24, fine/backported, should be in 5.8.1 (not following if it’s released yet).