Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [datasource] Trino:datasource other params illegal #15347

Closed
2 of 3 tasks
stefaniexyy opened this issue Dec 20, 2023 · 2 comments · Fixed by #15351
Closed
2 of 3 tasks

[Bug] [datasource] Trino:datasource other params illegal #15347

stefaniexyy opened this issue Dec 20, 2023 · 2 comments · Fixed by #15351
Labels
bug Something isn't working

Comments

@stefaniexyy
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When I try to add a new trino data source,I get a error

[INFO] 2023-12-20 18:49:04.362 +0800 org.apache.dolphinscheduler.api.aspect.AccessLogAspect:[107] - REQUEST TRACE_ID:11985932131264, LOGIN_USER:admin, URI:/dolphinscheduler/datasources/connect, METHOD:POST, HANDLER:org.apache.dolphinscheduler.api.controller.DataSourceController.connectDataSource, ARGS:{jsonStr={"type":"TRINO","label":"TRINO","name":"Trino评估","note":"","host":"**.**.**.**","port":8443,"principal":"","javaSecurityKrb5Conf":"","loginUserKeytabUsername":"","loginUserKeytabPath":"","mode":"","userName":"test","password":"******","database":"dwh","connectType":"","other":{"SSL":"true","SSLKeyStorePassword":"******","SSLKeyStorePath":"/home/dolphinscheduler/trino.jks"},"endpoint":"","MSIClientId":"","dbUser":"","datawarehouse":""}}
[ERROR] 2023-12-20 18:49:04.363 +0800 org.apache.dolphinscheduler.api.exceptions.ApiExceptionHandler:[52] - 建立数据源连接失败
java.lang.IllegalArgumentException: datasource other params illegal
        at org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor.checkOther(AbstractDataSourceProcessor.java:100)
        at org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor.checkDatasourceParam(AbstractDataSourceProcessor.java:61)
        at org.apache.dolphinscheduler.plugin.datasource.api.utils.DataSourceUtils.checkDatasourceParam(DataSourceUtils.java:46)
        at org.apache.dolphinscheduler.api.controller.DataSourceController.connectDataSource(DataSourceController.java:221)
        at org.apache.dolphinscheduler.api.controller.DataSourceController$$FastClassBySpringCGLIB$$835fdd04.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
        at org.apache.dolphinscheduler.api.aspect.AccessLogAspect.doAround(AccessLogAspect.java:119)
        at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)

As I know when you try to connect to a Trino with SSL, the jdbc string must link

jdbc:trino://IP:PORT?&SSL=true&SSLKeyStorePassword=password&SSLKeyStorePath=<Path to jks file location>

But In dolphinscheduler I can not config jdbc sting then I had to add a jdbc connect parameters

{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}

Then I get the error in API server log

What you expected to happen

As I know when you try to connect to a Trino with SSL, the jdbc string must link

jdbc:trino://IP:PORT?&SSL=true&SSLKeyStorePassword=password&SSLKeyStorePath=<Path to jks file location>

But In dolphinscheduler I can not config jdbc sting then I had to add a jdbc connect parameters

{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}

Then I get the error in API server log.
If you just config like

{"SSL":"true"}

the data source can be configed but will not work,you will see

Caused by: java.sql.SQLException: Error executing query: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How to reproduce

Just config a Trino data source use jdbc connect parameters

{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}

you will see add data source fail

Anything else

Now I update the database table dolphinscheduler

update dolphinscheduler.t_ds_datasource set connection_params='{"user":"test","password":"*****","address":"jdbc:trino://**.**.**.**:8443","database":"dwh","jdbcUrl":"jdbc:trino://**.**.**.**:8443/dwh?&SSL=true&SSLKeyStorePassword=*****&SSLKeyStorePath=/home/dolphinscheduler/trino.jks","driverClassName":"io.trino.jdbc.TrinoDriver","validationQuery":"select 1"}' where id=12

