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

Unable to fetch yarn from GitHub because of protocol version #696

Closed
danallen88 opened this issue Feb 28, 2018 · 5 comments
Closed

Unable to fetch yarn from GitHub because of protocol version #696

danallen88 opened this issue Feb 28, 2018 · 5 comments

Comments

@danallen88
Copy link

danallen88 commented Feb 28, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Unable to fetch yarn from GitHub

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn (install node) on project dxportal-web: Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.5.1/yarn-v1.5.1.tar.gz: Received fatal alert: protocol_version -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-yarn (install node) on project dxportal-web: Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.5.1/yarn-v1.5.1.tar.gz
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: Could not download Yarn: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.5.1/yarn-v1.5.1.tar.gz
	at com.github.eirslett.maven.plugins.frontend.mojo.MojoUtils.toMojoFailureException(MojoUtils.java:28)
	at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:103)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
Caused by: com.github.eirslett.maven.plugins.frontend.lib.InstallationException: Could not download Yarn
	at com.github.eirslett.maven.plugins.frontend.lib.YarnInstaller.installYarn(YarnInstaller.java:131)
	at com.github.eirslett.maven.plugins.frontend.lib.YarnInstaller.install(YarnInstaller.java:70)
	at com.github.eirslett.maven.plugins.frontend.mojo.InstallNodeAndYarnMojo.execute(InstallNodeAndYarnMojo.java:85)
	at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:94)
	... 22 more
Caused by: com.github.eirslett.maven.plugins.frontend.lib.DownloadException: Could not download https://github.com/yarnpkg/yarn/releases/download/v1.5.1/yarn-v1.5.1.tar.gz
	at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.download(FileDownloader.java:77)
	at com.github.eirslett.maven.plugins.frontend.lib.YarnInstaller.downloadFile(YarnInstaller.java:177)
	at com.github.eirslett.maven.plugins.frontend.lib.YarnInstaller.downloadFileIfMissing(YarnInstaller.java:170)
	at com.github.eirslett.maven.plugins.frontend.lib.YarnInstaller.installYarn(YarnInstaller.java:111)
	... 25 more
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
	at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
	at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.execute(FileDownloader.java:104)
	at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.download(FileDownloader.java:65)
	... 28 more

and pom.xml:

            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <workingDirectory>${basedir}/build</workingDirectory>
                    <installDirectory>${basedir}/build</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>install-node-and-yarn</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v6.4.0</nodeVersion>
                            <yarnVersion>v1.5.1</yarnVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>yarn install</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <configuration>
                            <arguments>--ignore-engines install</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Please mention your frontend-maven-plugin and operating system version.
Mac OSX version 10.11.6, frontend-maven-plugin version 1.6

I can only imagine it's related to: https://github.com/blog/2498-weak-cryptographic-standards-removal-notice

@eirslett
Copy link
Owner

Maybe a newer apache httpclient will fix it...

@danallen88
Copy link
Author

Interestingly it builds fine on our Jenkins instance, so I suspect this is JDK related since JDK 7 defaults to TLSv1. I'll close this unless I find otherwise.

@mikeobr
Copy link

mikeobr commented Mar 30, 2018

How does one go about fixing this? I'm pretty lost on getting this fixed on my machine. I'm using JDK 8 locally which has TLSv2.

@mikeobr
Copy link

mikeobr commented Mar 30, 2018

At the end of a painful day, this jenkinsci/ghprb-plugin#638 gave me the clue I needed. On linux add this

export JAVA_TOOL_OPTIONS="-Dhttps.protocols=TLSv1.2"

And it seems to do the trick.

@jorgutdev
Copy link

Thanks @mikeobr
This also works for maven commands

mvn clean install -Dhttps.protocols=TLSv1.2 did the trick for me

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

4 participants