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

com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Connection reset #2335

Closed
devslam opened this issue Mar 17, 2020 · 16 comments

Comments

@devslam
Copy link

devslam commented Mar 17, 2020

Environment:

  • Jib version: 2.0.0
  • Build tool: Gradle
  • OS: macOS Mojave

Description of the issue:
I'm unable build my container with the ibmjava:8-jre base image. When I run the jibDockerBuild command, I get the following exception:
com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Connection reset

Expected behavior:
To be able to build my containers using the IBM Java 8 base image that is available on docker hub, which is located here: https://hub.docker.com/_/ibmjava?tab=description

Steps to reproduce:

  1. Run the jibDockerBuild command with the following gradle configuration

jib-gradle-plugin Configuration:

jib {
    from {

        image = "ibmjava:8-jre"
        auth {
            username = "<dockerhub username>"
            password = "<dockerhub password"
        }
    }
    to {
        image = "imagetest"
        auth {
            username = "<my registry username>"
            password = "<my registry password>"
        }
        tags = ["1.0.0"]
    }
    container {
        creationTime = 'USE_CURRENT_TIMESTAMP'
    }
}

Log output:

gradle jibDockerBuild --stacktrace

Task :helloworld:jibDockerBuild FAILED
Setting image creation time to current time; your image may not be reproducible.

Containerizing application to Docker daemon as imagetest:1.0.0
Base image 'ibmjava:8-jre' does not use a specific image digest - build may not be reproducible
I/O error for image [registry-1.docker.io/library/ibmjava]:
java.net.SocketException
Connection reset
Executing tasks:
[============ ] 40.0% complete

building image to Docker daemon

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':hello-world:jibDockerBuild'.

com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Connection reset

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':controller:operator:jibDockerBuild'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
    at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
    at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    Caused by: org.gradle.internal.UncheckedException: com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Connection reset
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:67)
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:106)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:717)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:684)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:476)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:461)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:444)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:93)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:237)
    at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
    at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
    at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
    at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
    at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
    at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
    at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
    at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:208)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
    at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
    at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
    at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:69)
    at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
    at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:140)
    ... 34 more
    Caused by: com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Connection reset
    at com.google.cloud.tools.jib.plugins.common.JibBuildRunner.runBuild(JibBuildRunner.java:283)
    at com.google.cloud.tools.jib.gradle.BuildDockerTask.buildDocker(BuildDockerTask.java:105)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
    ... 87 more
    Caused by: java.net.SocketException: Connection reset
    at com.ibm.jsse2.a.a(a.java:227)
    at com.ibm.jsse2.a.a(a.java:168)
    at com.ibm.jsse2.as.a(as.java:702)
    at com.ibm.jsse2.as.i(as.java:338)
    at com.ibm.jsse2.as.a(as.java:711)
    at com.ibm.jsse2.as.startHandshake(as.java:454)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at com.google.api.client.http.apache.v2.ApacheHttpRequest.execute(ApacheHttpRequest.java:73)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
    at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:310)
    at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:237)
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:139)
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:115)
    at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:584)
    at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest(RegistryClient.java:400)
    at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest(RegistryClient.java:404)
    at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.pullBaseImage(PullBaseImageStep.java:194)
    at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call(PullBaseImageStep.java:126)
    at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call(PullBaseImageStep.java:56)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)

@chanseokoh
Copy link
Member

Hi @devslam,

I suspect a proxy or firewall issue. Can you follow these instructions to capture network calls? You should see logs like

Mar 17, 2020 9:50:09 AM com.google.api.client.http.HttpRequest execute
CONFIG: -------------- REQUEST  --------------
GET https://registry-1.docker.io/v2/library/ibmjava/manifests/8-jre
Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json
Accept-Encoding: gzip
User-Agent: jib 2.1.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)

Mar 17, 2020 9:50:09 AM com.google.api.client.http.HttpRequest execute
CONFIG: curl -v --compressed -H 'Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json' -H 'Accept-Encoding: gzip' -H 'User-Agent: jib 2.1.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)' -- 'https://registry-1.docker.io/v2/library/ibmjava/manifests/8-jre'
Mar 17, 2020 9:50:10 AM com.google.api.client.http.HttpResponse <init>
CONFIG: -------------- RESPONSE --------------
HTTP/1.1 401 Unauthorized
Content-Type: application/json
Docker-Distribution-Api-Version: registry/2.0
Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository:library/ibmjava:pull"
Date: Tue, 17 Mar 2020 13:50:10 GMT
Content-Length: 158
Strict-Transport-Security: max-age=31536000

