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

When plugin id specified, "gradle tasks" results in java.security.InvalidKeyException: EC parameters error #2421

Closed
bickelj opened this Issue Jul 8, 2017 · 18 comments

Comments

Projects
None yet
10 participants
@bickelj

bickelj commented Jul 8, 2017

Expected Behavior

Running "gradle tasks" should successfully retrieve the plugin specified, then show the list of tasks.

Current Behavior

Running "gradle tasks" results in "FAILURE: Build failed with an exception." ... Error resolving plugin [id: ...> Could not GET 'https://plugins.gradle.org/...' ... > java.security.ProviderException: java.security.InvalidKeyException: EC parameters error

When I run --stacktrace, the root exception appears to be:

Caused by: java.security.NoSuchProviderException: no such provider: SunEC

Context

I am trying to use a plugin: id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3' in a build script to run a simple example.

Steps to Reproduce (for bugs)

  1. Create a build script with the following contents:

    plugins {
    id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3'
    }

  2. run any gradle command, such as

    gradle tasks

Your Environment

Trisquel GNU/Linux 7.0 amd64 (Similar to Ubuntu 14.04)
openjdk 7u131 amd64

Particulars

$ gradle -v

------------------------------------------------------------
Gradle 4.0.1
------------------------------------------------------------

Build time:   2017-07-07 14:02:41 UTC
Revision:     38e5dc0f772daecca1d2681885d3d85414eb6826

Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.7.0_131 (Oracle Corporation 24.131-b00)
OS:           Linux 4.8.12-gnu amd64


$ dpkg -l | grep '^ii  openjdk'
ii  openjdk-7-jdk:amd64                         7u131-2.6.9-0ubuntu0.14.04.2                        amd64        OpenJDK Development Kit (JDK)
ii  openjdk-7-jre:amd64                         7u131-2.6.9-0ubuntu0.14.04.2                        amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless:amd64                7u131-2.6.9-0ubuntu0.14.04.2                        amd64        OpenJDK Java runtime, using Hotspot JIT (headless)


$ java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)


$ grep SunEC /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/java.security
security.provider.3=sun.security.ec.SunEC


$ cp /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/local_policy.jar . && unzip local_policy.jar && cat default_local.policy && rm *policy*
Archive:  local_policy.jar
   creating: META-INF/
 extracting: META-INF/MANIFEST.MF    
  inflating: default_local.policy    
// Country-specific policy file for countries with no limits on crypto strength.
grant {
    // There is no restriction to any algorithms.
    permission javax.crypto.CryptoAllPermission; 
};


$ cat build.gradle
plugins {
    id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3'
}


$ gradle tasks --stacktrace

FAILURE: Build failed with an exception.

* Where:
Build file '/home/everybody/code/java/simple-gradle/build.gradle' line: 2

