michael_stefani
Enthusiast
Enthusiast

Errors getting array of vCACCAFE:CatalogResource after upgrade to 7.4

Jump to solution

In 7.3 I was using the code below and variations of it to give me a list of all resources tied to a request ID.  Since upgrading to 7.4 I'm getting the error below. It's almost like the return type isn't an array of vCACCAE:CatalogResource anymore even though the API explorer still shows that as the output.  Anyone run into this yet?

[2018-06-28 16:06:22.556] [E] Workflow:Send Completion Notice / Find Resources (item2) : ch.dunes.model.type.ConvertorException: Unable to convert object, 'com.vmware.vcac.catalog.rest.stubs.v7_0.CatalogResource@939d787a' plugin exception reason : convertToResult() --> Finder 'vCACCAFE:CatalogResource' : unexpected error 'ch.dunes.model.sdk.SDKFinderException: convertToResult() --> Finder 'vCACCAFE:CatalogResource' : unable to find a getter method/attribute for property : 'pendingRequests''

var catalogClient = cafeHost.createCatalogClient();

var resourceService = catalogClient.getCatalogConsumerResourceService();

var filters = new Array();

filters[0] = vCACCAFEFilterParam.endsWith("resourceType/id", vCACCAFEFilterParam.string("deployment"));

filters[1] = vCACCAFEFilterParam.equal("request/id", vCACCAFEFilterParam.string(requestID));

var query = vCACCAFEOdataQuery.query();

query.addFilter(filters);

query.setTop(100);

query.setSkip(0);

var oDataRequest = new vCACCAFEPageOdataRequest(query);

myResourcesList = resourceService.getResourcesList(oDataRequest);

1 Solution

Accepted Solutions
michael_stefani
Enthusiast
Enthusiast

Support got back to me today on this.  Basically if you applied the 7.3 fix for Orchestrator below, the 7.4 upgrade doesn't know how to handle that plug-in version and doesn't upgrade it.  Even though everything in Orchestrator control center looks like it's running the 7.4 plug-in it's not.  We used the KB below to stop orchestrator, remove the KB plug-in, cleanup, then start orchestrator back up.  When it comes back up it uses the correct 7.4 plug-in and all of our custom code that uses the CAFE plug-in just worked. 

VMware Knowledge Base

Remove Plug-in KB:  VMware Knowledge Base

View solution in original post

17 Replies
daphnissov
Immortal
Immortal

Did you check vRO and make sure the café plug-in got updated appropriately?

0 Kudos
michael_stefani
Enthusiast
Enthusiast

I hadn't, but I just checked and they're all showing version 7.4. The weird thing is it seems like the return value is definitely an array. If I dump it into a generic variable I can pull the length and even the VM name.  It just doesn't seem to like me outputting it.  I even tried changing the type to an array of type any but same error.

var resourcesList = resourceService.getResourcesList(oDataRequest);

var item = resourcesList[0];

System.log("Number of items found: " + resourcesList.length);

System.log("Resource Name: " + item.name);

0 Kudos
daphnissov
Immortal
Immortal
0 Kudos
michael_stefani
Enthusiast
Enthusiast

Starting to lean toward issue with the plug-in itself. When I got into my vRA plug-in -> Items it times out and gives a very similar error.

0 Kudos
iiliev
VMware Employee
VMware Employee

pendingRequests property seems to be removed in 7.4

Could you attach the output from the following two requests (replacing {VRA_ADDR} with FQDN or IP address of your vRA instance)? You can either open the URLs in a browser, or use some REST client like cURL/Postman/etc.

https://{VRA_ADDR}/vco/api/plugins

https://{VRA_ADDR}/vco/api/catalog/vCACCAFE/metadata

0 Kudos
thomas_root1
Enthusiast
Enthusiast

I've got exactly the same error. Is there a workaround to retrieve the pendingRequests? The only difference is that we use a standalone orchestrator in our environment.

After the update of the standalone vRO the following plug-in versions are displayed in the control-center:

- vCAC 7.4.0.8072010

- vCACCAFE 7.4.0.8074348

But the vRO-Client shows still version 7.3 in the inventory pane.

0 Kudos
thomas_root1
Enthusiast
Enthusiast

