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

[Bug]: java.security.NoSuchAlgorithmException: Error constructing implementation #30

Open
RomanValov opened this issue Mar 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@RomanValov
Copy link

What happened?

It seems it somehow related to #6 . But reproduced on Ubuntu 22.04 with gradle snaps on stable (7.2) and on edge (7.4)

Steps to reproduce:

$ rm -rf ~/.gradle/caches
$ git clone https://github.com/jenkins-docs/simple-java-maven-app.git
$ cd simple-java-maven-app
$ gradle init --no-daemon

Then choose default options for all questions gradle asks. Gradle will attempt to download deps from repository.
But failed to do so due to broken cacerts. Full log provided further.

What should have happened?

Here is workaround: specify trust store path explicitly:

$ gradle -Djavax.net.ssl.trustStore=/snap/gradle/current/etc/ssl/certs/java/cacerts init --no-daemon

It's expected app to behave the same as workaround applied.

Output of snap info $snap_name

name:      gradle
summary:   An open-source build automation tool
publisher: Snapcrafters
store-url: https://snapcraft.io/gradle
contact:   https://github.com/snapcrafters/gradle/issues
license:   Apache-2.0
description: |
  Gradle is a build tool with a focus on build automation and support for multi-language
  development. If you are building, testing, publishing, and deploying software on any platform,
  Gradle offers a flexible model that can support the entire development lifecycle from compiling
  and packaging code to publishing web sites. Gradle has been designed to support build automation
  across multiple languages and platforms including Java, Scala, Android, C/C++, and Groovy, and is
  closely integrated with development tools and continuous integration servers including Eclipse,
  IntelliJ, and Jenkins.
commands:
  - gradle
snap-id:      ODK1djMochvIgz8T5VxewEgw73OwALts
tracking:     latest/edge
refresh-date: today at 10:00 UTC
channels:
  latest/stable:    7.2   2021-09-29 (134) 461MB classic
  latest/candidate: ↑                            
  latest/beta:      ↑                            
  latest/edge:      7.4.1 2022-11-14 (154) 463MB classic
  6.8.x/stable:     6.8.3 2021-05-26  (87) 203MB classic
  6.8.x/candidate:  ↑                            
  6.8.x/beta:       ↑                            
  6.8.x/edge:       ↑                            
installed:          7.4.1            (154) 463MB classic

Output of snap connections $snap_name

<empty>

Output of snap version

snap    2.58.2
snapd   2.58.2
series  16
ubuntu  22.04
kernel  5.15.0-67-generic

Relevant log output

No response

Teminal output of app

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.4.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

Found a Maven build. Generate a Gradle build from this? (default: yes) [yes, no] 

Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2] 

Generate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] 

> Task :init
Maven to Gradle conversion is an incubating feature.

> Task :init FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':init'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not resolve org.apache.maven:maven-core:3.6.3.
     Required by:
         project :
      > Could not resolve org.apache.maven:maven-core:3.6.3.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.6.3/maven-core-3.6.3.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
   > Could not resolve org.apache.maven:maven-plugin-api:3.6.3.
     Required by:
         project :
      > Could not resolve org.apache.maven:maven-plugin-api:3.6.3.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.6.3/maven-plugin-api-3.6.3.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
   > Could not resolve org.apache.maven:maven-compat:3.6.3.
     Required by:
         project :
      > Could not resolve org.apache.maven:maven-compat:3.6.3.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/maven/maven-compat/3.6.3/maven-compat-3.6.3.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
   > Could not resolve org.apache.maven.wagon:wagon-http:3.4.2.
     Required by:
         project :
      > Could not resolve org.apache.maven.wagon:wagon-http:3.4.2.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-http/3.4.2/wagon-http-3.4.2.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
   > Could not resolve org.apache.maven.wagon:wagon-provider-api:3.4.2.
     Required by:
         project :
      > Could not resolve org.apache.maven.wagon:wagon-provider-api:3.4.2.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/3.4.2/wagon-provider-api-3.4.2.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
   > Could not resolve org.eclipse.aether:aether-connector-basic:1.1.0.
     Required by:
         project :
      > Could not resolve org.eclipse.aether:aether-connector-basic:1.1.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/eclipse/aether/aether-connector-basic/1.1.0/aether-connector-basic-1.1.0.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
   > Could not resolve org.eclipse.aether:aether-transport-wagon:1.1.0.
     Required by:
         project :
      > Could not resolve org.eclipse.aether:aether-transport-wagon:1.1.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/eclipse/aether/aether-transport-wagon/1.1.0/aether-transport-wagon-1.1.0.pom'.
            > java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)

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

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

BUILD FAILED in 7s
2 actionable tasks: 1 executed, 1 up-to-date
@RomanValov RomanValov added the bug Something isn't working label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant