snapcrafters / gradle

A community-maintained package to easily install Gradle on Linux
MIT License
8 stars 14 forks source link

missing cacert link in snap gradle #6

Closed volkerd closed 3 years ago

volkerd commented 3 years ago

Hi, after refresh to rev 79, gradle was unable to publish artifacts to Nexus

Failed to publish publication 'dist' to repository 'maven'
   > org.apache.http.ssl.SSLInitializationException: /snap/gradle/78/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)

it seems this symlink is missing 78/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacert

I reverted to rev 59, so it works for now.

Thanks for your work Volker

# snap list --all gradle
Name    Version  Rev  Tracking       Publisher     Notes
gradle  6.8      59   latest/stable  snapcrafters  classic
gradle  6.8.3    78   latest/stable  snapcrafters  disabled,classic

# snap version
snap    2.49.1
snapd   2.49.1
series  16
ubuntu  20.04
kernel  5.8.0-48-generic
JerryPreissler commented 3 years ago

I can confirm that this problem exists as well for my local gradle installation which is rev 78. In my case it is messing up running 'gradle test' in my project:

org.apache.http.ssl.SSLInitializationException: /snap/gradle/78/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)

I'd appreciate instructions on how I can revert to version 59 - it seems to be installed (I can see it with 'snap list --all' and in the filesystem), but

sudo snap install --revision=59 gradle

either tells me that gradle is already installed or (if I remove the snap first) that specific revisions may not be installed for this snap.

tunix commented 3 years ago

Sorry, I don't receive notifications for these issues as I'm currently not part of snapcrafters. 7.0.2 has just been merged and will be available shortly in the stable channel. Can you please test and see if it resolves this issue for you?

tunix commented 3 years ago

Btw, I use this snap daily and use it to publish artifacts to Nexus. I haven't seen such issues. If you still have this issue with 7.0.2, could you please give a bit more detail about your setup and how to reproduce it etc?

JerryPreissler commented 3 years ago

Thanks for looking into this. I installed 7.0.2 via snap (I've reverted to a manual install in the meantime) and can still replicate the problem. It can be triggered by running 'gradle test' in my project after clearing the local gradle cache. I'll attach a file with the output produced with the --stacktrace option. As you can see here the required cacert file is indeed missing:

jerry@nomad:~/Develop/buecherkiste$ ls /snap/gradle/89/usr/lib/jvm/java-11-openjdk-amd64/lib/security/
blacklisted.certs  default.policy  public_suffix_list.dat

gradle_stacktrace.txt

JerryPreissler commented 3 years ago

My machine is running Ubuntu 20.10 with OpenJDK 11 installed via apt. If you need more information, please just ask.

tunix commented 3 years ago

These symlinks were removed because they caused issues on automated builds. I looked at a previous discussion thread about it and started to look at some example snaps that seems to sorted out this issue. I'll try and let you know once a fix is ready.

ghost commented 3 years ago

@volkerd @tunix I'd like to test also and see if I can reproduce the issue. What command are you running to trigger the problem?

tunix commented 3 years ago

@igorljubuncic - I think gradle test would be enough. However, must projects has a wrapper script inside its root which may cause gradle to execute the test/build using the local gradle jar. To prevent this, you can temporarily remove the wrapper scripts.

tunix commented 3 years ago

Please try the PR and let me know if it fixes this issue. @igorljubuncic @JerryPreissler @volkerd Thanks!

tunix commented 3 years ago

@JerryPreissler @volkerd - Automated builds are now published into the candidate channel. Please test & let me know if packages in candidate channel work for you.

Install with below command if you don't have it installed:

snap install gradle --classic --candidate

Move to candidate channel:

snap refresh gradle --candidate
JerryPreissler commented 3 years ago

Works perfectly for me. Updated snap, cleared out ~/.gradle/caches and ran 'gradle test' in my project. Could see the dependencies being downloaded, so the problem seems to be fixed. I also could find the cacert file in /snap/gradle/101/usr/lib/jvm/java-11-openjdk-amd64/lib/security/ Thanks you for fixing this.