odpi / egeria

Egeria core
https://egeria-project.org
Apache License 2.0
806 stars 261 forks source link

User Interface fails with exception in AssetCatalog in VDC chart #784

Closed planetf1 closed 5 years ago

planetf1 commented 5 years ago

When VDC is deployed, the UI is launched via cd /root/egeria/open-metadata-implementation/user-interfaces/access-services-user-interface/target/ && java -jar access-services-user-interface-1.1-SNAPSHOT.jar This code was rebuilt today

The environment includes:

OMAS_SERVER_URL=http://lunging-eagle-vdc-egeria-service.default.svc.cluster.local:8080
OMAS_SERVER_NAME=myserver

which represent the correct servername for egeria, and a valid (within the k8s cluster) endpoint

But when trying to perform a search on the UI the following exception occurs:

2019-02-22 16:49:30.737 ERROR 1 --- [nio-8443-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null] with root cause

org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null
    at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:79) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:124) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:102) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:777) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:735) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:669) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:413) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.odpi.openmetadata.accessservices.assetcatalog.client.AssetCatalog.callPostAssetDescriptionResponse(AssetCatalog.java:453) ~[asset-catalog-client-1.1-SNAPSHOT.jar!/:na]
    at org.odpi.openmetadata.accessservices.assetcatalog.client.AssetCatalog.searchAssets(AssetCatalog.java:436) ~[asset-catalog-client-1.1-SNAPSHOT.jar!/:na]
    at org.odpi.openmetadata.userinterface.accessservices.service.AssetCatalogOMASService.searchAssets(AssetCatalogOMASService.java:43) ~[classes!/:na]
    at org.odpi.openmetadata.userinterface.accessservices.api.AssetSearchController.searchAssets(AssetSearchController.java:27) ~[classes!/:na]

The cluster contains the Coco pharma sample data, which has been loaded into IGC, and through the connector/event mapper has also been replicated into atlas. An OMAG server is also present in the cohort to support OMAS requests.

See full egeria log at https://gist.github.com/0f2846747c46ceb806a65d72b4786685

planetf1 commented 5 years ago

Have confirmed that asset catalog OMAS is returning data for example: GET http://egeriadev.eu-gb.containers.appdomain.cloud:30080/servers/myserver/open-metadata/access-services/asset-catalog/users/myuser/asset-summary/b1c497ce.6e83759b.89rmi5f47.9erfgvl.flqn91.tnpvjcq64tusc3pt862ja

responds with

{
    "relatedHTTPCode": 200,
    "assetDescriptionList": [
        {
            "guid": "b1c497ce.6e83759b.89rmi5f47.9erfgvl.flqn91.tnpvjcq64tusc3pt862ja",
            "metadataCollectionId": "905ff8e8-6106-4193-9d91-7027de26a5e7",
            "createdBy": "Administrator IIS",
            "createTime": "2019-02-22T15:47:53.000+0000",
            "updatedBy": "Administrator IIS",
            "updateTime": "2019-02-22T15:47:53.000+0000",
            "version": 1550850473000,
            "status": "ACTIVE",
            "typeDefName": "Database",
            "typeDefDescription": "A data store containing relational data.",
            "url": "https://158.176.66.119:9446/ibm/iis/igc-rest/v1/assets/b1c497ce.6e83759b.89rmi5f47.9erfgvl.flqn91.tnpvjcq64tusc3pt862ja"
        }
    ]
}
planetf1 commented 5 years ago

Note that in this latter case I was issuing the request from an external environment (VIA POSTMAN) , so the target port differs

Issuing the request from within the UI container, this time using the internal port:ip results in the same result:

root@lunging-eagle-vdc-ui-deployment-6c99d5cd54-kcxjs:~/egeria/open-metadata-distribution/open-metadata-assemblies/target/egeria-1.1-SNAPSHOT-omag-server/servers/omag-server-1.1-SNAPSHOT#

http --auth admin:admin ${OMAS_SERVER_URL}/servers/myserver/open-metadata/access-services/asset-catalog/users/myuser/asset-summary/b1c497ce.6e83759b.89rmi5f47.9erfgvl.flqn91.tnpvjcq64tusc3pt862ja
HTTP/1.1 200
Content-Disposition: inline;filename=f.txt
Content-Type: application/json;charset=UTF-8
Date: Fri, 22 Feb 2019 17:14:09 GMT
Transfer-Encoding: chunked