I figured out that all catalog resources are properly returned in an array. The error occurs in the moment the variable is stored as an attribute or output parameter of an action/workflow. Is it a bug of the new plug-in version?

INPUT: host, catalogItemRequest

OUTPUT-TYPE: Array/vCACCAFE:CatalogResource

var service = host.createCatalogClient().getCatalogConsumerRequestService();

var results = service.getResourcesProvisionedByRequest(catalogItemRequest.id, null).getContent();

for each(var result in results) {

     System.log(System.getObjectClassName(result)); //always: vCACCAFECatalogResource

}

return results; //=> This leads to the error

0 Kudos
iiliev
VMware Employee
VMware Employee

I'll check with vRA team, but it looks more like some component not completely upgraded to 7.4. Do you have a clean 7.4 deployment (not an upgrade from an earlier version) to verify if you see the same error there?

0 Kudos
thomas_root1
Enthusiast
Enthusiast

Thank you!

Unfortunately not. Actually this affects only our QA environment. Our production environment is still on version 7.3 but we plan also to upgrade it to 7.4 in the next weeks. We need this update to leverage the new vRA features. Should I open a SR additionaly?

0 Kudos
iiliev
VMware Employee
VMware Employee

I spoke with a vRA engineer, and she also believes this error could be not due to a plug-in problem but due to some stuff not being updated. So it will be helpful if you can deploy a new clean 7.4 appliance and check if the error is still there or not.

Of course, you can open a SR if you want to track this issue through official channels.

0 Kudos
michael_stefani
Enthusiast
Enthusiast

I've got a case open with VMware on this too as this is affecting our prod environment.  Hoping it's had enough eyes on it since Friday that we can make some progress today / tomorrow.  Agree with Thomas though that the problem seems to happen with you assign the results to a variable.  I can work with the return results and grab out the pieces I need just fine.  As much as I'd rather not have to, I've though about reworking some of our workflows to just do all the code in one big scriptable task.  That's more of a last resort for us though.

0 Kudos
thomas_root1
Enthusiast
Enthusiast

We also testet the workaround with only grab the the needed information of the objects and store it in a new one. But this workaround is not applicable for us because many workflows rely heavily on the CatalogResource object and we would have to refactor them all.

@Michael: Did you already hear something from VMware support?

0 Kudos
michael_stefani
Enthusiast
Enthusiast

No response as of yesterday, I hit them up again this morning for an update.  I feel like 7.4 has been out long enough that I'm surprised this hasn't come up yet.

0 Kudos
michael_stefani
Enthusiast
Enthusiast

You guys make any progress with this?  VMware support is still looking at our issue, but we're a week in now and having to manually work around multiple failed workflows for every build is getting really old. 

0 Kudos
michael_stefani
Enthusiast
Enthusiast

Support got back to me today on this.  Basically if you applied the 7.3 fix for Orchestrator below, the 7.4 upgrade doesn't know how to handle that plug-in version and doesn't upgrade it.  Even though everything in Orchestrator control center looks like it's running the 7.4 plug-in it's not.  We used the KB below to stop orchestrator, remove the KB plug-in, cleanup, then start orchestrator back up.  When it comes back up it uses the correct 7.4 plug-in and all of our custom code that uses the CAFE plug-in just worked. 

VMware Knowledge Base

Remove Plug-in KB:  VMware Knowledge Base

View solution in original post

thomas_root1
Enthusiast
Enthusiast

Hi Michael.

VMware Support got also back to me yesterday. We found out a very similar solution for the problem. There was already some leftover vra plug-in named KB2150546_o11nplugin-vcaccafe.dar from a previous upgrade to 7.3.1 in the folder /var/lib/vco/app-sever/temp/dars. Before upgrading to 7.4 we had to delete this leftover by following the steps of KB2151653 that you already referenced. After this the upgrade worked properly. Also our workflows worked properly and they could retrieve the CatalogResources by vra plug-in again Smiley Happy

0 Kudos
qc4vmware
Virtuoso
Virtuoso

I just hit a similar issue with an upgrade to 7.5 .  The error was in reference to composite blueprints but basically the same.  Sure enough the cafe plugin was still showing as 7.3 .  Manually tearing it out and reinstalling fixed my issue.

0 Kudos