Also, for diagnosis, I would try different things:

  • Try this on a different environment/network if you can.
  • Use a different base image (openjdk:8-jre-slim, gcr.io/distroless/java:8, etc).

@devslam
Copy link
Author

devslam commented Mar 17, 2020

Hi @devslam,

I suspect a proxy or firewall issue. Can you follow these instructions to capture network calls? You should see logs like

Mar 17, 2020 9:50:09 AM com.google.api.client.http.HttpRequest execute
CONFIG: -------------- REQUEST  --------------
GET https://registry-1.docker.io/v2/library/ibmjava/manifests/8-jre
Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json
Accept-Encoding: gzip
User-Agent: jib 2.1.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)

Mar 17, 2020 9:50:09 AM com.google.api.client.http.HttpRequest execute
CONFIG: curl -v --compressed -H 'Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json' -H 'Accept-Encoding: gzip' -H 'User-Agent: jib 2.1.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)' -- 'https://registry-1.docker.io/v2/library/ibmjava/manifests/8-jre'
Mar 17, 2020 9:50:10 AM com.google.api.client.http.HttpResponse <init>
CONFIG: -------------- RESPONSE --------------
HTTP/1.1 401 Unauthorized
Content-Type: application/json
Docker-Distribution-Api-Version: registry/2.0
Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository:library/ibmjava:pull"
Date: Tue, 17 Mar 2020 13:50:10 GMT
Content-Length: 158
Strict-Transport-Security: max-age=31536000

Also, for diagnosis, I would try different things:

  • Try this on a different environment/network if you can.
  • Use a different base image (openjdk:8-jre-slim, gcr.io/distroless/java:8, etc).

Thank you for your help.

I tried using a different base image and I'm getting the same error. I'll be able to try this on a different network in several hours

Are the logs supposed to be saved somewhere or printed out through the command line? I've followed those instructions to capture the network calls but don't see any log messages or files

@chanseokoh
Copy link
Member

chanseokoh commented Mar 17, 2020

Are the logs supposed to be saved somewhere or printed out through the command line? I've followed those instructions to capture the network calls but don't see any log messages or files

You should see the logs in the normal Gradle output on the command line. I forgot to say there are multiple reports that Gradle is unpredictable in generating the logs. See #1917 (comment). Try --no-daemon, but even with the flag, you may have to try multiple times. And make sure the path to logging.properties is correct and the file is readable.

And have you tried gcr.io/distroless/java:8 (this image is not on Docker Hub) too?

@devslam
Copy link
Author

devslam commented Mar 17, 2020

You should see the logs in the normal Gradle output on the command line. I forgot to say there are multiple reports that Gradle is unpredictable in generating the logs. See #1917 (comment). Try --no-deamon, but even with the flag, you may have to try multiple times. And make sure the path to logging.properties is correct and the file is readable.

And have you tried gcr.io/distroless/java:8 (this image is not on Docker Hub) too?

I see. Okay I'll give that a try.

Yes, I forgot to mention. I'm able to pull images from a private registry and I'm also able to pull the default image gcr.io/distroless/java:8 . It seems like I'm just having trouble pulling from Docker Hub

@chanseokoh
Copy link
Member

Correction: --no-daemon, not --no-deamon

Any update?

@devslam
Copy link
Author

devslam commented Mar 20, 2020

Correction: --no-daemon, not --no-deamon

Any update?

Thanks for following up. I'm not able to see network requests being made in the Gradle output on the command line. I'll spend some time today to see why I'm not able to capture the network calls

I found some possibly interesting bits from my console output

$ gradle --no-daemon -Djava.util.logging.config.file=/Users/dev/myproject/logging.properties -Djib.serialize=true -Djib.console=plain --debug jibDockerBuild

