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

Apache HttpClient failed to download yarn package from s3.amazonaws.com (redirection from github) #138

Closed
huyz0 opened this issue Nov 19, 2020 · 16 comments
Assignees
Labels
Question Request of further information

Comments

@huyz0
Copy link

huyz0 commented Nov 19, 2020

Hi,

Description

What I am trying to do: ./gradlew installYarn
Expected results: yarn is installed
Actual results:

Execution failed for task ':ui:installYarn'.
> javax.net.ssl.SSLPeerUnverifiedException: Certificate for <github-production-release-asset-2e65be.s3.amazonaws.com> doesn't match any of the subject alternative names: [*.s3.amazonaws.com, s3.amazonaws.com]


org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ui:installYarn'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
	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:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
	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:56)
Caused by: org.gradle.api.UncheckedIOException: javax.net.ssl.SSLPeerUnverifiedException: Certificate for <github-production-release-asset-2e65be.s3.amazonaws.com> doesn't match any of the subject alternative names: [*.s3.amazonaws.com, s3.amazonaws.com]
	at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61)
	at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:107)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:555)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:540)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:523)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:260)
	at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:34)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
	at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
	at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
	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.CreateOutputsStep.execute(CreateOutputsStep.java:44)
	at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
	at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:42)
	at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
	at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
	at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
	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:92)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
	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:94)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
	at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:187)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
	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:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
	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:56)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: Certificate for <github-production-release-asset-2e65be.s3.amazonaws.com> doesn't match any of the subject alternative names: [*.s3.amazonaws.com, s3.amazonaws.com]
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:507)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:437)
	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:376)
	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.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.siouan.frontendgradleplugin.infrastructure.httpclient.ApacheHttpClient.getRemoteResource(ApacheHttpClient.java:89)
	at org.siouan.frontendgradleplugin.domain.usecase.AbstractHttpClient.sendGetRequest(AbstractHttpClient.java:33)

Environment

  • OS: [Mac OS X]
  • JDK: [e.g. Oracle JDK 11 64 bits]
  • Gradle: [e.g. Gradle 6.7]
  • Frontend Gradle plugin: [4.0.1]

Settings in build.gradle.kts file:

frontend {
    nodeVersion.set("14.15.0")
    nodeInstallDirectory.set(file("${buildDir}/node"))
    assembleScript.set("run build")
    yarnEnabled.set(true)
    yarnVersion.set("1.22.5")
}

Investigation
Seems like Apache HttpClient failed to do SSL hostname validation for the file. I don't have Windows or Linux to test so not sure whether it works in those environments or not.

@v1nc3n4
Copy link
Member

v1nc3n4 commented Nov 19, 2020

Hi @huynguyentuong,

At the moment, I didn't succeed in reproducing the issue. Either locally with my Windows workstation, or with automated tests under Travis (Windows Server, Mac OS and Linux), everything works fine.
However:

  • I can see GitHub redirects download requests to an AWS S3 bucket.
  • And it seems the issue itself was reported multiple times last years. I could find some bug reports about equivalent problems with private/public domain names and/or wildcards. More recently, in Apache HTTP client 4.5.12, the problem was also reported in other products like here. The plugin uses release 4.5.13.

I have no idea how to fix the issue now, and I don't want to disable any SSL verification when the plugin uses the Apache HTTP client, for security reasons of course.
I will try to report the issue in Apache's bugtracker, and watch for any update on the HTTP client in the next weeks. Right now, I see 2 workarounds:

  • Download and explode the distribution somewhere on the target workstation, and use the yarnDistributionProvided / yarnInstallDirectory properties.
  • Use a distribution server mirroring Yarn's official distribution server, and set the yarnDistributionServerUrlRoot / yarnDistributionServerUrlPathPattern properties accordingly.

Finally:

  • Is the issue systematic?
  • Could you try cloning the master branch, run automated test TaskTypesWithDownloadedDistributionsFuncTest.shouldRunCustomTasks on your workstation, and provide the results here?

Thank you very much for your help!
Best regards

