azure-maven-plugins
azure-maven-plugins copied to clipboard
Error SSL handshake Deploying war file to server
Plugin name and version
<version.maven.azure.plugin>1.8.0</version.maven.azure.plugin>
Plugin configuration in your pom.xml
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>${version.maven.azure.plugin}</version>
<configuration>
<subscriptionId>xxx</subscriptionId> #need this in order for correct subscriptionid to be used
<resourceGroup>wildfly-rg</resourceGroup>
<appName>test-wildfly</appName>
<linuxRuntime>wildfly 14-jre8</linuxRuntime>
<deployment>
<resources/>
</deployment>
</configuration>
</plugin>
Expected behavior
Running into error running mvn azure-webapp:deploy -X
[DEBUG] Exception occurred when deploying war file to server: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, retrying immediately (3/3)
Have googled around and added the certificate from https://portal.azure.com/#home
to $JAVA_HOME/lib/security/cacerts
but still seeing the error. ( Is this the correct server domain the cert should be exported from?)
Any help would be great, thanks.
I had the same problem when I was trying to deploy to a self signed certificate https://xxxx.scm.apps.eda-azure.internal because the java that uses maven does not trust it. I had to include my certificate in java's trusted in order to be able to deploy it.
@willyyang @alam-R Thanks for your report, will looking into this issue soon.
has the issue been resolved?
@ramkumargopal Sorry for the late response, we are still working on this issue.
@Flanker32 Any update on this issue? I am also facing this issue while deploying azure-functions. @alam-R Would you be able to share details/steps for an alternate temporary fix for this issue? Thanks!
@krishnagaur Thanks for your report and sorry that we hadn't reproduced this issue successfully, could you please share some more infos like the error stack? Thanks!
@Flanker32 Please find details below :
java version "1.8.0_181" node v12.16.3 dotnet-sdk 3.1.300 azure-functions-core-tools 3.0.2534 azure-functions-maven-plugin 1.4.1 azure.functions.java.library.version 1.3.1 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
ERROR STACK - mvn azure-functions:deploy -X
[INFO] Trying to deploy artifact to krishna-functions-20200525123929133... [DEBUG] Exception occurred when deploying the zip package: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, retrying immediately (1/3) ....... [ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.4.1:deploy (default-cli) on project krishna-functions: The zip deploy failed after 3 times of retry. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.4.1:deploy (default-cli) on project krishna-functions: The zip deploy failed after 3 times of retry. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.MojoExecutionException: The zip deploy failed after 3 times of retry. at com.microsoft.azure.maven.AbstractAzureMojo.handleException (AbstractAzureMojo.java:505) at com.microsoft.azure.maven.AbstractAzureMojo.execute (AbstractAzureMojo.java:439) at com.microsoft.azure.maven.function.AbstractFunctionMojo.execute (AbstractFunctionMojo.java:166) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: com.microsoft.azure.common.exceptions.AzureExecutionException: The zip deploy failed after 3 times of retry. at com.microsoft.azure.common.handlers.artifact.ZIPArtifactHandlerImpl.publish (ZIPArtifactHandlerImpl.java:60) at com.microsoft.azure.common.function.handlers.artifact.RunFromZipArtifactHandlerImpl.publish (RunFromZipArtifactHandlerImpl.java:38) at com.microsoft.azure.maven.function.DeployMojo.doExecute (DeployMojo.java:94) at com.microsoft.azure.maven.AbstractAzureMojo.execute (AbstractAzureMojo.java:434) at com.microsoft.azure.maven.function.AbstractFunctionMojo.execute (AbstractFunctionMojo.java:166) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@krishnagaur Thanks a lot for your information, the issue occurs in the kudo deployment step, could you please try another <deploymentType>
like RUN_FROM_BLOB
? you may get all the supported values here
@Flanker32 Thanks for your input. I have tried with <deploymentType> like RUN_FROM_BLOB. It is working fine. I am able to successfully deploy the azure function. As per documentation, the default deployment type is RUN_FROM_ZIP for windows. Any specific error root cause for earlier and impact of respective change. Thanks!
Regarding the zip have you tried to import the cert to the java that maven uses? eg. Import the root certificate into the JVM trust store keytool -importcert -alias api -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file [yourowncertificate] (probably you have to configure the jre that is used by maven, check with mvn -version) (changeit is the default password) Also we use azure-webapp-maven-plugin v1.6.0 because some later releases eg. v1.8.0 had an issue with app service plan (https://github.com/microsoft/azure-maven-plugins/issues/927)
@alam-R Thanks a lot for your help, and we have fixed the issue #927 in later release and the latest version is v1.9.1, you may get the release notes here
@Flanker32 Thanks for your input. I have tried with like RUN_FROM_BLOB. It is working fine. I am able to successfully deploy the azure function. As per documentation, the default deployment type is RUN_FROM_ZIP for windows. Any specific error root cause for earlier and impact of respective change. Thanks!
RUN_FROM_ZIP is the recommend deployment by function service team, which is more efficiency. For this issue, did you change the SSL settings for your app?
I'm having the same issue after running the config
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.579 s [INFO] Finished at: 2021-05-10T13:11:09+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config (default-cli) on project storingen-api: java.io.IOException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1] [ERROR]
Adding extra logging does not offer much help because the stacktrace doesn't provide information towards which SSL path he tries to go. The big problem is that I have no clue which SSL certificate he is looking for ?
Hey @Flanker32, Any update on this issue? We are experiencing same trouble right now with maven plugin to deploy azure functions. It manages to deploy service plan and even Function App, however fails to deploy functions itself to this Function App.
plugin: com.microsoft.azure :: azure-functions-maven-plugin :: 1.13.0 java: 11 platform: windows service plan: EP1
[INFO] Trying to deploy artifact to <application-name>...
[DEBUG] [Error Resume] Try count: 0, Error: {}
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target