3:03:21.522 [DEBUG] [io.opencensus.trace.Tracing] Couldn't load full implementation for TraceComponent, now trying to load lite implementation.
java.lang.ClassNotFoundException: io.opencensus.impl.trace.TraceComponentImpl
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at io.opencensus.trace.Tracing.loadTraceComponent(Tracing.java:95)
        at io.opencensus.trace.Tracing.<clinit>(Tracing.java:37)
        at com.google.api.client.http.OpenCensusUtils.<clinit>(OpenCensusUtils.java:56)
        at com.google.api.client.http.HttpRequest.<init>(HttpRequest.java:203)
        at com.google.api.client.http.HttpTransport.buildRequest(HttpTransport.java:115)
        at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:86)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:301)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:237)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.get(FailoverHttpClient.java:187)
        at com.google.cloud.tools.jib.plugins.common.UpdateChecker.performUpdateCheck(UpdateChecker.java:156)
        at com.google.cloud.tools.jib.plugins.common.UpdateChecker.lambda$checkForUpdate$0(UpdateChecker.java:80)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
03:03:21.522 [DEBUG] [io.opencensus.trace.Tracing] Couldn't load lite implementation for TraceComponent, now using default implementation for TraceComponent.
java.lang.ClassNotFoundException: io.opencensus.impllite.trace.TraceComponentImplLite
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at io.opencensus.trace.Tracing.loadTraceComponent(Tracing.java:108)
        at io.opencensus.trace.Tracing.<clinit>(Tracing.java:37)
        at com.google.api.client.http.OpenCensusUtils.<clinit>(OpenCensusUtils.java:56)
        at com.google.api.client.http.HttpRequest.<init>(HttpRequest.java:203)
        at com.google.api.client.http.HttpTransport.buildRequest(HttpTransport.java:115)
        at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:86)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:301)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:237)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.get(FailoverHttpClient.java:187)
        at com.google.cloud.tools.jib.plugins.common.UpdateChecker.performUpdateCheck(UpdateChecker.java:156)
        at com.google.cloud.tools.jib.plugins.common.UpdateChecker.lambda$checkForUpdate$0(UpdateChecker.java:80)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
03:03:21.540 [DEBUG] [io.grpc.Context] Storage override doesn't exist. Using default
java.lang.ClassNotFoundException: io.grpc.override.ContextStorageOverride
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at io.grpc.Context$LazyStorage.createStorage(Context.java:144)
        at io.grpc.Context$LazyStorage.<clinit>(Context.java:133)
        at io.grpc.Context.storage(Context.java:121)
        at io.grpc.Context.current(Context.java:181)
        at io.opencensus.trace.CurrentSpanUtils.getCurrentSpan(CurrentSpanUtils.java:37)
        at io.opencensus.trace.Tracer.spanBuilder(Tracer.java:308)
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:865)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:310)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:237)
        at com.google.cloud.tools.jib.http.FailoverHttpClient.get(FailoverHttpClient.java:187)
        at com.google.cloud.tools.jib.plugins.common.UpdateChecker.performUpdateCheck(UpdateChecker.java:156)
        at com.google.cloud.tools.jib.plugins.common.UpdateChecker.lambda$checkForUpdate$0(UpdateChecker.java:80)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)






03:03:20.855 [LIFECYCLE] [org.gradle.api.Task] Getting manifest for base image ibmjava:8-jre...
03:03:20.855 [DEBUG] [org.gradle.api.Task] TIMING       Pulling base image manifest
03:03:20.913 [DEBUG] [org.gradle.api.Task] Failed to read lastUpdateCheck; Text '' could not be parsed at index 0
03:03:21.355 [DEBUG] [javax.security.sasl] IBMSASL Build-Level: -20150506
03:03:21.958 [ERROR] [org.gradle.api.Task] I/O error for image [registry-1.docker.io/library/ibmjava]:
03:03:21.958 [ERROR] [org.gradle.api.Task]     java.net.SocketException
03:03:21.958 [ERROR] [org.gradle.api.Task]     Connection reset
03:03:21.958 [DEBUG] [org.gradle.api.Task] TIMED        Pulling base image manifest : 1103.0 ms
03:03:21.963 [DEBUG] [org.gradle.api.Task] TIMING       Preparing application layer builders
03:03:21.964 [DEBUG] [org.gradle.api.Task] TIMED        Preparing application layer builders : 1.0 ms

@chanseokoh
Copy link
Member