@v1nc3n4 v1nc3n4 self-assigned this Nov 19, 2020
@v1nc3n4 v1nc3n4 added the Bug Something is not working as expected label Nov 19, 2020
@v1nc3n4 v1nc3n4 added this to the 5.0.0 milestone Nov 19, 2020
@v1nc3n4
Copy link
Member

v1nc3n4 commented Nov 27, 2020

Hi @huynguyentuong,

After some research, I don't see any reason the plugin and its internal Apache HTTP client would fail with the s3.amazonaws.com domain name. This domain name is registered as a private domain name suffix in the public suffix list, and the HTTP client has an internal copy of this list which seems up-to-date. This means wildcards shall be supported in certificates by the client, as long as hostname verification with that list of public suffixes is not disabled when an instance is configured to send a request. I didn't find any misconfiguration in the plugin, when the HTTP client is used.

However, I may have made a mistake in the plugin, by using version 4.5.13 of the Apache HTTP client. The client latest version is 5.0.3, and works also perfectly. There's no reason the plugin does not use the latest version. It will be upgraded in the next release.

My question is still pending: do you still face this issue, or was it temporary?
Thank you in advance for your help.
BR

@v1nc3n4 v1nc3n4 removed the Bug Something is not working as expected label Nov 27, 2020
@huyz0
Copy link
Author

huyz0 commented Nov 27, 2020

Hi @v1nc3n4,

Thank you very much for looking into this.

I tried to run the test and it is green. The result is as following

Using 12 worker leases.
Starting Build
Settings evaluated using settings file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/settings.gradle'.
Projects loaded. Root project using build file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build.gradle'.
Included projects: [root project 'junit5042318668945607359']

> Configure project :
Evaluating root project 'junit5042318668945607359' using build file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build.gradle'.
Compiling build file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build.gradle' using SubsetScriptTransformer.
Compiling build file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build.gradle' using BuildScriptTransformer.
All projects evaluated.
Selected primary task 'myRunNodeTask' from project :
Tasks to be executed: [task ':installNode', task ':myRunNodeTask']
:installNode (Thread[Execution worker for ':' Thread 4,5,main]) started.

> Task :installNode
Task ':installNode' is not up-to-date because:
  No history is available.
