Funny... why is refreshVersions failing at the end...
# refreshversions
d
Funny... why is refreshVersions failing at the end with:
Copy code
<-- HTTP FAILED: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-service/maven-metadata.xml>
--> GET <https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-livedata-ktx/maven-metadata.xml>
--> GET <https://dl.google.com/dl/android/maven2/com/squareup/moshi/moshi-kotlin-codegen/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime-ktx/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://dl.google.com/dl/android/maven2/io/kotest/extensions/kotest-extensions-wiremock/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
j
refreshVersions is downloading a lot of POM in parallel using coroutines, and if it stumble upon an error it cancels the other download task. So you would have to find what was the error, it's not present in the snippet you gave
l
FYI, I am currently working on making refreshVersions tolerant to errors. If you want to help, let me know, we can do pair-programming
d
Maybe this helps more @jmfayard :
Copy code
<-- 200 <https://jcenter.bintray.com/org/cache2k/cache2k-api/maven-metadata.xml> (374ms, 2538-byte body)
--> GET <https://jcenter.bintray.com/androidx/viewpager/viewpager/maven-metadata.xml>
<-- 200 OK <https://plugins.gradle.org/m2/de/fayard/refreshVersions/de.fayard.refreshVersions.gradle.plugin/maven-metadata.xml> (5196ms, unknown-length body)
<-- HTTP FAILED: java.net.SocketTimeoutException: timeout
<-- HTTP FAILED: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/com/google/mlkit/language-id/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/com/google/mlkit/translate/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/com/google/firebase/firebase-bom/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/com/duolingo/open/rtl-viewpager/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/io/coil-kt/coil/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/io/coil-kt/coil-base/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/com/github/chrisbanes/PhotoView/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/org/hashids/hashids/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/com/lomdaat/android/auth-core/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/com/google/dagger/hilt-compiler/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/hilt/hilt-compiler/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/com/github/ajalt/timberkt/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/com/lomdaat/android/purchase/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/com/squareup/moshi/moshi-kotlin-codegen/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/org/cache2k/cache2k-core/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/junit/junit/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/androidx/lifecycle/lifecycle-compiler/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/test/rules/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/test/ext/junit/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/test/espresso/idling/idling-concurrent/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/test/core-ktx/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/work/work-runtime-ktx/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/org/robolectric/robolectric/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/androidx/arch/core/core-testing/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/com/github/tomakehurst/wiremock-jre8/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/io/strikt/strikt-core/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/dev/minutest/minutest/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/app/cash/turbine/turbine/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
--> GET <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-test/maven-metadata.xml>
--> GET <https://jcenter.bintray.com/io/mockk/mockk/maven-metadata.xml>
<-- HTTP FAILED: java.io.IOException: Canceled
<-- HTTP FAILED: java.io.IOException: Canceled
Copy code
* What went wrong:
Execution failed for task ':refreshVersions'.
> java.net.SocketTimeoutException: timeout

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':refreshVersions'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:145)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
...
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:38)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:27)
	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:109)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:93)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:93)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
	at org.gradle.api.internal.tasks.execution.TaskExecution$3.withWorkspace(TaskExecution.java:284)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:142)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:131)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	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.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
	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:61)
Caused by: java.net.SocketTimeoutException: timeout
	at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143)
	at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162)
	at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:335)
	at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:427)
	at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:320)
	at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29)
	at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178)
	at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
Caused by: javax.net.ssl.SSLException: Socket closed
	at okio.InputStreamSource.read(JvmOkio.kt:90)
	at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129)
	... 19 more
Caused by: java.net.SocketException: Socket closed
	... 21 more
I'm consistently getting this problem, and wondering if there's a workaround... I'm trying to commit to my Git with the most recent versions but this is blocking me...
l
@dave08 These gigantic stacktraces and logs don't help much, the cause is a timeout, as shown in the error message.
d
So what could I do?
My internet speed is fine (we're on optic at work...)
l
Anyway, my work on making refreshVersions tolerant to errors is almost complete, I think I'll publish a newer version this weekend
d
So I guess meanwhile I'll have to commit like this... but thanks for having worked on that fix 😄!
l
It's more a feature I'd say 🙂
Although an important one UX wise.
d
Well, in my case it's a big blocker... refreshVersions just doesn't update anything w/o it...! I guess not everybody's in my situation though...
l
It's because one of the repos times out, or your network is blocking responses
d
It makes sense... it's jcenter that's timing out even though it should be read-only. But one way or the other, even if you don't find the dep's repo because of a timeout, it might be worth it to leave a comment (similar to
##unused
, maybe
##failed to update
...) so that the user doesn't think there's no update when there might be.
l
That's exactly what I'm doing
👌🏼 1
Though I'm not sure about the exact message to show in the comment
d
##failed to update
would be enough, it would have to be removed as soon as the update was succeeded. I think anyways the user will have more info in the logs... in the versions.properties file all they need to know is that it wasn't updated, not why...
And committing the failure's reason to Git wouldn't be interesting anyways. But committing that it wasn't able to get the new versions IS.
l
I disagree with that, showing a brief info of the failure cause is important to me.
d
But to commit that to Git? And if there are varying causes, then each commit would change that...?
l
And I'd rather show it contextually rather than in some logs one has to search for
You choose what you commit. You can delete the line, you can retry and hope it succeeds fully…
d
And if it doesn't? It would be a chore to have to delete them every time...
Maybe an option to have the reason added?
l
Then stop using that repo?
Or get a better internet connection?
d
Well, not always can we do that... in the case of jcenter, there are things that the authors didn't publish anywhere else (certain versions at least...) and as long as they keep on running, we have to hope that they'll eventually resolve. But we don't need to update those often anyways...
l
I think I'll start like that, and we'll see if it's worth putting more time to tweak the dev UX on that area.
FYI, I don't plan on showing a full stacktrace. I plan to limit the comment to one line
d
Yeah, I didn't suspect you of doing what I did on this thread 😅!
l
So it'll not be much different from showing a generic failure message. Only a bit more helpful as to how to fix it if possible.
n
as long as it is also showing detailed info in the logs so i can look for it in the gradle scans then i can easily grep for the line that refreshVersion put in as a
## failed to update
comment