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

On Gradle 6 and Corretto 11, container was successfully started but got a stack trace #207

Closed
rvbabilonia opened this issue Nov 18, 2019 · 4 comments

Comments

@rvbabilonia
Copy link

2:35:45 PM: Executing tasks 'clean spotlessApply composeUp'...

Starting Gradle Daemon...Connected to the target VM, address: '127.0.0.1:64145', transport: 'socket'
Gradle Daemon started in 2 s 293 ms

> Configure project :
Running Java version: Amazon.com Inc. OpenJDK 64-Bit Server VM 11.0.4
Running Gradle version: 6.0

> Task :clean
> Task :spotlessJava UP-TO-DATE
> Task :spotlessJavaApply UP-TO-DATE
> Task :spotlessApply UP-TO-DATE
> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :jar
> Task :assemble
> Task :compileComponentTestJava
> Task :processComponentTestResources NO-SOURCE
> Task :componentTestClasses
> Task :checkstyleComponentTest
> Task :compileContractTestJava
> Task :processContractTestResources NO-SOURCE
> Task :contractTestClasses
> Task :checkstyleContractTest
> Task :compileEndToEndTestJava
> Task :processEndToEndTestResources NO-SOURCE
> Task :endToEndTestClasses
> Task :checkstyleEndToEndTest
> Task :compileGeneratePactJava
> Task :processGeneratePactResources NO-SOURCE
> Task :generatePactClasses
> Task :checkstyleGeneratePact
> Task :compileIntegrationTestJava NO-SOURCE
> Task :processIntegrationTestResources NO-SOURCE
> Task :integrationTestClasses UP-TO-DATE
> Task :checkstyleIntegrationTest NO-SOURCE
> Task :checkstyleMain
> Task :compileSmokeTestJava
> Task :processSmokeTestResources NO-SOURCE
> Task :smokeTestClasses
> Task :checkstyleSmokeTest
> Task :compileTestJava
> Task :processTestResources
> Task :testClasses
> Task :checkstyleTest
> Task :spotlessJavaCheck UP-TO-DATE
> Task :spotlessCheck UP-TO-DATE
Connected to the VM started by ':test' (localhost:64261). Open the debugger session tab
> Task :test
> Task :check
> Task :copyDkr
> Task :copyYml
> Task :shadowJar
> Task :build

> Task :composeUp
Building MockService
Building ExampleProjectService
Creating network "bc2bfdb6d79a593530d2950609a12d2c_example-project__default" with the default driver