[installNode] Removing install directory '/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist'
[installNode] Downloading distribution at 'https://nodejs.org/dist/v12.18.3/node-v12.18.3-darwin-x64.tar.gz'
[installNode] Downloading resource at 'https://nodejs.org/dist/v12.18.3/node-v12.18.3-darwin-x64.tar.gz' (proxy: DIRECT)
[installNode] Downloading resource at 'https://nodejs.org/dist/v12.18.3/SHASUMS256.txt' (proxy: DIRECT)
[installNode] Verifying distribution integrity
[installNode] Exploding distribution into '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build/tmp/installNode/extract'
[installNode] Moving distribution into '/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist'
[installNode] Removing explode directory '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build/tmp/installNode/extract'
[installNode] Removing distribution file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build/tmp/installNode/node-v12.18.3-darwin-x64.tar.gz'
[installNode] Distribution installed in '/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist'
:installNode (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 9.024 secs.
:myRunNodeTask (Thread[Execution worker for ':' Thread 4,5,main]) started.

> Task :myRunNodeTask
Task ':myRunNodeTask' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
[myRunNodeTask] Install directory resolved from extension: /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist
[myRunNodeTask] Executable '/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node' resolved from install directory
[myRunNodeTask] Running '/bin/sh' with arguments: [-c], [/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/script.js]
Starting process 'command '/bin/sh''. Working directory: /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend Command: /bin/sh -c /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/script.js
Successfully started process 'command '/bin/sh''
Hello!
:myRunNodeTask (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 0.78 secs.

BUILD SUCCESSFUL in 13s
2 actionable tasks: 2 executed
Using 12 worker leases.
Starting Build
Settings evaluated using settings file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/settings.gradle'.
Projects loaded. Root project using build file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build.gradle'.
Included projects: [root project 'junit5042318668945607359']

> Configure project :
Evaluating root project 'junit5042318668945607359' using build file '/private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/build.gradle'.
All projects evaluated.
Selected primary task 'myRunNodeTask' from project :
Tasks to be executed: [task ':installNode', task ':myRunNodeTask']
:installNode (Thread[Execution worker for ':',5,main]) started.

> Task :installNode UP-TO-DATE
Skipping task ':installNode' as it is up-to-date.
:installNode (Thread[Execution worker for ':',5,main]) completed. Took 0.171 secs.
:myRunNodeTask (Thread[Execution worker for ':',5,main]) started.

> Task :myRunNodeTask
Task ':myRunNodeTask' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
[myRunNodeTask] Install directory resolved from extension: /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist
[myRunNodeTask] Executable '/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node' resolved from install directory
[myRunNodeTask] Running '/bin/sh' with arguments: [-c], [/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/script.js]
Starting process 'command '/bin/sh''. Working directory: /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend Command: /bin/sh -c /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/script.js
Successfully started process 'command '/bin/sh''
Hello!
:myRunNodeTask (Thread[Execution worker for ':',5,main]) completed. Took 0.048 secs.

BUILD SUCCESSFUL in 0s
2 actionable tasks: 1 executed, 1 up-to-date
> Task :installNode UP-TO-DATE

> Task :myRunNpxTask
6.14.6

BUILD SUCCESSFUL in 0s
2 actionable tasks: 1 executed, 1 up-to-date
> Task :installNode UP-TO-DATE

> Task :myRunNpxTask
6.14.6

BUILD SUCCESSFUL in 0s
2 actionable tasks: 1 executed, 1 up-to-date
> Task :installNode UP-TO-DATE
> Task :installYarn SKIPPED

> Task :installFrontend
npm notice created a lockfile as package-lock.json. You should commit this file.
up to date in 0.392s
found 0 vulnerabilities


> Task :myRunNpmYarnTask

> frontend-gradle-plugin-npm-tests@1.0.0 another-script /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> node -v && npm -v && echo 'Another frontend script executed' && npm run check

v12.18.3
6.14.6
Another frontend script executed

> frontend-gradle-plugin-npm-tests@1.0.0 check /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> npm run lint && npm run test


> frontend-gradle-plugin-npm-tests@1.0.0 lint /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend linted'

Frontend linted

> frontend-gradle-plugin-npm-tests@1.0.0 test /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend tested'

Frontend tested

BUILD SUCCESSFUL in 2s
3 actionable tasks: 2 executed, 1 up-to-date
> Task :installNode UP-TO-DATE
> Task :installYarn SKIPPED

> Task :installFrontend
up to date in 0.315s
found 0 vulnerabilities


> Task :myRunNpmYarnTask

> frontend-gradle-plugin-npm-tests@1.0.0 another-script /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> node -v && npm -v && echo 'Another frontend script executed' && npm run check

v12.18.3
6.14.6
Another frontend script executed

> frontend-gradle-plugin-npm-tests@1.0.0 check /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> npm run lint && npm run test


> frontend-gradle-plugin-npm-tests@1.0.0 lint /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend linted'

Frontend linted

> frontend-gradle-plugin-npm-tests@1.0.0 test /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend tested'

Frontend tested

BUILD SUCCESSFUL in 1s
3 actionable tasks: 2 executed, 1 up-to-date
> Task :installNode UP-TO-DATE

> Task :installYarn
Invalid cookie header: "Set-Cookie: _octo=GH1.1.1627453147.1606516210; Path=/; Domain=github.com; Expires=Sat, 27 Nov 2021 22:30:10 GMT; Secure; SameSite=Lax". Invalid 'expires' attribute: Sat, 27 Nov 2021 22:30:10 GMT
Invalid cookie header: "Set-Cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 27 Nov 2021 22:30:10 GMT; HttpOnly; Secure; SameSite=Lax". Invalid 'expires' attribute: Sat, 27 Nov 2021 22:30:10 GMT

> Task :installFrontend
yarn install v1.22.4
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.04s.

> Task :myRunNpmYarnTask
yarn run v1.22.4
$ node -v && npm -v && echo 'Another frontend script executed' && npm run check
v12.18.3
6.14.6
Another frontend script executed
npm WARN lifecycle The node binary used for scripts is /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/yarn--1606516213882-0.026593492711227684/node but npm is using /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> frontend-gradle-plugin-npm-tests@1.0.0 check /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> npm run lint && npm run test

npm WARN lifecycle The node binary used for scripts is /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/yarn--1606516213882-0.026593492711227684/node but npm is using /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> frontend-gradle-plugin-npm-tests@1.0.0 lint /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend linted'

Frontend linted
npm WARN lifecycle The node binary used for scripts is /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/yarn--1606516213882-0.026593492711227684/node but npm is using /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> frontend-gradle-plugin-npm-tests@1.0.0 test /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend tested'

Frontend tested
Done in 1.10s.

BUILD SUCCESSFUL in 5s
4 actionable tasks: 3 executed, 1 up-to-date
> Task :installNode UP-TO-DATE
> Task :installYarn UP-TO-DATE

> Task :installFrontend
yarn install v1.22.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.04s.

> Task :myRunNpmYarnTask
yarn run v1.22.4
$ node -v && npm -v && echo 'Another frontend script executed' && npm run check
v12.18.3
6.14.6
Another frontend script executed
npm WARN lifecycle The node binary used for scripts is /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/yarn--1606516215510-0.9477202198734205/node but npm is using /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> frontend-gradle-plugin-npm-tests@1.0.0 check /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> npm run lint && npm run test

npm WARN lifecycle The node binary used for scripts is /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/yarn--1606516215510-0.9477202198734205/node but npm is using /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> frontend-gradle-plugin-npm-tests@1.0.0 lint /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend linted'

Frontend linted
npm WARN lifecycle The node binary used for scripts is /var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/yarn--1606516215510-0.9477202198734205/node but npm is using /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/node-dist/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> frontend-gradle-plugin-npm-tests@1.0.0 test /private/var/folders/n9/78xkbtyj785_mdfnhg3rv08w0000gn/T/junit5042318668945607359/frontend
> echo 'Frontend tested'

Frontend tested
Done in 0.89s.

BUILD SUCCESSFUL in 1s
4 actionable tasks: 2 executed, 2 up-to-date

The issue is still there, but let me investigate more, or try to upgrade to Apache HTTP 5.xx to see whether it works or not

@huyz0
Copy link
Author

huyz0 commented Nov 27, 2020

Hi @v1nc3n4,

I think I found the issue, probably because of library version clashing of plugins, one of the other plugins I used must be also having another version of Apache HTTP client that having the SSL bug.

If I create a completely empty Gradle project with only our frontend plugin here then we have no problem.

Let me investigate more to see which plugin is that and work with the author to solve it and put the workaround here.

Thanks again for your help.

Cheers,
Huy

@huyz0 huyz0 closed this as completed Nov 27, 2020
@huyz0
Copy link
Author

huyz0 commented Nov 27, 2020

I found a workaround, just explicitly specify the version of HTTP client as following

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath("org.apache.httpcomponents:httpclient:4.5.13")
    }
}

