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

Dev Services : MSSQL Connection Error 2.8.1.Final or 2.8.2.Final #25233

Closed
sxs737 opened this issue Apr 28, 2022 · 5 comments · Fixed by #25487
Closed

Dev Services : MSSQL Connection Error 2.8.1.Final or 2.8.2.Final #25233

sxs737 opened this issue Apr 28, 2022 · 5 comments · Fixed by #25487
Assignees
Labels
area/devservices kind/bug Something isn't working
Milestone

Comments

@sxs737
Copy link

sxs737 commented Apr 28, 2022

Describe the bug

Dev Service MSSQL Database connection Error invalid connection URI

Caused by: java.lang.IllegalArgumentException: Cannot parse invalid connection URI: sqlserver://localhost:49233;encrypt=false at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.parse(MSSQLConnectionUriParser.java:64) at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.parse(MSSQLConnectionUriParser.java:50) at io.vertx.mssqlclient.MSSQLConnectOptions.fromUri(MSSQLConnectOptions.java:53) at io.quarkus.reactive.mssql.client.runtime.MSSQLPoolRecorder.toMSSQLConnectOptions(MSSQLPoolRecorder.java:106) at io.quarkus.reactive.mssql.client.runtime.MSSQLPoolRecorder.initialize(MSSQLPoolRecorder.java:62) at io.quarkus.reactive.mssql.client.runtime.MSSQLPoolRecorder.configureMSSQLPool(MSSQLPoolRecorder.java:44) at io.quarkus.deployment.steps.ReactiveMSSQLClientProcessor$build1261564383.deploy_0(Unknown Source) at io.quarkus.deployment.steps.ReactiveMSSQLClientProcessor$build1261564383.deploy(Unknown Source) ... 52 more Caused by: java.lang.IllegalArgumentException: Wrong syntax of connection URI at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.doParse(MSSQLConnectionUriParser.java:89) at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.parse(MSSQLConnectionUriParser.java:58) ... 59 more

Expected behavior

Dev Service Should start MSSQL Database using Docker and Quarkus Should service should start

Actual behavior

Docker MSSQL Database is started fine but gives error while connecting

2022-04-28 10:53:20,785 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, hibernate-orm, hibernate-reactive, hibernate-reactive-panache, hibernate-validator, oidc, reactive-mssql-client, reactive-routes, resteasy-reactive, resteasy-reactive-jackson, security, smallrye-context-propagation, smallrye-metrics, smallrye-openapi, swagger-ui, vertx]

It works fine till Quarkus 2.8.0.Final but breaks when upgrading to 2.8.1.Final or 2.8.2.Final