to make the trino work.
But I don't want to update database again, I hope all config can be done in Web UI.

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@stefaniexyy stefaniexyy added bug Something isn't working Waiting for reply Waiting for reply labels Dec 20, 2023
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When I try to add a new trino data source,I get a error

[INFO] 2023-12-20 18:49:04.362 +0800 org.apache.dolphinscheduler.api.aspect.AccessLogAspect:[107] - REQUEST TRACE_ID:11985932131264, LOGIN_USER:admin, URI:/dolphinscheduler/datasources/connect, METHOD:POST, HANDLER:org.apache.dolphinscheduler.api.controller.DataSourceController.connectDataSource, ARGS:{jsonStr={"type":"TRINO","label":"TRINO","name":"Trino评估","note":"","host":"**.**.**.**","port":8443,"principal":"","javaSecurityKrb5Conf":"","loginUserKeytabUsername":"","loginUserKeytabPath":"","mode":"","userName":"test","password":"******","database":"dwh","connectType":"","other":{"SSL":"true","SSLKeyStorePassword":"******","SSLKeyStorePath":"/home/dolphinscheduler/trino.jks"},"endpoint":"","MSIClientId":"","dbUser":"","datawarehouse":""}}
[ERROR] 2023-12-20 18:49:04.363 +0800 org.apache.dolphinscheduler.api.exceptions.ApiExceptionHandler:[52] - 建立数据源连接失败
java.lang.IllegalArgumentException: datasource other params illegal
        at org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor.checkOther(AbstractDataSourceProcessor.java:100)
        at org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor.checkDatasourceParam(AbstractDataSourceProcessor.java:61)
        at org.apache.dolphinscheduler.plugin.datasource.api.utils.DataSourceUtils.checkDatasourceParam(DataSourceUtils.java:46)
        at org.apache.dolphinscheduler.api.controller.DataSourceController.connectDataSource(DataSourceController.java:221)
        at org.apache.dolphinscheduler.api.controller.DataSourceController$$FastClassBySpringCGLIB$$835fdd04.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
        at org.apache.dolphinscheduler.api.aspect.AccessLogAspect.doAround(AccessLogAspect.java:119)
        at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)

As I know when you try to connect to a Trino with SSL, the jdbc string must link

jdbc:trino://IP:PORT?&SSL=true&SSLKeyStorePassword=password&SSLKeyStorePath=<Path to jks file location>

But In dolphinscheduler I can not config jdbc sting then I had to add a jdbc connect parameters

{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}

Then I get the error in API server log

What you expected to happen

As I know when you try to connect to a Trino with SSL, the jdbc string must link

jdbc:trino://IP:PORT?&SSL=true&SSLKeyStorePassword=password&SSLKeyStorePath=<Path to jks file location>

But In dolphinscheduler I can not config jdbc sting then I had to add a jdbc connect parameters

{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}

Then I get the error in API server log.
If you just config like

{"SSL":"true"}

the data source can be configed but will not work,you will see

Caused by: java.sql.SQLException: Error executing query: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How to reproduce

Just config a Trino data source use jdbc connect parameters

{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}

you will see add data source fail

Anything else

Now I update the database table dolphinscheduler

update dolphinscheduler.t_ds_datasource set connection_params='{"user":"test","password":"*****","address":"jdbc:trino://**.**.**.**:8443","database":"dwh","jdbcUrl":"jdbc:trino://**.**.**.**:8443/dwh?&SSL=true&SSLKeyStorePassword=*****&SSLKeyStorePath=/home/dolphinscheduler/trino.jks","driverClassName":"io.trino.jdbc.TrinoDriver","validationQuery":"select 1"}' where id=12

to make the trino work.
But I don't want to update database again, I hope all config can be done in Web UI.

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@stefaniexyy stefaniexyy changed the title [Bug] [datasource] Trino illegal parmeter [Bug] [datasource] Trino:datasource other params illegal Dec 20, 2023
@ruanwenjun
Copy link
Member

Thanks for reporting this, I submit #15351 to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants