S

Friday, August 5th, 2022 12:47 PM

Spring Boot - Collibra core API issues

Hi spring-team.collibra.com ,

I am using Collibra Integration Library v1.1.8 within the spring boot application .
I have setup all the config properties related to coolibra like collibra.url,collibra.username, collibra.password,collibra.ssl.key-store,collibra.ssl.key-store-password, collibra.ssl.trust-store, collibra.ssl.trust-store-password.
When the application is launched i can see in the logs that it has successfully authenticated with Collibra instance, so I am assuming this is no problem.
Next, I have a small microservice in my RestController class which eventually calls -
AssetsApi assetsApi = apiClient.buildClient(AssetsApi.class);
assetsApi.getAsset(UUID.fromString(uuid)).getDisplayName();

Offcourse, apiClient has been Autowired as described in the documentation like -
@Autowired
public xyzClass(ApiClient apiClient){
this.apiClient = apiClient;
}

Now when i calls this api, i get error like -
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[?:1.8.0_321]

this error when the call is made to - assetsApi.getAsset(UUID.fromString(uuid)).getDisplayName();
Not sure why there is an error wrt SSL Handshake when i have already been authenticated successfully with collibra
Can you please help me on this ?

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for trying the Spring Boot Integration Library.

Regarding the above, since it seems that a self-signed certificate is being used; can you please try adding the Collibra instance certificate to your Java installation, cacerts as explained in section “Adding the Collibra Instance Certificate to Java cacerts KeyStore” of the library documentation? Thanks

12 Messages

Hi @spring-team.collibra.com ,

The SSL issue was resolved , as this was related to the firewall issue with my Org .

However, now I get connect time out issue for the same piece of code, any ideas why it must be happening ?

Again, the collibra instance gets successfully authenticated with the springboot application as was the case earlier .

@kristen.freer

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for the update.

Can you please provide the logs as a private message for the connection timeout issue? Thanks

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for logs.

Can you please confirm whether you are using the following GCP Data Catalog to Collibra integration?

Additionally, it seems that the request is being made from the AttachFileController.getAsset() method which might be custom code. Can you please confirm how the call to the Collibra instance is being made (i.e. whether using an Integration Library class or a Java request)?

In case it is a Collibra Integration Library class, can you please let us know which method is being used? Thanks

12 Messages

Hi @spring-team.collibra.com,

I am using the mentioned integration alongwith this as well https://marketplace.collibra.com/listings/spring-boot-integration-library/

Yes this is a custom code AttachFileController.getAsset() which uses Integration Library class 'AssetsApi '. The code looks like below -

AssetsApi assetsApi = apiClient.buildClient(AssetsApi.class);
assetsApi.getAsset(UUID.fromString(uuid)).getDisplayName()

Offcourse, apiClient has been Autowired as described in the documentation like -
@Autowired
public xyzClass(ApiClient apiClient){
this.apiClient = apiClient;
}

FYI, i have printed few logs before the call ‘assetsApi.getAsset(UUID.fromString(uuid)).getDisplayName()’ in the code and all those logs are printed in the logs , however the timeout error prints in the log at the above mentioned call of ‘getAsset’

@kristen.freer

12 Messages

2 years ago

Hi @spring-team.collibra.com,

On enabling the http logs via collibra.log.http-requests-at-info=true, i see that below is the further info of collibra integration I am using-

“displayVersion”:“2022.08.0”},“buildNumber”:“20220805105520”,

Also, I see that the below http req is made when a call is made to “assetsApi.getAsset(UUID.fromString(uuid)).getDisplayName()” –

HTTP GET : https://db-collibra-gcp.collibra.com/rest/2.0/assets/3efa4248-039a-4aee-9522-4f26f64ebbd5
Logger - > Headers: {Accept=[application/json], Authorization=[Basic **************], User-Agent=[[web-services]]}
Logger - > Body: null

This above logs prints successively for 5 times post which it starts to give connect time out error .

Just FYI, the collibra instance is on cloud

12 Messages

2 years ago

HI @spring-team.collibra.com,

One more update -

When i do the curl of the same http request (for which i get connect time out error) from the server where springboot app is deployed , the response is successful-

