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

Can't start devservices (data index port conflicts) #1301

Open
juangon opened this issue Jun 21, 2022 · 10 comments
Open

Can't start devservices (data index port conflicts) #1301

juangon opened this issue Jun 21, 2022 · 10 comments
Assignees

Comments

@juangon
Copy link

juangon commented Jun 21, 2022

Describe the bug

I am trying to execute dev services withing process-usertasks-with-security-oidc-quarkus-with-console kogito demo, but it throws an error about same port conflicting for data index. Notice that these demos require startServices.sh script to work, so Data Index already exists and is running.

After reading documentation, I realized data index container name was different in docker-compose comparing to default value (data-index vs kogito-data-index), so I tried setting:

quarkus.kogito.devservices.service-name=data-index

but didn't work.

How can I execute dev services in these demos?

Thanks.

Expected behavior

Dev services are started without any error

Actual behavior

Port conflict error:

2022-06-21 14:39:10,045 ERROR [🐳 .io/kiegroup/kogito-data-index-ephemeral:latest]] (build-65) Could not start container: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"driver failed programming external connectivity on endpoint silly_elgamal (b79cdb4fd0a5fcfda4fb671c045eb7fae404342c3e98c7bc31ceef31738d9e9c): Bind for 0.0.0.0:8180 failed: port is already allocated"}

	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:247)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:102)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.StartContainerCmdExec.execute(StartContainerCmdExec.java:31)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.StartContainerCmdExec.execute(StartContainerCmdExec.java:13)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.StartContainerCmdImpl.exec(StartContainerCmdImpl.java:43)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:437)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:340)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:338)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:326)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.lambda$startDataIndex$1(KogitoDevServicesProcessor.java:181)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndex(KogitoDevServicesProcessor.java:190)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndexDevService(KogitoDevServicesProcessor.java:107)
	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.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2022-06-21 14:39:10,050 ERROR [🐳 .io/kiegroup/kogito-data-index-ephemeral:latest]] (build-65) There are no stdout/stderr logs available for the failed container
2022-06-21 14:39:10,059 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2022-06-21 14:39:10,149 INFO  [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
2022-06-21 14:39:10,230 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor#startDataIndexDevService threw an exception: java.lang.RuntimeException: Failed to start Kogito Data Index Dev Services
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndexDevService(KogitoDevServicesProcessor.java:117)
	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.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.lambda$startDataIndex$1(KogitoDevServicesProcessor.java:185)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndex(KogitoDevServicesProcessor.java:190)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndexDevService(KogitoDevServicesProcessor.java:107)
	... 11 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:345)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:326)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.lambda$startDataIndex$1(KogitoDevServicesProcessor.java:181)
	... 14 more
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:338)
	... 16 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:537)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:340)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 17 more
Caused by: com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"driver failed programming external connectivity on endpoint silly_elgamal (b79cdb4fd0a5fcfda4fb671c045eb7fae404342c3e98c7bc31ceef31738d9e9c): Bind for 0.0.0.0:8180 failed: port is already allocated"}

	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:247)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:102)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.StartContainerCmdExec.execute(StartContainerCmdExec.java:31)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.StartContainerCmdExec.execute(StartContainerCmdExec.java:13)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.StartContainerCmdImpl.exec(StartContainerCmdImpl.java:43)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:437)
	... 19 more

	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:252)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:95)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:485)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:68)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:142)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:97)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:132)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor#startDataIndexDevService threw an exception: java.lang.RuntimeException: Failed to start Kogito Data Index Dev Services
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndexDevService(KogitoDevServicesProcessor.java:117)
	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.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.lambda$startDataIndex$1(KogitoDevServicesProcessor.java:185)
	at java.base/java.util.Optional.orElseGet(Optional.java:369)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndex(KogitoDevServicesProcessor.java:190)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.startDataIndexDevService(KogitoDevServicesProcessor.java:107)
	... 11 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:345)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:326)
	at org.kie.kogito.quarkus.processes.deployment.KogitoDevServicesProcessor.lambda$startDataIndex$1(KogitoDevServicesProcessor.java:181)
	... 14 more
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:338)
	... 16 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStartcContainer.java:537)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:340)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 17 more


How to Reproduce?

Steps to reproduce:
1-Follow instructions on README
2-When starting Quarkus service, do it by mvn clean quarkus:dev
3-See error thrown

Output of uname -a or ver

Linux Ubuntu

Output of java -version

11

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

stable

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

No response

Additional information

No response

@cristianonicolai
Copy link
Contributor

@juangon if you would like to start the devmode in combination with the external docker-compose, you should disable devservices, not only the data index but probably any other that Quarkus would start automatically.

You can either disable only data index by setting quarkus.kogito.devservices.enabled=false to your application.properties or disable Quarkus devservices completely by adding quarkus.devservices.enabled=false.

More information about Dev Services is available at https://quarkus.io/guides/dev-services and https://quarkus.io/guides/kogito-dev-services#enabling-disabling-dev-services-for-kogito

@cristianonicolai cristianonicolai self-assigned this Jun 21, 2022
@juangon
Copy link
Author

juangon commented Jun 21, 2022

Thanks @cristianonicolai but doing that disables /q/dev, which is the thing I want to play with.

So, that doesn't work. Any other alternative?

@cristianonicolai
Copy link
Contributor

Strange, that should only disable dev services, not the dev ui afaik. Unless you mean you want to access Data Index via /q/dev?

@juangon
Copy link
Author

juangon commented Jun 21, 2022

No no, I just want to access Kogito Forms to play with them in Dev UI

@juangon
Copy link
Author

juangon commented Jun 21, 2022

Oh wait @cristianonicolai , it seems is due to the authentication in root path in these demos....

quarkus.http.auth.permission.authenticated.paths=/*
quarkus.http.auth.permission.authenticated.policy=authenticated

Let me check

@juangon
Copy link
Author

juangon commented Jun 21, 2022

Ok @cristianonicolai I don't have any runtime kogito tools in dev UI even when adding:

<dependency>
    <groupId>org.kie.kogito</groupId>
    <artifactId>runtime-tools-quarkus-extension</artifactId>
</dependency>

And no Kogito runtime tools dev/UI:
kogito_dev_ui

@cristianonicolai
Copy link
Contributor

@pefernan @paulovmr any ideas?

@pefernan
Copy link
Contributor

@juangon hi!

just a question, are you starting the docker-compose in your project? maybe the data-index started there is clashing with the data-index started by kogito in dev mode. If you want to use the dev-ui you may not need the docker-compose started (unless you need the oidc).

Regarding the extension issue here, looks like it's not able to locate the process related features in your project... do you have the process-management addon dep?

<dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-addons-quarkus-process-management</artifactId>
 </dependency>

@juangon
Copy link
Author

juangon commented Jun 21, 2022

Hi @pefernan, yes I am testing oidc too so it seems I need docker compose.

And yes, I have that dependency

@wmmnpr
Copy link

wmmnpr commented Nov 18, 2022

I am experiencing the same issue with the kogitio-examples stable branch. Was @juangon ever able to resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants