dolphinsheduler出现无法使用安全套接字层(SSL)加密建立与SQL Server的安 ...

打印 上一主题 下一主题

主题 705|帖子 705|积分 2115

在使用海豚调度器创建sqlserver的数据源头时出现连接失败,去服务器那边的api-server/logs下面查看报错信息
报错信息:
  1. [ERROR] 2024-01-09 04:11:54.907 -0800 org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor:[124] - Check datasource connectivity for: SQLSERVER error
  2. com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:e52d9754-ddfc-4f5f-94ec-1122dc48262b
  3.     at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3806)
  4.     at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1906)
  5.     at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3329)
  6.     at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2950)
  7.     at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2790)
  8.     at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1663)
  9.     at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1064)
  10.     at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
  11.     at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
  12.     at org.apache.dolphinscheduler.plugin.datasource.sqlserver.param.SQLServerDataSourceProcessor.getConnection(SQLServerDataSourceProcessor.java:113)
  13.     at org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor.checkDataSourceConnectivity(AbstractDataSourceProcessor.java:121)
  14.     at org.apache.dolphinscheduler.api.service.impl.DataSourceServiceImpl.checkConnection(DataSourceServiceImpl.java:362)
  15.     at org.apache.dolphinscheduler.api.service.impl.DataSourceServiceImpl$$FastClassBySpringCGLIB$$a86d54aa.invoke(<generated>)
  16.     at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
  17.     at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386)
  18.     at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
  19.     at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704)
  20.     at org.apache.dolphinscheduler.api.service.impl.DataSourceServiceImpl$$EnhancerBySpringCGLIB$$7a5f40d8.checkConnection(<generated>)
  21.     at org.apache.dolphinscheduler.api.controller.DataSourceController.connectDataSource(DataSourceController.java:223)
  22.     at org.apache.dolphinscheduler.api.controller.DataSourceController$$FastClassBySpringCGLIB$$835fdd04.invoke(<generated>)
  23.     at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
  24.     at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
  25.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
  26.     at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
  27.     at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
  28.     at org.apache.dolphinscheduler.api.aspect.AccessLogAspect.doAround(AccessLogAspect.java:119)
  29.     at jdk.internal.reflect.GeneratedMethodAccessor183.invoke(Unknown Source)
  30.     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  31.     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  32.     at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
  33.     at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
  34.     at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
  35.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
  36.     at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
  37.     at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
  38.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
  39.     at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
  40.     at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
  41.     at org.apache.dolphinscheduler.api.controller.DataSourceController$$EnhancerBySpringCGLIB$$681b02b8.connectDataSource(<generated>)
  42.     at jdk.internal.reflect.GeneratedMethodAccessor222.invoke(Unknown Source)
  43.     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  44.     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  45.     at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
  46.     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
  47.     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
  48.     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
  49.     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
  50.     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
  51.     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1070)
  52.     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
  53.     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
  54.     at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
  55.     at javax.servlet.http.HttpServlet.service(HttpServlet.java:517)
  56.     at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
  57.     at javax.servlet.http.HttpServlet.service(HttpServlet.java:584)
  58.     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
  59.     at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656)
  60.     at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
  61.     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  62.     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
  63.     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
  64.     at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
  65.     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  66.     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
  67.     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
  68.     at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
  69.     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  70.     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
  71.     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
  72.     at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
  73.     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  74.     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
  75.     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
  76.     at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
  77.     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
  78.     at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
  79.     at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
  80.     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
  81.     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
  82.     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
  83.     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
  84.     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
  85.     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
  86.     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
  87.     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
  88.     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
  89.     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
  90.     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
  91.     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
  92.     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
  93.     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
  94.     at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:772)
  95.     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
  96.     at org.eclipse.jetty.server.Server.handle(Server.java:516)
  97.     at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
  98.     at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
  99.     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
  100.     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
  101.     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
  102.     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
  103.     at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
  104.     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
  105.     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
  106.     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
  107.     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
  108.     at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
  109.     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
  110.     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
  111.     at java.base/java.lang.Thread.run(Thread.java:834)
  112. Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  113.     at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
  114.     at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:369)
  115.     at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:312)
  116.     at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
  117.     at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654)
  118.     at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)
  119.     at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)
  120.     at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)
  121.     at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:478)
  122.     at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:456)
  123.     at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:199)
  124.     at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
  125.     at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1383)
  126.     at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1296)
  127.     at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:416)
  128.     at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:388)
  129.     at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1795)
  130.     ... 107 common frames omitted
  131. Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  132.     at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)
  133.     at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)
  134.     at java.base/sun.security.validator.Validator.validate(Validator.java:264)
  135.     at java.base/sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313)
  136.     at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:233)
  137.     at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:110)
  138.     at com.microsoft.sqlserver.jdbc.HostNameOverrideX509TrustManager.checkServerTrusted(SQLServerTrustManager.java:86)
  139.     at java.base/sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:1510)
  140.     at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638)
  141.     ... 119 common frames omitted
  142. Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  143.     at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
  144.     at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
  145.     at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
  146.     at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
  147.     ... 127 common frames omitted
复制代码
从报错信息
org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor:[124] - Check datasource connectivity for: SQLSERVER error
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "KIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:e52d9754-ddfc-4f5f-94ec-1122dc48262b
中可以得到
检查数据源连接是否存在:SQLSERVER错误
com.microsoft.sqlserver.jdbc.SQLServerException:驱动程序无法使用安全套接字层(SSL)加密建立与SQL Server的安全连接。错误:“PKIX路径生成失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到到请求目标的有效证书路径”。客户端连接ID:e52d9754-ddfc-4f5f-94ec-1122dc48262b
解决方案:
url后面加上encrypt=false
参考文章:连接Sql Server时报错:无法通过使用安全套接字层加密与 SQL Server 建立安全连接_“encrypt”属性设置为“true”且 “trustservercertificate”属性设置-CSDN博客

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

郭卫东

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表