`2022-04-28 08:35:10,693 INFO [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
2022-04-28 08:35:11,625 INFO [org.tes.doc.DockerClientProviderStrategy] (build-87) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2022-04-28 08:35:11,969 DEBUG [io.qua.oid.dep.dev.key.KeycloakDevServicesProcessor] (build-86) Not starting Dev Services for Keycloak as 'quarkus.oidc.auth-server-url' has been provided
2022-04-28 08:35:13,977 INFO [org.tes.doc.DockerClientProviderStrategy] (build-87) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2022-04-28 08:35:13,981 INFO [org.tes.DockerClientFactory] (build-87) Docker host IP address is localhost
2022-04-28 08:35:14,056 INFO [org.tes.DockerClientFactory] (build-87) Connected to docker:
Server Version: 20.10.14+azure-1
API Version: 1.41
Operating System: Ubuntu 20.04.4 LTS
Total Memory: 16005 MB
2022-04-28 08:35:14,092 INFO [org.tes.uti.ImageNameSubstitutor] (build-87) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2022-04-28 08:35:14,186 INFO [🐳 .3.3]] (build-87) Pulling docker image: testcontainers/ryuk:0.3.3. Please be patient; this may take some time but only needs to be done once.
2022-04-28 08:35:15,936 INFO [🐳 .3.3]] (docker-java-stream--275351374) Starting to pull image
2022-04-28 08:35:15,979 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 0 pending, 0 downloaded, 0 extracted, (0 bytes/0 bytes)
2022-04-28 08:35:16,921 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 2 pending, 1 downloaded, 0 extracted, (285 KB/? MB)
2022-04-28 08:35:17,064 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 1 pending, 2 downloaded, 0 extracted, (1 MB/? MB)
2022-04-28 08:35:17,106 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 0 pending, 3 downloaded, 0 extracted, (1 MB/5 MB)
2022-04-28 08:35:17,270 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 0 pending, 3 downloaded, 1 extracted, (3 MB/5 MB)
2022-04-28 08:35:17,759 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 0 pending, 3 downloaded, 2 extracted, (3 MB/5 MB)
2022-04-28 08:35:18,138 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pulling image layers: 0 pending, 3 downloaded, 3 extracted, (5 MB/5 MB)
2022-04-28 08:35:18,232 INFO [🐳 .3.3]] (docker-java-stream--275351374) Pull complete. 3 layers, pulled in 2s (downloaded 5 MB at 2 MB/s)
2022-04-28 08:35:19,196 INFO [org.tes.uti.RyukResourceReaper] (build-87) Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
2022-04-28 08:35:19,196 INFO [org.tes.DockerClientFactory] (build-87) Checking the system...
2022-04-28 08:35:19,198 INFO [org.tes.DockerClientFactory] (build-87) ✔︎ Docker server version should be at least 1.6.0
2022-04-28 08:35:19,308 INFO [org.tes.DockerClientFactory] (build-87) ✔︎ Docker environment should have more than 2GB free disk space
2022-04-28 08:35:19,341 INFO [🐳 .mic.com.04]] (build-87) Pulling docker image: mcr.microsoft.com/mssql/server:2019-CU15-ubuntu-20.04. Please be patient; this may take some time but only needs to be done once.
2022-04-28 08:35:20,341 INFO [🐳 .mic.com.04]] (docker-java-stream-1674420968) Starting to pull image
2022-04-28 08:36:05,880 INFO [🐳 .mic.com.04]] (docker-java-stream-1674420968) Pull complete. 5 layers, pulled in 45s (downloaded 471 MB at 10 MB/s)
2022-04-28 08:36:05,903 INFO [🐳 .mic.com.04]] (build-87) Creating container for image: mcr.microsoft.com/mssql/server:2019-CU15-ubuntu-20.04
2022-04-28 08:36:06,091 INFO [🐳 .mic.com.04]] (build-87) Container mcr.microsoft.com/mssql/server:2019-CU15-ubuntu-20.04 is starting: bc2fe2022a454d27f756c4aecad7d3a680b77e7ae1e06e500ea9a8527a4bbc72
2022-04-28 08:36:06,600 INFO [🐳 .mic.com.04]] (build-87) Waiting for database connection to become available at jdbc:sqlserver://localhost:49200 using query 'SELECT 1'
022-04-28 08:36:13,613 INFO [🐳 .mic.com.04]] (build-87) Container is started (JDBC URL: jdbc:sqlserver://localhost:49200;encrypt=false)
2022-04-28 08:36:13,619 INFO [🐳 .mic.com.04]] (build-87) Container mcr.microsoft.com/mssql/server:2019-CU15-ubuntu-20.04 started in PT7.716507S
2022-04-28 08:36:13,619 INFO [io.qua.dev.mss.dep.MSSQLDevServicesProcessor] (build-87) Dev Services for Microsoft SQL Server started.
2022-04-28 08:36:13,622 INFO [io.qua.dat.dep.dev.DevServicesDatasourceProcessor] (build-87) Dev Services for the default datasource (mssql) started.

java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:632)
at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:703)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.api.extension.InvocationInterceptor.interceptTestClassConstructor(InvocationInterceptor.java:73)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:77)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestClassConstructor(ClassBasedTestDescriptor.java:355)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:302)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:79)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:280)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:272)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:271)
at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:102)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:101)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:55)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:223)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:175)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:139)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
Caused by: java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
at io.quarkus.runtime.Application.start(Application.java:101)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:237)
at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:250)
at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:609)
at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:647)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$10(ClassBasedTestDescriptor.java:381)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:381)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:205)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:80)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
... 36 more
Caused by: java.lang.IllegalArgumentException: Cannot parse invalid connection URI: sqlserver://localhost:49200;encrypt=false
at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.parse(MSSQLConnectionUriParser.java:64)
at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.parse(MSSQLConnectionUriParser.java:50)
at io.vertx.mssqlclient.MSSQLConnectOptions.fromUri(MSSQLConnectOptions.java:53)
at io.quarkus.reactive.mssql.client.runtime.MSSQLPoolRecorder.toMSSQLConnectOptions(MSSQLPoolRecorder.java:106)
at io.quarkus.reactive.mssql.client.runtime.MSSQLPoolRecorder.initialize(MSSQLPoolRecorder.java:62)
at io.quarkus.reactive.mssql.client.runtime.MSSQLPoolRecorder.configureMSSQLPool(MSSQLPoolRecorder.java:44)
at io.quarkus.deployment.steps.ReactiveMSSQLClientProcessor$build1261564383.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.ReactiveMSSQLClientProcessor$build1261564383.deploy(Unknown Source)
... 52 more
Caused by: java.lang.IllegalArgumentException: Wrong syntax of connection URI
at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.doParse(MSSQLConnectionUriParser.java:89)
at io.vertx.mssqlclient.impl.MSSQLConnectionUriParser.parse(MSSQLConnectionUriParser.java:58)
... 59 more
`

How to Reproduce?

Try Starting Quarkus in Dev Mode with quarkus-reactive-mssql-client and quarkus-hibernate-reactive-panache and It will give above error

Output of uname -a or ver

No response

Output of java -version

Java version: 11.0.14.1, vendor: Eclipse Adoptium,

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.8.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.1

Additional information

No response

@sxs737 sxs737 added the kind/bug Something isn't working label Apr 28, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 28, 2022

/cc @stuartwdouglas

@sxs737
Copy link
Author

sxs737 commented Apr 30, 2022

I think the Parser is giving error because of ;encrypt=false in the URL

@ondrejKR
Copy link

ondrejKR commented May 3, 2022

same problem

@gsmet
Copy link
Member

gsmet commented May 3, 2022

@tsegismont could you have a look?

@tsegismont
Copy link
Contributor

Yes, the issue is the Vert.x MSSQL Client URI parser does not support the ;encrypt=false property.

@tsegismont tsegismont self-assigned this May 3, 2022
tsegismont added a commit to tsegismont/quarkus that referenced this issue May 10, 2022
@quarkus-bot quarkus-bot bot added this to the 2.10 - main milestone May 24, 2022
@gsmet gsmet modified the milestones: 2.10 - main, 2.9.2.Final May 24, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue May 24, 2022
Fixes quarkusio#25233

The "encrypt" property is not needed anyway, it is the default of both the JDBC and reactive clients.

https://docs.microsoft.com/en-us/sql/connect/jdbc/understanding-ssl-support?view=sql-server-ver15#remarks
(cherry picked from commit c4a4640)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devservices kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants