crowdin / crowdin-cli

A command-line client for the Crowdin API
https://crowdin.github.io/crowdin-cli
MIT License
245 stars 92 forks source link

Failure while installing via Yarn on Heroku #431

Closed webdevian closed 2 years ago

webdevian commented 2 years ago

Describe the bug Intermittently we get this error when the package is installed via Yarn. It fails 10-20% of the time and we've only seen it appear in the last few days. It breaks the build and we have to deploy again.

Exception in thread "main" java.lang.NoClassDefFoundError: javax/crypto/SecretKey
    at sun.security.util.KeyUtil.getKeySize(KeyUtil.java:76)
    at sun.security.util.DisabledAlgorithmConstraints$KeySizeConstraint.permitsImpl(DisabledAlgorithmConstraints.java:551)
    at sun.security.util.DisabledAlgorithmConstraints$KeySizeConstraint.permits(DisabledAlgorithmConstraints.java:542)
    at sun.security.util.DisabledAlgorithmConstraints$Constraints.permits(DisabledAlgorithmConstraints.java:332)
    at sun.security.util.DisabledAlgorithmConstraints.checkConstraints(DisabledAlgorithmConstraints.java:185)
    at sun.security.util.DisabledAlgorithmConstraints.permits(DisabledAlgorithmConstraints.java:113)
    at sun.security.pkcs.SignerInfo.verify(SignerInfo.java:401)
    at sun.security.pkcs.PKCS7.verify(PKCS7.java:579)
    at sun.security.pkcs.PKCS7.verify(PKCS7.java:596)
    at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:292)
    at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:268)
    at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
    at java.util.jar.JarVerifier.update(JarVerifier.java:228)
    at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
    at java.util.jar.JarFile.getInputStream(JarFile.java:450)
    at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:977)
    at sun.misc.Resource.cachedInputStream(Resource.java:77)
    at sun.misc.Resource.getByteBuffer(Resource.java:160)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:454)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:215)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
    at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
    at sun.security.jca.ProviderList.getProvider(ProviderList.java:233)
    at sun.security.jca.ProviderList.getService(ProviderList.java:331)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
    at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
    at org.apache.http.ssl.SSLContexts.createDefault(SSLContexts.java:51)
    at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:977)
    at com.crowdin.client.core.http.impl.http.ApacheHttpClient.<init>(ApacheHttpClient.java:72)
    at com.crowdin.client.core.CrowdinApi.<init>(CrowdinApi.java:36)
    at com.crowdin.client.Client.<init>(Client.java:89)
    at com.crowdin.cli.client.Clients.prepareClient(Clients.java:76)
    at com.crowdin.cli.client.Clients.getProjectClient(Clients.java:34)
    at com.crowdin.cli.commands.picocli.ActCommandWithFiles.getClient(ActCommandWithFiles.java:30)
    at com.crowdin.cli.commands.picocli.ActCommandWithFiles.getClient(ActCommandWithFiles.java:11)
    at com.crowdin.cli.commands.picocli.GenericActCommand.run(GenericActCommand.java:36)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    at picocli.CommandLine.execute(CommandLine.java:2078)
    at com.crowdin.cli.commands.picocli.PicocliRunner.execute(PicocliRunner.java:37)
    at com.crowdin.cli.Cli.main(Cli.java:16)
error Command failed with exit code 1.

To Reproduce In package.json "@crowdin/cli": "^3.7.7",

Config File

"project_id": "**********"
"api_token": "*************"
"base_path": "."
"base_url": "https://api.crowdin.com" 

"preserve_hierarchy": true

"files": [
  {
    "source" : "lang/en.json",
    "translation" : "lang/%locale%.json"
  }
]

Expected behavior Expect it to install without error, like it does most of the time

Environment: Region - United States Stack - heroku-20 Framework - Node.js

andrii-bodnar commented 2 years ago

Hi @webdevian!

Probably, it's something that is not related to the CLI and somehow related to JRE. Please check this thread - it looks like it's the same issue.

webdevian commented 2 years ago

Thanks for the quick response. We get JRE installed through crowdin-cli via https://github.com/nvuillam/njre so I don't think we can choose a specific PATH.

It seems to be downloading the same version or JRE whether it works or not (https://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jre-8u131-linux-x64.tar.gz). Am I better off looking for help at Heroku or from the njre package maintainers

andrii-bodnar commented 2 years ago

@webdevian recently we have updated the jDeploy version used to create the NPM package but have not yet deployed this change as there are no other features to deploy. The new version of jDeploy is using AdoptOpenJDK JRE instead of Oracle JRE. Maybe it should work ok in your case after releasing a new version of CLI.

Marche86 commented 2 years ago

Hello, I have the same problem running it with Bitbucket pipelines. Please, release a new versión.