VMware Cloud Community
benfab
Contributor
Contributor

Cannot get children of a vRA Catalog Resource

Hello,

I am struggling to execute this action code below in our environment.

var requestId = request.id;

var resources =  vCACCAFEEntitiesFinder.getCatalogResources(host); 

var catalogResources = new Array();

for each (var resource in resources) {    

if (resource.requestId === requestId) {

           catalogResources.push(resource); 

    }

}

  if (catalogResources.length === 0) {

   System.warn("Catalog Resource not found");

}

return catalogResources;

I am getting the error below while executing the action in a workflow:

[2019-06-24 20:09:36.837] [I] Debug

[2019-06-24 20:09:36.844] [I] DynamicWrapper (Instance) : [vCACCAFEHost]-[class com.vmware.o11n.plugin.vcac.model.VCACHost] -- VALUE : test_VRA [https://<redacted>] [vsphere.local]

[2019-06-24 20:09:36.850] [I] DynamicWrapper (Instance) : [vCACCAFECatalogItemRequest]-[class com.vmware.vcac.catalog.rest.stubs.CatalogItemRequest] -- VALUE : com.vmware.vcac.catalog.rest.stubs.CatalogItemRequest@2e56e473

[2019-06-24 20:09:36.856] [I] 9adb017e-8503-4840-b8aa-26181ad934f3

[2019-06-24 20:09:36.920] [E] (com.dev.custom/getChildrenOfVraCatalogResource) Error in (Dynamic Script Module name : getChildrenOfVraCatalogResource#19) java.lang.reflect.InvocationTargetException

[2019-06-24 20:09:36.954] [E] Workflow execution stack:

***

item: 'GetChildrenResources/item1', state: 'failed', business state: 'null', exception: 'java.lang.reflect.InvocationTargetException (Dynamic Script Module name : getChildrenOfVraCatalogResource#19)'

workflow: 'GetChildrenResources' (be1bb993-b14a-428e-8df0-147e0c29743a)

|  'attribute': name=host type=vCACCAFE:VCACHost value=dunes://service.dunes.ch/CustomSDKObject?id='8cfdf130-ab36-41b2-891e-4b16feb9cf14'&dunesName='vCACCAFE:VCACHost'

|  'attribute': name=request type=vCACCAFE:CatalogItemRequest value=dunes://service.dunes.ch/CustomSDKObject?id='f3dd59ab-3949-4fe3-82dd-16137dfc850b/9adb017e-8503-4840-b8aa-26181ad934f3'&dunesName='vCACCAFE:CatalogItemRequest'

|  'attribute': name=actionResult type=Array/vCACCAFE:CatalogResource value=__NULL__

|  'no inputs'

|  'no outputs'

*** End of execution stack.

From the logs, it seems that vRO fails to fetch some details from the NSX network:


vac/access_log

127.0.0.1 [24/Jun/2019:11:38:52 +0400][1067 ms] "POST /network-service/api/resources/types/Infrastructure.Network.Network.NSX HTTP/1.1" 404 146 [tomcat-http--47]

vcac/catalina.out

[UTC:2019-06-24 07:38:52,297 Local:2019-06-24 11:38:52,297] vcac: [component="cafe:network-service" priority="WARN" thread="tomcat-http--47" tenant="vsphere.local" context="5rFPtz8D" parent="" token="5rFPtz8D"] com.vmware.vcac.components

.network.repository.gateway.NetworkProviderGatewayImpl.getNetwork:306 - Unable to retrieve network with id: [52] from provider with serviceTypeId: [com.vmware.csp.iaas.blueprint.service]

org.springframework.web.client.HttpClientErrorException: 404

[UTC:2019-06-24 07:38:52,628 Local:2019-06-24 11:38:52,628] vcac: [component="container-service" priority="WARN" thread="tomcat-http--1" tenant="vsphere.local" context="5rFPtz8D" parent="5rFPtz8D" token="DyCe4i2E"] org.springframework.we

b.servlet.PageNotFound.noHandlerFound:1176 - No mapping found for HTTP request with URI [/container-service/api/callbacks/network/networks/52] in DispatcherServlet with name 'dispatcher'

[UTC:2019-06-24 07:38:52,633 Local:2019-06-24 11:38:52,633] vcac: [component="cafe:network-service" priority="WARN" thread="tomcat-http--47" tenant="vsphere.local" context="5rFPtz8D" parent="" token="5rFPtz8D"] com.vmware.vcac.components

.network.repository.gateway.NetworkProviderGatewayImpl.getNetwork:306 - Unable to retrieve network with id: [52] from provider with serviceTypeId: [com.vmware.csp.component.cafe.container]

org.springframework.web.client.HttpClientErrorException: 404

[UTC:2019-06-24 07:38:52,651 Local:2019-06-24 11:38:52,651] vcac: [component="cafe:network-service" priority="WARN" thread="tomcat-http--47" tenant="vsphere.local" context="5rFPtz8D" parent="" token="5rFPtz8D"] com.vmware.vcac.components

.network.repository.gateway.NetworkProviderGatewayImpl.findOne:75 - Network with id: [52] is not found.

[UTC:2019-06-24 07:38:52,669 Local:2019-06-24 11:38:52,669] vcac: [component="cafe:catalog" priority="ERROR" thread="catalogTaskExecutor-1" tenant="" context="" parent="" token=""] com.vmware.vcac.catalog.service.impl.ConsumerResourceSer

viceImpl.lambda$updateResourceGroups$11:829 - Error retrieving Resources from provider. Reason:

org.springframework.web.client.HttpClientErrorException: 404

I would be happy to receive any hints to troubleshoot this issue.
Thank you for you help!

vRA version: 7.5.0.10044239
vCAC plugin: 7.5.0

NSX plugin: 1.2.0

Reply
0 Kudos
5 Replies
qc4vmware
Virtuoso
Virtuoso

Can you upload your action or workflow for analysis?  If the example you have is what is being executed it wouldn't do much of anything so far as I can tell.

Reply
0 Kudos
benfab
Contributor
Contributor

Thank you for your answer. Please find enclosed the workflow.

Reply
0 Kudos
qc4vmware
Virtuoso
Virtuoso

You've not included the action in the workflow.  Please upload that or cut and paste the code into this thread.  When you export a workflow it does not include nested workflows or actions.  When you make a package and add the workflow to it vRO will do its best to snag all the related objects but just exporting a workflow only grabs that one object.

Reply
0 Kudos
benfab
Contributor
Contributor

I am attaching the exported action, in addition the action source code is available my initial post.

Reply
0 Kudos
qc4vmware
Virtuoso
Virtuoso

The code of the action you supplied is expecting a catalog item request as the input but your action passes in a catalogResource.  I'm attaching an action for you that will retrieve the children of a resource.

Reply
0 Kudos