curl https://db-collibra-gcp.collibra.com/rest/2.0/assets/3efa4248-039a-4aee-9522-4f26f64ebbd5 -H “Authorization: Basic ***********” -H “accept: application/json” -H “User-Agent: web-services”

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for the information provided. Will debug the issue and keep you updated.

368 Messages

2 years ago

Hello @shardul.vaidya,

From the Java code where a request is being made to get an asset by its ID (i.e. assetsApi.getAsset()), can you please temporarily try replacing this with a call to the assetsApi.findAssets() passing an asset name? This will return a list of assets.

Example:

AssetsApi assetsApi = apiClient.buildClient(AssetsApi.class); assetsApi.findAssets(new 
FindAssetsQueryParams().name("Test").nameMatchMode("EXACT"));

where: Test would be the asset name.

Additionally, can you please advise how long it took for the curl request that was executed on the same server to receive the response? Thanks

12 Messages

Hi @spring-team.collibra.com ,

There is no class as ‘FindAssetsQueryParams’, it gives me error.
Also , the only methods that are available for assetApi.findAssets are as -

  • List item AssetPagedResponse findAssets(@QueryMap(encoded = true) Map<String, Object> paramMap);

  • List item AssetPagedResponse findAssets(@Param(“offset”) Integer paramInteger1, @Param(“limit”) Integer paramInteger2, @Param(“name”) String paramString1, @Param(“nameMatchMode”) String paramString2, @Param(“domainId”) UUID paramUUID1, @Param(“communityId”) UUID paramUUID2, @Param(“typeId”) List paramList1, @Param(“statusId”) List paramList2, @Param(“tagNames”) List paramList, @Param(“typeInheritance”) Boolean paramBoolean1, @Param(“excludeMeta”) Boolean paramBoolean2, @Param(“sortField”) String paramString3, @Param(“sortOrder”) String paramString4);

Also , the response comes within milliseconds with a curl command

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for the update.

The ‘FindAssetsQueryParams’ should be available via this following import:

import com.collibra.marketplace.library.generated.core.api.AssetsApi.FindAssetsQueryParams;

12 Messages

Thank you for the update, but after testing the code provided by you , still getting same error -

GlobalExceptionHandler - Internal error during execution.
7.160.200] failed: connect timed out executing GET https://db-collibra-gcp.collibra.com/rest/2.0/assets?nameMatchMode=EXACT&name=Test

12 Messages

2 years ago

Hi @spring-team.collibra.com,

I think the issue might be with Feign client because when i invoke methods from any of the collibra API classes like eg - assetsApi.getAsset(UUID.fromString(uuid)).getDisplayName()… I get connect timeout error from feign client.

Unfortunately there is no provision in the spring boot integration provided by you to modify the read and connect timeout values for feign client .

Can you please try to verify from that perspective ?

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for the update.

Yes, the timeout option has been added to the next version of the Collibra Integration Library (not yet released).

Can you please let us know whether it would be possible to share a pre-release version with you to ensure it solves your issue? Thanks

12 Messages

2 years ago

Hello @spring-team.collibra.com,

Thank you for the response !
Actually , one more thing I would like to point out to you is that the server where the spring boot application is deployed uses proxy to call the collibra instance. Please note there is no proxy username and password for our server.

For that I have setup below properties in application.properties -
collibra.proxy.host
collibra.proxy.port

When the authentication call to collibra is made , it is successful as it makes use of these proxy properties stated above.

However, when a call is made to collibra library class eg - assetsApi.getAsset() , it uses feign client to invoke the service and there is no provision to set any properties to set proxy details for the feign client to use .

This could be the reason for the connect timeout issue.

Can you please advice on how should i configure the proxy details so that the feign client would use them ?

368 Messages

2 years ago

Hello @shardul.vaidya,

Thanks for the information provided, will keep you updated.

12 Messages

2 years ago

Hi @spring-team.collibra.com,

Any update on this ?

368 Messages

2 years ago

Hi @shardul.vaidya,

Just to let you know that shared the pre-release version for testing purposes only via a private message. Thanks

12 Messages

Hi @spring-team.collibra.com,

Finally, I am able to test it successfully and access the collibra instance details via collibra api classes successfully !

Thanks a lot for your support !

368 Messages

2 years ago

Hi @shardul.vaidya,

Thanks for testing it and keeping us updated.

Please remember to use the released version once it is available on Collibra’s Marketplace.

Will keep you updated.

Loading...