{
    "assetDescriptionList": [
        {
            "createTime": "2019-02-22T15:47:53.000+0000",
            "createdBy": "Administrator IIS",
            "guid": "b1c497ce.6e83759b.89rmi5f47.9erfgvl.flqn91.tnpvjcq64tusc3pt862ja",
            "metadataCollectionId": "905ff8e8-6106-4193-9d91-7027de26a5e7",
            "status": "ACTIVE",
            "typeDefDescription": "A data store containing relational data.",
            "typeDefName": "Database",
            "updateTime": "2019-02-22T15:47:53.000+0000",
            "updatedBy": "Administrator IIS",
            "url": "https://158.176.66.119:9446/ibm/iis/igc-rest/v1/assets/b1c497ce.6e83759b.89rmi5f47.9erfgvl.flqn91.tnpvjcq64tusc3pt862ja",
            "version": 1550850473000
        }
    ],
    "relatedHTTPCode": 200
}
planetf1 commented 5 years ago

OMAS_SERVER_URL should be interpreted as overriding the omas.server.url spring property as per https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html

This technique has been used in, for example, the igc connector successfully. It requires no change to the code.

planetf1 commented 5 years ago

Two example runs of the UI.

In both cases run locally using 'master'

  1. Default values for omas server url & name -> get a connection refused as expected, since egeria is not running locally
  2. Overriding OMAS_SERVER_URL and OMAS_SERVER_NAME to point to cloud - reproduces the 500 Error as reported above.

In each case I just entered the search string 'Database' (I am unsure what is valid)

Full console log: https://gist.github.com/585d2a63d48fba331b18ec7bfd10ac36

planetf1 commented 5 years ago

From the debugger - as par as callPostAssetDescriptionResponse url = /servers/{0}/open-metadata/access-services/asset-catalog/users/{1}/search-asset/{2} params= .. seemingly defaults with most values 0/null, status=ACTIVE, excludeDeleted=true

bogdan-sava commented 5 years ago

Did you get any response from the search-asset call ?

bogdan-sava commented 5 years ago

What are you searching for in the UI ?

planetf1 commented 5 years ago

I tried search for FNAME, EMPLOYEE, First - all produce same error

UI webapp exception remains as:

2019-03-03 12:36:10.380 ERROR 1 --- [nio-8443-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null] with root cause

org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null
    at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:79) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:124) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:102) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:777) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:735) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:669) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:413) ~[spring-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.odpi.openmetadata.accessservices.assetcatalog.client.AssetCatalog.callPostAssetDescriptionResponse(AssetCatalog.java:453) ~[asset-catalog-client-1.1-SNAPSHOT.jar!/:na]

Concurrently the server i raising an exception:

2019-03-03 12:36:10.373 ERROR 6 --- [nio-8080-exec-7] o.a.c.c.C.[Tomcat].[localhost]           : Exception Processing ErrorPage[errorCode=0, location=/error]

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.springframework.http.MediaType.isPresentIn(Ljava/util/Collection;)Z
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1053) ~[spring-webmvc-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908) ~[spring-webmvc-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.14.jar!/:9.0.14]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]

This would explain the 500 error from the client. The 'class not found' error is odd as I am running against the server chassis & OMAS/OMRS are generally working. Perhaps something specific to asset catalog, a dependency not being pulled in, or wrong version libraries.

planetf1 commented 5 years ago

Looking at our Nexus IQ run I can see we have mixed spring versions

I suspect the fix here is to consolidate on a single version.

I would suggest we switch from using 'properties' to DependencyManagement to better address transitive dependencies, and that we encode 5.1.4 as the preferred level in the top level pom. Other poms will not need & should not refer to specific versions.

Springboot looks more consistent at 2.1.2, though there are a few additional spring components at different versions (perhaps correctly).

This would explain something like a classNotFound -- though I do not know why you do not see the error. Perhaps you have different spring libraries in the classpath or have something different in the build @bogdan-sava ?

I'm happy to create a PR encompassing the above suggestion, and try it out. We know we have inconsistencies with versions which even if it doesn't fix this issue, is a problem that should be addressed.

planetf1 commented 5 years ago

cc: @mandy-chessell @grahamwallis does this change seem reasonable?

mandy-chessell commented 5 years ago

Please do ...

grahamwallis commented 5 years ago

Agreed - it would be good to introduce DepMgt anyway - whether it fixes this problem or not.

planetf1 commented 5 years ago

delegated consolidation of spring versions to https://github.com/odpi/egeria/issues/807 Will revisit this issue once above is incorporated into master & built into docker images.

planetf1 commented 5 years ago

Following #807 the UI now appears to function, and a search for FNAME returns correct results with no exceptions.

I conclude the cause was mismatched libraries. cc: @bogdan-sava

planetf1 commented 5 years ago

Closing this