OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

OpenMetadata JAVA is not using env proxy variables.

Open martinmajtan opened this issue 3 years ago • 2 comments

Hello,

I have OpenMetadata instance installed in Kubernetes cluster. I want to set SSO with Keycloak, We also have KeyCloak instance in another K8S cluster. We followed official documentation and created secret and set URLs for publicKeys, authority, callbackUrl and clientId.

After log in to OpenMetadata GUI, put KeyCloak user we are redirected to OpenMetadata, but we receive this error message:

An exception with message [No key found in with kid PIZjaqGKkYQ7_li7PUo6AfTaQ_r4Hx335oGs9znZM_A] was thrown while processing request.

In logs from openmetadata container, its showing error message, that it can't resolve my KeyCloak domain:

Suppressed: com.auth0.jwk.NetworkException: Cannot obtain jwks from url https://MY_DOMAIN/auth/realms/xxx/protocol/openid-connect/certs at com.auth0.jwk.UrlJwkProvider.getJwks(UrlJwkProvider.java:139) at com.auth0.jwk.UrlJwkProvider.getAll(UrlJwkProvider.java:145) at com.auth0.jwk.UrlJwkProvider.get(UrlJwkProvider.java:163) at org.openmetadata.service.security.MultiUrlJwkProvider.get(MultiUrlJwkProvider.java:37) ... 66 common frames omitted Caused by: java.net.UnknownHostException: MY_DOMAIN

The thing is, I set env variables for proxy for that container and from the container I can reach and recieve that publickeys with curl command from the exact URL.

It seems that JAVA is not using env variables with proxy settings. Is here some way how to use proxy settings for JAVA in Open-Metadata ?

martinmajtan avatar Jun 22 '23 10:06 martinmajtan

Hello, For anyone who need this before it's added in next release, it can be done with ExtraEnvs variable 'OPENMETADATA_HEAP_OPTS' It's not the cleanest way but it;s working.

I used it like this:

extraEnvs:
 - name: OPENMETADATA_HEAP_OPTS
   value: "-Xmx1G -Xms1G -Djavax.net.ssl.trustStore=/openmetadata.jks -Dhttp.proxyHost={{ http_proxy }} -Dhttp.proxyPort={{ http_proxyPort }} -Dhttps.proxyHost={{ http_proxy }} -Dhttps.proxyPort={{ http_proxyPort }} -Dhttp.nonProxyHosts=127.0.0.1,localhost"

martinmajtan avatar Jul 21 '23 12:07 martinmajtan

@akash-jain-10 @tutte let's get this into docs and close this ticket out. We will not be doing anything more than that.

harshach avatar Jul 29 '23 17:07 harshach