* What went wrong:
Error resolving plugin [id: 'org.openrepose.gradle.plugins.jaxb', version: '2.2.3']
> Could not GET 'https://plugins.gradle.org/api/gradle/4.0.1/plugin/use/org.openrepose.gradle.plugins.jaxb/2.2.3'.
   > java.security.ProviderException: java.security.InvalidKeyException: EC parameters error

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleException: Error resolving plugin [id: 'org.openrepose.gradle.plugins.jaxb', version: '2.2.3']
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:234)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$100(DefaultPluginRequestApplicator.java:64)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:94)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:91)
        at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:201)
        at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:196)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:91)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:167)
        at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:63)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:654)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:132)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:60)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:195)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:44)
        at org.gradle.initialization.DefaultGradleLauncher$1.run(DefaultGradleLauncher.java:122)
        at org.gradle.internal.work.DefaultWorkerLeaseService$2.execute(DefaultWorkerLeaseService.java:124)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:116)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:99)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:50)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://plugins.gradle.org/api/gradle/4.0.1/plugin/use/org.openrepose.gradle.plugins.jaxb/2.2.3'.
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:89)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:73)
        at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getRawResource(HttpResourceAccessor.java:58)
        at org.gradle.plugin.use.resolve.service.internal.HttpPluginResolutionServiceClient.request(HttpPluginResolutionServiceClient.java:86)
        at org.gradle.plugin.use.resolve.service.internal.HttpPluginResolutionServiceClient.queryPluginMetadata(HttpPluginResolutionServiceClient.java:66)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient$1.create(PersistentCachingPluginResolutionServiceClient.java:60)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient$1.create(PersistentCachingPluginResolutionServiceClient.java:58)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.fetch(PersistentCachingPluginResolutionServiceClient.java:110)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.maybeFetch(PersistentCachingPluginResolutionServiceClient.java:103)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.maybeFetch(PersistentCachingPluginResolutionServiceClient.java:91)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.queryPluginMetadata(PersistentCachingPluginResolutionServiceClient.java:67)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient$1.create(InMemoryCachingPluginResolutionServiceClient.java:47)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient$1.create(InMemoryCachingPluginResolutionServiceClient.java:45)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient.getResponse(InMemoryCachingPluginResolutionServiceClient.java:76)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient.queryPluginMetadata(InMemoryCachingPluginResolutionServiceClient.java:42)
        at org.gradle.plugin.use.resolve.service.internal.DeprecationListeningPluginResolutionServiceClient.queryPluginMetadata(DeprecationListeningPluginResolutionServiceClient.java:48)
        at org.gradle.plugin.use.resolve.service.internal.PluginResolutionServiceResolver.resolve(PluginResolutionServiceResolver.java:94)
        at org.gradle.plugin.use.resolve.internal.CompositePluginResolver.resolve(CompositePluginResolver.java:33)
        at org.gradle.plugin.use.resolve.internal.NotNonCorePluginOnClasspathCheckPluginResolver.resolve(NotNonCorePluginOnClasspathCheckPluginResolver.java:42)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:232)
        ... 92 more
Caused by: javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
        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.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:133)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:119)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:96)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:87)
        ... 111 more
Caused by: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
        ... 126 more
Caused by: java.security.InvalidKeyException: EC parameters error
        ... 126 more
Caused by: java.security.NoSuchProviderException: no such provider: SunEC
        ... 126 more


BUILD FAILED in 1s
@bmuschko

This comment has been minimized.

Show comment
Hide comment
@bmuschko

bmuschko Jul 10, 2017

Contributor

This works fine for me. My guess is that you have some misconfigured environment though I wouldn't be able to point you to the exact problem.

Contributor

bmuschko commented Jul 10, 2017

This works fine for me. My guess is that you have some misconfigured environment though I wouldn't be able to point you to the exact problem.

@bickelj

This comment has been minimized.

Show comment
Hide comment
@bickelj

bickelj Jul 11, 2017

@bmuschko Thanks for taking a look. Was that on Ubuntu 14.04?

I will keep looking in my java and system config.

bickelj commented Jul 11, 2017

@bmuschko Thanks for taking a look. Was that on Ubuntu 14.04?

I will keep looking in my java and system config.

@bmuschko

This comment has been minimized.

Show comment
Hide comment
@bmuschko

bmuschko Jul 11, 2017

Contributor

@bickelj No, I tried on Mac. I doubt there's a general issue as we test resolution of plugins with the plugin DSL on Ubuntu and an Windows. It's probably an issue with your Java configuration.

Contributor

bmuschko commented Jul 11, 2017

@bickelj No, I tried on Mac. I doubt there's a general issue as we test resolution of plugins with the plugin DSL on Ubuntu and an Windows. It's probably an issue with your Java configuration.

@bickelj

This comment has been minimized.

Show comment
Hide comment
@bickelj

bickelj Jul 15, 2017

I also tried this on a second Trisquel 7 machine and a Debian 7 machine. Same issue occurs on those.

bickelj commented Jul 15, 2017

I also tried this on a second Trisquel 7 machine and a Debian 7 machine. Same issue occurs on those.

@bickelj

This comment has been minimized.

Show comment
Hide comment
@bickelj

bickelj Jul 15, 2017

By following instructions at https://bouncycastle.org/specifications.html under "6.0 Bouncy Castle Provider" and making BouncyCastle the number 1 provider, the issue is worked around.

