Azure Maven Plugin - Deployment Fails with wired error - azure-java-tools

mvn azure-functions:deploy fails with this wired error. Can you help me decipher the error.
[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.10.0:deploy (default-cli) on project function-sample-azure:
Unknown error with status code 403: Unrecognized field "evaluationDetails" (class com.microsoft.azure.PolicyViolationErrorInfo),
ot marked as ignorable (13 known properties: "policyDefinitionId", "policyDefinitionReferenceId", "policyDefinitionDisplayName", "policyAssignmentParameters",
"policyAssignmentName", "policySetDefinitionName", "policyDefinitionName", "policyAssignmentScope", "policyDefinitionEffect", "policyAssignmentId", "policySetDefinitionId",
"policySetDefinitionDisplayName", "policyAssignmentDisplayName"])
[ERROR] at [Source: (String)"{"policyDefinitionDisplayName":"STORAGE - Deny Storage account Version 1",
"policySetDefinitionDisplayName":"Storage-initiative-npd","evaluationDetails":{"evaluatedExpressions":
[{"result":"True","expressionKind":"Field","expression":"type","path":"type","expressionValue":"Microsoft.Storage/storageAccounts",
"targetValue":"Microsoft.Storage/storageAccounts","operator":"Equals"},{"result":"True","expressionKind":"Field","expression":"kind","path":"kind","expressionValue":"Storage",
"targetValue":"Sto"[truncated 911 chars]; line: 1, column: 154]
(through reference chain: com.microsoft.azure.CloudError["additionalInfo"]->java.util.ArrayList[0]->com.microsoft.azure.PolicyViolationErrorInfo["evaluationDetails"])
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.10.0:deploy
(default-cli) on project function-sample-azure: Unknown error with status code 403
Below are the properties and plugin configuration I am using. I also have an enterprise requirement to not create a new storage account with this deployment; but rather use an existing one is there are way to configure this.
<properties>
<java.version>1.8</java.version>
<functionAppName>12345600SampleFunctionApp</functionAppName>
<functionAppRegion>eastus2</functionAppRegion>
<region>eastus2</region>
<functionResourceGroup>myFunctionResourceGroup</functionResourceGroup>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<start-class>com.wi.prdc.azure.sample.function.Main</start-class>
<azure.functions.java.library.version>1.4.2</azure.functions.java.library.version>
<azure.functions.maven.plugin.version>1.10.0</azure.functions.maven.plugin.version>
<wrapper.version>1.0.23.RELEASE</wrapper.version>
<appServicePlanName>myfunctionAppServicPlan</appServicePlanName>
</properties>

thanks for raising this issue. We will bump default version to v2 in the upcoming maven plugin releases.

Related

Grails module inside maven archetype parent project not able to load grails plugins inside grails module

I have a parent maven archetype reactor project having a grails 2.4.4 project as submodule (standalone grails 2.4.4 project in process to a multimodule project), all build phases are working fine only during integration test (the grails project is using functional-test-1.2.7 grails plugin for it's integration test failsafe is not used here) it is not able to load the plugins below is the error.
[ERROR] ProjectBuildingException for org.grails.plugins:easyb:zip:2.0.5:test: Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: zip # line 6, column 14
[ERROR] ProjectBuildingException for org.grails.plugins:functional-test:zip:1.2.7:test: Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: zip # line 6, column 14
[ERROR] ProjectBuildingException for org.grails.plugins:tomcat:zip:7.0.54:test: Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: zip # line 6, column 14
It started the Integration test but after 4-5 scenarios it fails like below:
SCENARIO the login form should reject invalid credentials, such as_an empty domain
GIVEN functional testing DSL is initalized
WHEN the client accesses the login form
WHEN supplies invalid credentials, such as_an empty domain
WHEN submits the form
Clicked [Login] which resolved to a [class com.gargoylesoftware.htmlunit.html.HtmlSubmitInput]
THEN login rejects the credentials and returns the client to the login form with an error message
THEN tear down functional testing DSL
THEN enable login form
Error |
Error running easyb tests: null (Use --stacktrace to see the full trace)
The old non-module grails project is working fine, and all IT tests are getting passed in local but in case of the multimodule project it is getting failed after 4-5 scenarios (it had total 251 test scenarios)
I've made sure both of them are identical.

issue on Maven dependency in Azure pipeline

I have upgraded the log4j to 2.17 in my client machine azure pipeline, after that i am getting the error as below. Can anyone help me how to solve it.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Test_Automation: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.codehaus.plexus:plexus-container-default:jar:1.5.5 -> org.apache.xbean:xbean-reflect:jar:3.4 -> log4j:log4j:jar:1.2.12: Failed to read artifact descriptor for log4j:log4j:jar:1.2.12: Could not transfer artifact log4j:log4j:pom:1.2.12 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
Seems SSL issue you have 2 options
configure ssl
use non https url for maven repository
For second option you may use:
<repository>
<id>maven</id>
<name>maven</name>
<url>http://repo1.maven.org/maven2</url>
</repository>

SSL problems running azure-webapp-maven-plugin config

when running:
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config
I end up with
[ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config (default-cli) on project storingen-api: Max retries 0 times exceeded. Error Details: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config (default-cli) on project storingen-api: Max retries 0 times exceeded. Error Details: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Clearly this is a certificate problem that cannot be found. I have however no clue what certificate is needed nor in which keystore it needs to be. I suppose in the cacerts of my java distribution but it's not clear in any way.
Does anyone know which cert and where to put it ?
I just running into the same problem following Azure Learn Java Azure
Basically, this error ocurred because Java is trying to connect with your Azure Subscription at Azure Console. I saw the origin of this problem executing Maven command with -X. The log trace can be visualized over here, like this:
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config -X
What I did to solve:
I tried inserting Azure certifications inside Java cacerts - following the explanation here. But it didn't change or solved the problem.
I searched for a new one version of azure-webapp-maven-plugin. Nowadays, the version is 2.3.0. You can check at Maven repository the last version. It fixed my problem and no more throws the error caused by Java.
before: mvn com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config
after (I think so, that version fixes the problem): mvn com.microsoft.azure:azure-webapp-maven-plugin:2.3.0:config
Thanks

Apache Spark compile failed while installing Netty

We untar spark-0.9.0-incubating.tgz and trying to build it for use with Yarn.
SPARK_HADOOP_VERSION=2.0.0-cdh4.6.0 SPARK_YARN=true sbt/sbt assembly
...
[info] Resolving io.netty#netty-all;4.0.13.Final ...
[error] Server access Error: Connection timed out url=https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty-all/4.0.13.Final/netty-all-4.0.13.Final.pom
[error] Server access Error: Connection timed out url=https://oss.sonatype.org/service/local/staging/deploy/maven2/io/netty/netty-all/4.0.13.Final/netty-all-4.0.13.Final.pom
...
If I just cut-paste the url into a browser, I get:
404 - ItemNotFoundException
Retrieval of /io/netty/netty-all/4.0.13.Final/netty-all-4.0.13.Final.pom from M2Repository(id=snapshots) is forbidden by repository policy SNAPSHOT.
org.sonatype.nexus.proxy.ItemNotFoundException: Retrieval of /io/netty/netty-all/4.0.13.Final/netty-all-4.0.13.Final.pom from M2Repository(id=snapshots) is forbidden by repository policy SNAPSHOT.
at org.sonatype.nexus.proxy.maven.AbstractMavenRepository.doRetrieveItem(AbstractMavenRepository.java:380)
at org.sonatype.nexus.proxy.maven.maven2.M2Repository.doRetrieveItem(M2Repository.java:396)
at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:765)
at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:608)
at org.sonatype.nexus.proxy.router.DefaultRepositoryRouter.retrieveItem(DefaultRepositoryRouter.java:155)
at org.sonatype.nexus.web.content.NexusContentServlet.doGet(NexusContentServlet.java:359)
at org.sonatype.nexus.web.content.NexusContentServlet.service(NexusContentServlet.java:331)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
I have seen this reported in a number of places but no solution. Is this error because we are behind a corporate firewall, or is this due to something else? Please advise.
I had proxy set as environment variables, but it appears they are not being picked up. Adding them in sbt directly worked for me.
Edit $SPARK_HOME/sbt/sbt
For example,
EXTRA_ARGS="-Dhttp.proxySet=true -Dhttp.proxyHost=myproxy.mycompany.com -Dhttp.proxyPort=80 -Dhttps.proxySet=true -Dhttps.proxyHost=myproxy.mycompany.com -Dhttps.proxyPort=80 -Dftp.proxySet=true -Dftp.proxyHost=myproxy.mycompany.com -Dftp.proxyPort=80 -Dhttp.nonProxyHosts=mydomain -Dhttps.nonProxyHosts=mydomain -Dftp.nonProxyHosts=mydomain"

cannot invoke tomcat manager:network unreachable

i am using maven to deploy in tomcat 6
url is http://localhst:8080/manager
the error is shown below i ma usisng eclipse
Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project strutsandhibernte: Cannot invoke Tomcat manager: Network is unreachable: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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
Try
http://localhost:8080/manager/html

Resources