stefaniexyy opened a new issue, #15347:
URL: https://github.com/apache/dolphinscheduler/issues/15347

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   When I try to add a new trino data source,I get a error
   ```log
   [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 
   ```URL
   
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
   ```json
   
{"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 
   ```URL
   
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
   ```json
   
{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}
   ```
   Then I get the error in API server log.
   If you just config like 
   ```json
   {"SSL":"true"}
   ```
   the data source can be configed but will not work,you will see
   ```log
   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
   ```json
   
{"SSL":"true","SSLKeyStorePassword":"password","SSLKeyStorePath":"myJKSfilePath"}
   ```
   you will see add data source fail
   
   ### Anything else
   
   Now I update the database table dolphinscheduler
   ```sql
   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
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to