@v1nc3n4
Copy link
Member

v1nc3n4 commented Nov 27, 2020

Hello,
I’m really glad you found the cause of this problem!
The fact the automated test above succeeded also suggested another cause than the plugin itself. And indeed the next step would have been to start a new project with the same configuration than the one created by the integration test. So great job!

I’m glad you also found a workaround by explicitly setting the dependency in the project. I’m sure it will help a lot in the future because it’s not the first time a dependency issue occurs with another library.

Cảm ơn nhiều anh giúp em, chúc anh ngày ngon!
BR

@v1nc3n4 v1nc3n4 removed this from the 5.0.0 milestone Nov 27, 2020
@seleznevmm
Copy link

"I don't see any reason the plugin and its internal Apache HTTP client would fail with the s3.amazonaws.com domain name."
I had same exception in 4.5.12/4.5.13 Http client because my basket name contained dots, like xx.yy.zz and url was like https://xxx.yyy.zzz.s3.amazon.... After I removed dots from basket name to xxyyzz everything works.

@v1nc3n4
Copy link
Member

v1nc3n4 commented Dec 10, 2020

Hi @seleznevmm

Actually, the issue you faced is a different issue, and it is a relevant behaviour I guess. The AWS S3 server uses a wildcard SSL certificate *.s3.amazonaws.com, and the wildcard matches one sub-domain level only. So, it is normal you see such error if the bucket name contains a dot, i.e. a true positive case.
Renaming the bucket is the appropriate solution, and that’s what you did successfully.