I know the opencensus exceptions are harmless. I remember I got them too. But I am not sure if it is related to network logs not being generated by Google HTTP Client.

@chanseokoh
Copy link
Member

I too have the problem getting logs. I did know it was unpredicatable, but I remember at least I could get it after trying several times. But now, I cannot seem to make it work with a sample project. Since there was a report that Gradle 4.10.3 always worked, I think there's something about newer Gradle versions.

@chanseokoh
Copy link
Member

Oh, right after I left the command, I was able to obtain network logs. It was like after 15 build attempts.

@chanseokoh
Copy link
Member

@devslam I've identified why Gradle fails to output network logs (#2356). That will be fixed in the next release.

In the meantime, I've created a patched branch (always-output-gradle-http-logs) for testing. Building this patched Jib plugin and using it in your project is easy.

$ git clone https://github.com/GoogleContainerTools/jib.git
$ cd jib
$ git checkout always-output-gradle-http-logs # make sure you check out this branch
$ ./gradlew :jib-gradle-plugin:install

This will build 2.1.1-SNAPSHOT and install it into your local Maven repo (~/.m2/repository). Then configure your build script to use this SNAPSHOT as explained in #2270 (comment).

The patched plugin will not even require you set -Djava.util.logging.config.file. The following command will get you network logs.

$ ./gradlew --no-daemon --info --console=plain -Djib.serialize=true jibDockerBuild

Please let me know once you get the logs.

@chanseokoh
Copy link
Member

@devslam have you had a chance to try the patched branch to get network logs?

@devslam
Copy link
Author

devslam commented Apr 1, 2020

@devslam have you had a chance to try the patched branch to get network logs?

Sorry I did not have access to machine. I'll be able to try the patched branch to get the network logs today

@devslam
Copy link
Author

devslam commented Apr 8, 2020

I'm having some difficulty trying to install the patched branch

./gradlew :jib-gradle-plugin:install
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Downloading https://services.gradle.org/distributions/gradle-5.2.1-bin.zip
...................................................................................

Welcome to Gradle 5.2.1!

Here are the highlights of this release:
 - Define sets of dependencies that work together with Java Platform plugin
 - New C++ plugins with dependency management built-in
 - New C++ project types for gradle init
 - Service injection into plugins and project extensions

For more details see https://docs.gradle.org/5.2.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/dev/jib/build.gradle' line: 3

* What went wrong:
Plugin [id: 'com.github.sherter.google-java-format', version: '0.8', apply: false] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.github.sherter.google-java-format:com.github.sherter.google-java-format.gradle.plugin:0.8')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s

@chanseokoh
Copy link
Member

I think it's a temporary outage of the official Gradle Central Plugin Repository. Eventually, it should be available. But if the plugin doesn't become available, you can just remove the Google Java Format plugin from the root build.gradle like this:

--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,5 @@
 // define all versioned plugins here and apply in subprojects as necessary without version
 plugins {
-  id 'com.github.sherter.google-java-format' version '0.8' apply false
   id 'net.ltgt.apt' version '0.19' apply false
   id 'net.ltgt.errorprone' version '0.6' apply false
   id 'net.researchgate.release' version '2.7.0' apply false
@@ -30,7 +29,6 @@ subprojects {
 
   apply plugin: 'java'
   apply plugin: 'checkstyle'
-  apply plugin: 'com.github.sherter.google-java-format'
   apply plugin: 'net.ltgt.apt'
   apply plugin: 'net.ltgt.errorprone'
 
@@ -110,13 +108,6 @@ subprojects {
   }
   /* NULLAWAY */
 
-  /* GOOGLE JAVA FORMAT */
-  googleJavaFormat {
-    toolVersion = '1.6'
-  }
-  check.dependsOn verifyGoogleJavaFormat
-  /* GOOGLE JAVA FORMAT */
-
   /* CHECKSTYLE */
   checkstyle {
     toolVersion = '8.29'

@chanseokoh
Copy link
Member

BTW, I believe the root cause is some network/proxy issue in your environment where you cannot connect to the Docker Hub registry endpoint through registry-1.docker.io or index.docker.io.

@chanseokoh
Copy link
Member

Closing due to inactivity. It is an issue on the user's environment and unrelated to Jib anyway.

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

No branches or pull requests

2 participants