So this could be an issue with OpenJDK or Debian. But it would be extra nice if the TLS endpoint at plugins.gradle.org would work with openjdk 7 on these platforms out of the box, probably would be some configuration change to use something other than EC.

bickelj commented Jul 15, 2017

By following instructions at https://bouncycastle.org/specifications.html under "6.0 Bouncy Castle Provider" and making BouncyCastle the number 1 provider, the issue is worked around.

So this could be an issue with OpenJDK or Debian. But it would be extra nice if the TLS endpoint at plugins.gradle.org would work with openjdk 7 on these platforms out of the box, probably would be some configuration change to use something other than EC.

@tbroyer

This comment has been minimized.

Show comment
Hide comment
@tbroyer

tbroyer Aug 1, 2017

Contributor

FWIW, I have the same error on Travis CI (Ubuntu 14.04 (Trusty)) with OpenJDK 7, when the wrapper attempts to download the distribution from services.gradle.org: https://travis-ci.org/tbroyer/gradle-apt-plugin/jobs/259570018

Googling a bit, I found that others have had the same error as far back as 2 months ago: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/2479 (openjdk 7 too, if the ruby:2.1 docker image is the one from the Docker Hub, then it was based on Debian Jessie; in the log, you'll see that wget has no issue retrieving the distribution, but then the Gradle wrapper fails when trying to do the same)

Others could download from services.gradle.org 14 days ago (!) but the build then failed to resolve plugins from plugins.gradle.org: travis-ci/travis-ci#8109 (Ubuntu 12.04 (Precise), openjdk7; different error though, could possibly be due to Gradle version? or Precise vs Trusty?)

It looks like Cloudflare would use an ECDHE cipher with Java 7, but the EC cipher suites aren't supported by default on OpenJDK 7 (at least as packaged by Debian and Ubuntu). Compare https://packages.ubuntu.com/trusty/amd64/openjdk-7-jre-headless/filelist (no libsunec.so or sunec.jar) vs https://packages.ubuntu.com/xenial/amd64/openjdk-8-jre-headless/filelist (the openjdk8 used by Travis actually comes from https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa, but I suppose it contains SunEC).

Contributor

tbroyer commented Aug 1, 2017

FWIW, I have the same error on Travis CI (Ubuntu 14.04 (Trusty)) with OpenJDK 7, when the wrapper attempts to download the distribution from services.gradle.org: https://travis-ci.org/tbroyer/gradle-apt-plugin/jobs/259570018

Googling a bit, I found that others have had the same error as far back as 2 months ago: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/2479 (openjdk 7 too, if the ruby:2.1 docker image is the one from the Docker Hub, then it was based on Debian Jessie; in the log, you'll see that wget has no issue retrieving the distribution, but then the Gradle wrapper fails when trying to do the same)

Others could download from services.gradle.org 14 days ago (!) but the build then failed to resolve plugins from plugins.gradle.org: travis-ci/travis-ci#8109 (Ubuntu 12.04 (Precise), openjdk7; different error though, could possibly be due to Gradle version? or Precise vs Trusty?)

It looks like Cloudflare would use an ECDHE cipher with Java 7, but the EC cipher suites aren't supported by default on OpenJDK 7 (at least as packaged by Debian and Ubuntu). Compare https://packages.ubuntu.com/trusty/amd64/openjdk-7-jre-headless/filelist (no libsunec.so or sunec.jar) vs https://packages.ubuntu.com/xenial/amd64/openjdk-8-jre-headless/filelist (the openjdk8 used by Travis actually comes from https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa, but I suppose it contains SunEC).

@jameskleeh

This comment has been minimized.

Show comment
Hide comment
@jameskleeh

jameskleeh Aug 3, 2017

@tbroyer Did you find any solution?

jameskleeh commented Aug 3, 2017

@tbroyer Did you find any solution?

@tbroyer

This comment has been minimized.

Show comment
Hide comment
@tbroyer

tbroyer Aug 3, 2017

Contributor

@jameskleeh A workaround: running ./gradlew classes testClasses with openjdk8 prior to the actual build.

install:
 - JAVA_HOME=$(jdk_switcher home openjdk8) ./gradlew classes testClasses

And I couldn't just switch to oraclejdk7 because of travis-ci/travis-ci#7884 (which appears unlikely to ever be fixed travis-ci/travis-ci#7884 (comment))

Contributor

tbroyer commented Aug 3, 2017

@jameskleeh A workaround: running ./gradlew classes testClasses with openjdk8 prior to the actual build.

install:
 - JAVA_HOME=$(jdk_switcher home openjdk8) ./gradlew classes testClasses

And I couldn't just switch to oraclejdk7 because of travis-ci/travis-ci#7884 (which appears unlikely to ever be fixed travis-ci/travis-ci#7884 (comment))

graemerocher added a commit to grails/grails-async that referenced this issue Aug 16, 2017

@rtyley

This comment has been minimized.

Show comment
Hide comment
@rtyley

rtyley Aug 21, 2017

A workaround: running ./gradlew classes testClasses with openjdk8 prior to the actual build.

Good workaround - for me, using Codeship rather than Travis, my project build setup script was:

jdk_switcher home oraclejdk8
jdk_switcher use oraclejdk8
export GRADLE_VERSION=3.4.1
\curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/gradle.sh | bash -s
gradle classes testClasses
jdk_switcher home openjdk7
jdk_switcher use openjdk7

CodeShip doesn't have openjdk8 for some reason, so primed the pump with oraclejdk8.

rtyley commented Aug 21, 2017

A workaround: running ./gradlew classes testClasses with openjdk8 prior to the actual build.

Good workaround - for me, using Codeship rather than Travis, my project build setup script was:

jdk_switcher home oraclejdk8
jdk_switcher use oraclejdk8
export GRADLE_VERSION=3.4.1
\curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/gradle.sh | bash -s
gradle classes testClasses
jdk_switcher home openjdk7
jdk_switcher use openjdk7

CodeShip doesn't have openjdk8 for some reason, so primed the pump with oraclejdk8.

@krmahadevan

This comment has been minimized.

Show comment
Hide comment
@krmahadevan

krmahadevan Sep 2, 2017

I am seeing the same problem for the TestNG builds as well. https://travis-ci.org/cbeust/testng/jobs/271191856

Can someone please tell me what should be done to get this sorted out ?

krmahadevan commented Sep 2, 2017

I am seeing the same problem for the TestNG builds as well. https://travis-ci.org/cbeust/testng/jobs/271191856

Can someone please tell me what should be done to get this sorted out ?

@bickelj

This comment has been minimized.

Show comment
Hide comment
@bickelj

bickelj Sep 2, 2017

@krmahadevan There are a few workarounds, any of these should work:

  • Use OpenJDK 8
  • Use BouncyCastle as a security provider prioritized over stock OpenJDK 7 providers (see https://bouncycastle.org/specifications.html)
  • Theoretically one could set up a proxy to gradle.org, exposing RSA cryptography instead of elliptic curve cryptography (probably overkill)
  • Wait for gradle.org to change the TLS settings on their site (unlikely, sounds like they use an edge provider, so may not be in their control)

bickelj commented Sep 2, 2017

@krmahadevan There are a few workarounds, any of these should work:

  • Use OpenJDK 8
  • Use BouncyCastle as a security provider prioritized over stock OpenJDK 7 providers (see https://bouncycastle.org/specifications.html)
  • Theoretically one could set up a proxy to gradle.org, exposing RSA cryptography instead of elliptic curve cryptography (probably overkill)
  • Wait for gradle.org to change the TLS settings on their site (unlikely, sounds like they use an edge provider, so may not be in their control)

krmahadevan added a commit to krmahadevan/testng that referenced this issue Sep 3, 2017

Fix OpenJDK7 failures on Travis
More details can be found in this issue:

gradle/gradle#2421

@krmahadevan krmahadevan referenced this issue Sep 3, 2017

Merged

Fix OpenJDK7 failures on Travis #1524

0 of 2 tasks complete

krmahadevan added a commit to krmahadevan/testng that referenced this issue Sep 3, 2017

Fix OpenJDK7 failures on Travis
More details can be found in this issue:

gradle/gradle#2421

yidongnan added a commit to yidongnan/grpc-spring-boot-starter that referenced this issue Sep 4, 2017

Fix OpenJDK7 failures on Travis
Fix OpenJDK7 failures on Travis
More details can be found in this issue:

gradle/gradle#2421

yidongnan added a commit to yidongnan/grpc-spring-boot-starter that referenced this issue Sep 4, 2017

3xp0n3nt added a commit to forerunnergames/fg-tools that referenced this issue Sep 4, 2017

psibre added a commit to psibre/marytts that referenced this issue Sep 5, 2017

psibre added a commit to psibre/marytts that referenced this issue Sep 5, 2017

ensure Gradle is run on OpenJDK 8
workaround for java.security.InvalidKeyException
see gradle/gradle#2421
@jameskleeh

This comment has been minimized.

Show comment
Hide comment
@jameskleeh

jameskleeh Sep 5, 2017

@bickelj Do you have any resources on how to use BouncyCastle with Travis?

jameskleeh commented Sep 5, 2017

@bickelj Do you have any resources on how to use BouncyCastle with Travis?

jameskleeh added a commit to grails/grails-views that referenced this issue Sep 5, 2017

sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017

Fix build on Travis
Continue to build artifact with opendjdk7, but run tests with openjdk8
and oraclejdk8, so we can get around issue
gradle/gradle#2421

sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017

sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017

tangiel added a commit to cloudendpoints/endpoints-java that referenced this issue Oct 20, 2017

kazoni added a commit to kazoni/java-http-client that referenced this issue Oct 24, 2017

pforhan added a commit to pforhan/phrase that referenced this issue Oct 24, 2017

Update license and remove oraclejdk7 to fix build
Oracle JDK 7 no longer available; openJDK7 is missing an EC crypto
provider needed to download gradle plugins, so I just removed the 7
compiler. We could pursue workarounds but they're a bit messy, see
https://github.com/uber-java/tally/blob/2cea75ecc2f896dfd5e32b94bff71f211c8bde56/ci/before_install.sh#L6-L12

and gradle/gradle#2421
@javabrett

This comment has been minimized.

Show comment
Hide comment
@javabrett

javabrett Oct 27, 2017

Contributor

For Travis there is an issue tracking this travis-ci/travis-ci#8503 . I posted a BouncyCastle JCE provider solution using a Dockerfile over there.

Contributor

javabrett commented Oct 27, 2017

For Travis there is an issue tracking this travis-ci/travis-ci#8503 . I posted a BouncyCastle JCE provider solution using a Dockerfile over there.

sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 28, 2017

Drop (official) support for running on java 7
We still compile with "targetCompatibility = 1.7", but don't run
integration tests on Java 7 JVMs.

This also takes care of gradle/gradle#2421

jedichenbin pushed a commit to AusRegistry/ari-toolkit that referenced this issue Nov 19, 2017

Bin Chen
Decommission the build env for openjdk7 and oraclejdk7
Travis CI has problem on these two building environments,

1. In oraclejdk7 env, './gradlew assemble' failed due to "JAVA_HOME is
    set to an invalid directory: /usr/lib/jvm/java-7-oracle"
2. In openjdk7 env, './gradlew assemble' failed due to
    "java.security.NoSuchProviderException: no such provider: SunEC".

The first issue is because Trusty no longer supports Oracle Java 7,
according to travis-ci/travis-ci#7884.

The second issue is a problem between JVMs and Gradle Inc. servers
(`services.gradle.org` and `plugins.gradle.org`), that can only be
solved by JVM or server configuration changes. The first approach
requires the manipulation of java security providers. The second option
is unlikely to happen because it decreases security, and more
importantly the servers are managed by a third party.
Refer to: gradle/gradle#2421

In the gradle script we actually already force both source compatibility
and target compatibility to be 1.6, which means the build will fail if
the source code is not 1.6 compatible, also it guarantees the generated
class files would be able to run on Java 6+.

That being said, we don't really need to run the builds on JDK7 env. So
this change is to decommission the two build env in Travis CI.

cwardgar added a commit to Unidata/gretty that referenced this issue Dec 1, 2017

Debug Travis, part 1
* Run testAll with --info and --stacktrace
* Don't test on openjdk7, due to gradle/gradle#2421

mattmoss added a commit to gpc/grails-excel-import that referenced this issue Dec 14, 2017

Artoria2e5 added a commit to sih4sing5hong5/han3_ji7_tsoo1_kian3 that referenced this issue Dec 28, 2017

試用 openjdk8
Gradle 把 SSL 改成了什麼 EC 的東東,結果 openjdk7 不換密碼學套組的話不能用。要換的話要整 sudo 麻煩,另外考慮到 gradle 也不準備支援 java 7 了,就直接改成 java 8 看看能不能測過。

gradle/gradle#2421

psibre added a commit to psibre/marytts-voicebuilding that referenced this issue Jan 24, 2018

psibre added a commit to psibre/marytts-lexicon-pl that referenced this issue Feb 5, 2018

3xp0n3nt added a commit to forerunnergames/fg-tools that referenced this issue Aug 9, 2018

Fix Travis CI build.
Update Travis CI to run on Trusty instead of Precise, in order to solve all of
the following issues:

  - Coveralls: "Uploading a report to Coveralls fails due to
    SunCertPathBuilderException"
    travis-ci/travis-ci#7094

  - "Update on Trusty as default Linux"
    https://blog.travis-ci.com/2017-08-31-trusty-as-default-status

However, upgrading to Trusty introduces a regression:

  "When plugin id specified, "gradle tasks" results in
  java.security.InvalidKeyException: EC parameters error"
  gradle/gradle#2421

The original workaround for gradle/gradle#2421 was using 'dist:precise' in
.travis.yml (16b7543), but now Precise is
being phased out in favor of Trusty, so it needs to be solved in another
manner:

  - Manually install BouncyCastle.org crypto library as a java security
    provider which solves the issue more directly.

Update .travis.yml copyright notice.

3xp0n3nt added a commit to forerunnergames/fg-tools that referenced this issue Aug 9, 2018

Fix Travis CI build.
Update Travis CI to run on Trusty instead of Precise, in order to solve all of
the following issues:

  - Coveralls: "Uploading a report to Coveralls fails due to
    SunCertPathBuilderException"
    travis-ci/travis-ci#7094

  - "Update on Trusty as default Linux"
    https://blog.travis-ci.com/2017-08-31-trusty-as-default-status

However, upgrading to Trusty introduces a regression:

  "When plugin id specified, "gradle tasks" results in
  java.security.InvalidKeyException: EC parameters error"
  gradle/gradle#2421

The original workaround for gradle/gradle#2421 was using 'dist:precise' in
.travis.yml (16b7543), but now Precise is
being phased out in favor of Trusty, so it needs to be solved in another
manner:

  - Manually install BouncyCastle.org crypto library as a java security
    provider which solves the issue more directly.

Update .travis.yml copyright notice.

3xp0n3nt added a commit to forerunnergames/fg-tools that referenced this issue Aug 9, 2018

Fix Travis CI build.
Update Travis CI to run on Trusty instead of Precise, in order to solve all of
the following issues:

  - Coveralls: "Uploading a report to Coveralls fails due to
    SunCertPathBuilderException"
    travis-ci/travis-ci#7094

  - "Update on Trusty as default Linux"
    https://blog.travis-ci.com/2017-08-31-trusty-as-default-status

However, upgrading to Trusty introduces a regression:

  "When plugin id specified, "gradle tasks" results in
  java.security.InvalidKeyException: EC parameters error"
  gradle/gradle#2421

The original workaround for gradle/gradle#2421 was using 'dist:precise' in
.travis.yml (16b7543), but now Precise is
being phased out in favor of Trusty, so it needs to be solved in another
manner:

  - Manually install BouncyCastle.org crypto library as a java security
    provider which solves the issue more directly.

Update .travis.yml copyright notice.

puneetbehl added a commit to grails-plugins/grails-spring-batch that referenced this issue Oct 5, 2018

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