Hope this helps!
BR

@efenderbosch
Copy link

efenderbosch commented Dec 15, 2020

I'm seeing the same issue. Adding the classpath dependency didn't fix it. Anything else I can try?

I also tried with org.apache.httpcomponents.client5:httpclient5:5.0.3 and get the same error:

Invalid cookie header: "Set-Cookie: _octo=GH1.1.1696839349.1608042410; Path=/; Domain=github.com; Expires=Wed, 15 Dec 2021 14:26:50 GMT; Secure; SameSite=Lax". Invalid 'expires' attribute: Wed, 15 Dec 2021 14:26:50 GMT
Invalid cookie header: "Set-Cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 15 Dec 2021 14:26:50 GMT; HttpOnly; Secure; SameSite=Lax". Invalid 'expires' attribute: Wed, 15 Dec 2021 14:26:50 GMT

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':web-ui:installYarn'.
> javax.net.ssl.SSLPeerUnverifiedException: Certificate for <github-production-release-asset-2e65be.s3.amazonaws.com> doesn't match any of the subject alternative names: [*.s3.amazonaws.com, s3.amazonaws.com]

@v1nc3n4
Copy link
Member

v1nc3n4 commented Dec 15, 2020

Hi @efenderbosch,

Have you tried running the installYarn task in a blank project with the plugin only? I'm not sure whether it can be resolved just by requiring the Apache HTTP Client 5.0.3 library explicitly.

Regards

@v1nc3n4
Copy link
Member

v1nc3n4 commented Dec 15, 2020

@efenderbosch
I can also confirm that, if you tried to add the HTTP client 5.0.3 explicitly, for sure this library was not chosen at runtime, because the 2 warnings Invalid cookie header are typical warnings of the HTTP client 4.5.13 and don't exist anymore in the 5.0.3 release (see issue #134).
I can only suggest to start from one of the project templates provided in the examples section of this repository, to find out when the problem occurs.
Feel free to share the results here!
BR

@efenderbosch
Copy link

It works as expected in an empty project.

@v1nc3n4
Copy link
Member

v1nc3n4 commented Dec 17, 2020

@efenderbosch,
To help you progressing to the source of the problem:
I just realised one thing regarding what you tried: adding an explicit dependency on release 5.0.3 of Apache HTTP client can't work for sure if I assume you are using release 4.0.1 of the plugin. The expected release of the HTTP client is 4.5.13.
Can you try changing the release and share the results here? Thanks again for your help.

@efenderbosch
Copy link

First thing I tried was 4.5.13.

I'm seeing the same issue. Adding the classpath dependency didn't fix it. Anything else I can try?

@v1nc3n4
Copy link
Member

v1nc3n4 commented Dec 21, 2020

Sorry to read that. Apart from progressing step by step by adding dependencies into a sample project and see when the problem occurs, I don't have a solution. To me, it doesn't seem to be a plugin issue.
Maybe you could try to use Gradle's dependencies task, to find which dependencies use an obsolete release of Apache HTTP client.

@efenderbosch
Copy link

efenderbosch commented Dec 21, 2020

The only version of org.apache.httpcomponents:httpclient in the report is 4.5.13.

|    +--- software.amazon.awssdk:apache-client:2.15.50
|    |    +--- software.amazon.awssdk:http-client-spi:2.15.50 (*)
|    |    +--- software.amazon.awssdk:metrics-spi:2.15.50 (*)
|    |    +--- software.amazon.awssdk:utils:2.15.50 (*)
|    |    +--- software.amazon.awssdk:annotations:2.15.50
|    |    +--- org.apache.httpcomponents:httpclient:4.5.13
|    |    |    +--- org.apache.httpcomponents:httpcore:4.4.13
|    |    |    +--- commons-logging:commons-logging:1.2
|    |    |    \--- commons-codec:commons-codec:1.11
|    |    \--- org.apache.httpcomponents:httpcore:4.4.11 -> 4.4.13

@v1nc3n4 v1nc3n4 added the Question Request of further information label Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Request of further information
Projects
None yet
Development

No branches or pull requests

4 participants