Will use localhost as host of MockService
Will use localhost as host of ExampleProjectService
Probing TCP socket on localhost:7070 of service 'MockService'
TCP socket on localhost:7070 of service 'MockService' is ready
Probing TCP socket on localhost:8080 of service 'ExampleProject'
Attaching to ExampleProject, MockService
MockService              | SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
MockService              | SLF4J: Defaulting to no-operation (NOP) logger implementation
MockService              | SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
MockService              |  /$$      /$$ /$$                     /$$      /$$                     /$$      
MockService              | | $$  /$ | $$|__/                    | $$$    /$$$                    | $$      
MockService              | | $$ /$$$| $$ /$$  /$$$$$$   /$$$$$$ | $$$$  /$$$$  /$$$$$$   /$$$$$$$| $$   /$$
MockService              | | $$/$$ $$ $$| $$ /$$__  $$ /$$__  $$| $$ $$/$$ $$ /$$__  $$ /$$_____/| $$  /$$/
MockService              | | $$$$_  $$$$| $$| $$  \__/| $$$$$$$$| $$  $$$| $$| $$  \ $$| $$      | $$$$$$/ 
MockService              | | $$$/ \  $$$| $$| $$      | $$_____/| $$\  $ | $$| $$  | $$| $$      | $$_  $$ 
MockService              | | $$/   \  $$| $$| $$      |  $$$$$$$| $$ \/  | $$|  $$$$$$/|  $$$$$$$| $$ \  $$
MockService              | |__/     \__/|__/|__/       \_______/|__/     |__/ \______/  \_______/|__/  \__/
MockService              | 
MockService              | port:                         8080
MockService              | enable-browser-proxying:      false
MockService              | disable-banner:               false
MockService              | no-request-journal:           false
MockService              | verbose:                      false
MockService              | 
ExampleProject           | Picked up JAVA_TOOL_OPTIONS:  -XX:MaxRAMPercentage=75 -Djava.awt.headless=true
ExampleProject           | WARNING: An illegal reflective access operation has occurred
ExampleProject           | WARNING: Illegal reflective access by com.fasterxml.jackson.module.afterburner.util.MyClassLoader (file:/app/app.jar) to method java.lang.ClassLoader.findLoadedClass(java.lang.String)
ExampleProject           | WARNING: Please consider reporting this to the maintainers of com.fasterxml.jackson.module.afterburner.util.MyClassLoader
ExampleProject           | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
ExampleProject           | WARNING: All illegal access operations will be denied in a future release
ExampleProject           | 2019-11-18 01:37:25,568 2956 INFO [main] [] [] i.d.s.DefaultServerFactory - Registering jersey handler with root path prefix: /
ExampleProject           | 2019-11-18 01:37:25,571 2959 INFO [main] [] [] i.d.s.DefaultServerFactory - Registering admin handler with root path prefix: /
ExampleProject           | 2019-11-18 01:37:25,640 3028 INFO [main] [] [] i.d.a.AssetsBundle - Registering AssetBundle with name: swagger-assets for path /api/swagger-static/*
ExampleProject           | 2019-11-18 01:37:25,688 3076 INFO [main] [] [] i.d.a.AssetsBundle - Registering AssetBundle with name: swagger-oauth2-connect for path /api/oauth2-redirect.html/*
ExampleProject           | 2019-11-18 01:37:25,904 3292 INFO [main] [] [] o.r.Reflections - Reflections took 158 ms to scan 1 urls, producing 6 keys and 6 values 
ExampleProject           | 2019-11-18 01:37:26,149 3537 WARN [main] [] [] i.s.j.Reader - Unknown implicit parameter type: []
ExampleProject           | 2019-11-18 01:37:26,177 3565 INFO [main] [] [] i.d.s.ServerFactory - Starting ExampleProject
ExampleProject           | 2019-11-18 01:37:26,415 3803 INFO [main] [] [] o.e.j.s.SetUIDListener - Opened application@5d850a25{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
ExampleProject           | 2019-11-18 01:37:26,415 3803 INFO [main] [] [] o.e.j.s.SetUIDListener - Opened admin@b022551{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
ExampleProject           | 2019-11-18 01:37:26,417 3805 INFO [main] [] [] o.e.j.s.Server - jetty-9.4.z-SNAPSHOT; built: 2019-04-29T20:42:08.989Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 11.0.5+10-LTS
ExampleProject           | 2019-11-18 01:37:26,456 3844 INFO [main] [] [] n.c.a.d.a.m.j.JmxMpServer - Starting JMXMP server on service:jmx:jmxmp://localhost:9875
ExampleProject           | 2019-11-18 01:37:27,581 4969 INFO [main] [] [] i.d.j.DropwizardResourceConfig - The following paths were found for the configured resources:
ExampleProject           | 
ExampleProject           |     GET     /api/swagger (io.federecio.dropwizard.swagger.SwaggerResource)
ExampleProject           |     GET     /api/swagger.{type:json|yaml} (io.swagger.jaxrs.listing.ApiListingResource)
ExampleProject           |     GET     /api/v1/example/project (com.acme.example.project.v1.api.resource.ExampleProjectResource)
ExampleProject           | 
ExampleProject           | 2019-11-18 01:37:27,582 4970 INFO [main] [] [] o.e.j.s.h.ContextHandler - Started i.d.j.MutableServletContextHandler@6a278584{/,null,AVAILABLE}
ExampleProject           | 2019-11-18 01:37:27,593 4981 INFO [main] [] [] i.d.s.AdminEnvironment - tasks = 
ExampleProject           | 
ExampleProject           |     POST    /tasks/log-level (io.dropwizard.servlets.tasks.LogConfigurationTask)
ExampleProject           |     POST    /tasks/gc (io.dropwizard.servlets.tasks.GarbageCollectionTask)
ExampleProject           | 
ExampleProject           | 2019-11-18 01:37:27,603 4991 INFO [main] [] [] o.e.j.s.h.ContextHandler - Started i.d.j.MutableServletContextHandler@2dd8a273{/,null,AVAILABLE}
ExampleProject           | 2019-11-18 01:37:27,624 5012 INFO [main] [] [] o.e.j.s.AbstractConnector - Started application@5d850a25{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
ExampleProject           | 2019-11-18 01:37:27,626 5014 INFO [main] [] [] o.e.j.s.AbstractConnector - Started admin@b022551{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
ExampleProject           | 2019-11-18 01:37:27,626 5014 INFO [main] [] [] o.e.j.s.Server - Started @5408ms
ExampleProject           | 2019-11-18 01:37:27,630 5018 INFO [main] [] [] n.c.a.e.p.ExampleProjectApplication - Application is up and running.
TCP socket on localhost:8080 of service 'ExampleProject' is ready
Probing TCP socket on localhost:8081 of service 'ExampleProject'
TCP socket on localhost:8081 of service 'ExampleProject' is ready
Probing TCP socket on localhost:9875 of service 'ExampleProject'
TCP socket on localhost:9875 of service 'ExampleProject' is ready

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0/userguide/command_line_interface.html#sec:command_line_warnings

Exception in thread "pool-1-thread-1" org.gradle.internal.UncheckedException: java.lang.InterruptedException
BUILD SUCCESSFUL in 1m 46s
	at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:67)
	at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
	at org.gradle.process.internal.DefaultExecHandle.waitForFinish(DefaultExecHandle.java:320)
	at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:36)
	at org.gradle.process.internal.DefaultExecActionFactory.exec(DefaultExecActionFactory.java:152)
	at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1135)
	at org.gradle.api.internal.project.DefaultProject.exec(DefaultProject.java:1130)
	at org.gradle.api.Project$exec$2.call(Unknown Source)
	at com.avast.gradle.dockercompose.ComposeExecutor.executeWithCustomOutput(ComposeExecutor.groovy:32)
23 actionable tasks: 22 executed, 1 up-to-date
	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 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:94)
	at com.avast.gradle.dockercompose.ComposeExecutor.this$dist$invoke$1(ComposeExecutor.groovy)
	at com.avast.gradle.dockercompose.ComposeExecutor$1.methodMissing(ComposeExecutor.groovy)
	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 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
	at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:958)
	at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1286)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1219)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:64)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:156)
	at com.avast.gradle.dockercompose.ComposeExecutor$1.run(ComposeExecutor.groovy:110)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.InterruptedException
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2090)
	at org.gradle.process.internal.DefaultExecHandle.waitForFinish(DefaultExecHandle.java:317)
	... 29 more
2:37:32 PM: Tasks execution finished 'clean spotlessApply composeUp'.
Disconnected from the target VM, address: '127.0.0.1:64145', transport: 'socket'

ComposeUp was instantiated as such:

    ComposeUp composeUp = project.tasks['composeUp'] as ComposeUp
    composeUp.dependsOn "build"

Started containers:

CONTAINER ID        IMAGE                          COMMAND                  CREATED              STATUS              PORTS                                                      NAMES
be221e33ccca        example-project:DEV-SNAPSHOT   "/usr/bin/entrypoint…"   About a minute ago   Up About a minute   0.0.0.0:8080-8081->8080-8081/tcp, 0.0.0.0:9875->9875/tcp   ExampleProject
1aab1737d4a5        mock:DEV-SNAPSHOT              "/docker-entrypoint.…"   About a minute ago   Up About a minute   8081/tcp, 8443/tcp, 0.0.0.0:7070->8080/tcp                 MockService
@augi
Copy link
Member

augi commented Nov 18, 2019

Hello, thank you for reporting this issue! Could you please try to run the project in Gradle 5.6.2? And which version of our plugin are you using, please? Thanks!

@rvbabilonia
Copy link
Author

hi michal. this works up until gradle 5.6.4. i just tried 0.10.2 on gradle 6 but still got the stack trace.

@augi augi closed this as completed in fe419ab Nov 19, 2019
@augi
Copy link
Member

augi commented Nov 19, 2019

Thank you! I'm not able to reproduce this issue but the exception is clear - Groovy is not able to locate private executeWithCustomOutput method. So I tried to make the method public, and this will hopefully fix your issue.

@Alechan
Copy link

Alechan commented Feb 22, 2020

In my case, if I run composeUp isolated (no task that depends on it, no composeDown after it, etc) then it breaks because the -f flag in the docker-compose command makes it wait until the containers are finished. But if I ran the task that depends on composeUp then there's no error. For example,

./gradlew integrationTest  # executes "composeUp" without issue
./gradlew composeUp        # hangs and has to be manually terminated

To be able to have logs but to also have the posibility of running a standalone composeUp I created the following task

task composeUpStandalone {
    composeUp.getSettings().setCaptureContainersOutputToFiles((File) null)
    delegate.finalizedBy(composeUp)
}

It disables the logging and then runs the task. Then, when I want to get the containers running instead of calling composeUp (that breaks) I call

./gradlew composeUpStandalone

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

No branches or pull requests

3 participants