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

maven plugin not using maven proxy settings #8

Open
mikeliu89 opened this issue Nov 8, 2018 · 15 comments
Open

maven plugin not using maven proxy settings #8

mikeliu89 opened this issue Nov 8, 2018 · 15 comments
Assignees
Labels

Comments

@mikeliu89
Copy link

Here is the error:

....................
[DEBUG] File is mule-application
[DEBUG] Searching for org LID
[DEBUG] HTTP GET /accounts/api/me
[DEBUG] HTTP POST /accounts/login data={password==, username=}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:25 min
[INFO] Finished at: 2018-11-07T08:47:37-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.kloudtek.anypoint-tools:anypoint-maven-plugin:0.9.37:hdeploy (deploy-arm) on project hello-world-ping-api: null: MojoExecutionException: RuntimeIOException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.kloudtek.anypoint-tools:anypoint-maven-plugin:0.9.37:hdeploy (deploy-arm) on project hello-world-ping-api: null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
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:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException
at com.kloudtek.anypoint.AbstractDeployMojo.execute (AbstractDeployMojo.java:125)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
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:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: com.kloudtek.anypoint.util.HttpHelper$RuntimeIOException
at com.kloudtek.anypoint.util.HttpHelper.doExecute (HttpHelper.java:229)
at com.kloudtek.anypoint.util.HttpHelper.executeWrapper (HttpHelper.java:183)
at com.kloudtek.anypoint.util.HttpHelper.executeWrapper (HttpHelper.java:171)
at com.kloudtek.anypoint.util.HttpHelper.execute (HttpHelper.java:157)
at com.kloudtek.anypoint.util.HttpHelper.httpPost (HttpHelper.java:101)
at com.kloudtek.anypoint.AnypointClient.authenticate (AnypointClient.java:187)
at com.kloudtek.anypoint.util.HttpHelper.executeWrapper (HttpHelper.java:177)
at com.kloudtek.anypoint.util.HttpHelper.executeWrapper (HttpHelper.java:171)
at com.kloudtek.anypoint.util.HttpHelper.httpGet (HttpHelper.java:68)
at com.kloudtek.anypoint.AnypointClient.findOrganizations (AnypointClient.java:110)
at com.kloudtek.anypoint.AnypointClient.findOrganization (AnypointClient.java:120)
at com.kloudtek.anypoint.AbstractDeployMojo.execute (AbstractDeployMojo.java:111)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
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:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[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

@ymenager
Copy link
Contributor

ymenager commented Nov 8, 2018

can you include your POM (make sure to remove sensitive details like password, org ids, etc)

@ymenager
Copy link
Contributor

ymenager commented Nov 9, 2018

Well in any case it probably needs some better error handling in that spot... I'll add that

@ymenager
Copy link
Contributor

ymenager commented Nov 9, 2018

ok, that error means the username or the password weren't set... set properties "anypoint.username" and "anypoint.password", or include them in the config as in the example:

<plugin>
    <groupId>com.kloudtek.anypoint-tools</groupId>
    <version>1.0-SNAPSHOT</version>
    <artifactId>anypoint-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>hdeploy</id>
            <phase>deploy</phase>
            <goals>
                <goal>hdeploy</goal>
            </goals>
            <configuration>
                <username>[anypointusername]</username>
                <password>[anypointpassword]</password>
                <org>[orgname]</org>
                <env>[envname]</env>
                <target>[target name, can be either cluster name, server group name or server name]</target>
            </configuration>
        </execution>
    </executions>
</plugin>

@ymenager
Copy link
Contributor

ymenager commented Nov 9, 2018

I've added extra validation to give better errors if username/password missing

@ymenager ymenager closed this as completed Nov 9, 2018
@mikeliu89
Copy link
Author

hi, username and password is there, I just blank them out when I posted it here

@mikeliu89
Copy link
Author

I tried to use postman calling both https://anypoint.mulesoft.com/hybrid/api/v1/accounts/login and https://anypoint.mulesoft.com/accounts/login with headers below:
X-ANYPNT-ORG-ID:
X-ANYPNT-ENV-ID:
Content-Type:application/json
Accept:application/json
Authorization:

and the POST body of:
{"username":"[]","password":"[]"}

And I got HTTP 401 code (unauthorized)

@mikeliu89
Copy link
Author

I removed the org id and env id as well as usename and password in the above comment

@mikeliu89
Copy link
Author

And I removed the Bearer token in the above comment for security reason, but these data all there when I sent the post requests, but got 401 code

@ymenager ymenager removed the bug label Nov 9, 2018
@mikeliu89
Copy link
Author

could it be the proxy issue since out Mule server is in DMZ and I'm run the deployment and postman inside of corp net. But this is actually calling the API in the Anypoint cloud, right?

@ymenager
Copy link
Contributor

ymenager commented Nov 9, 2018

@mikeliu89 In your stacktrace it seems you're using the maven plugin right ? So I'm going to need to see the pom.xml you're using to ascertain what the issue is.

From what the logs say it does seem to be a missing username/password value thou

@ymenager ymenager reopened this Nov 9, 2018
@mikeliu89
Copy link
Author

I provided the usename and password in the mvn deploy command line

@mikeliu89
Copy link
Author

If you can do GoToMeeting or WebEx, I can show you all the details

@mikeliu89
Copy link
Author

By the way, we are doing on-prem Mule API deployment

@mikeliu89
Copy link
Author

I just run the command on a guest network (bypass proxy) and got the same 401 (unauthorized) when calling the /accounts/login api

@kloudtek kloudtek deleted a comment from mikeliu89 Nov 10, 2018
@ymenager
Copy link
Contributor

ok i think this is caused by having to use a proxy, and I'm not reusing the proxy settings from settings.xml, so that's a bug need to fix.

@ymenager ymenager added the bug label Nov 12, 2018
@ymenager ymenager self-assigned this Nov 12, 2018
@ymenager ymenager changed the title accounts login api calling failed during the mvn deployment command execution maven plugin not using maven proxy settings Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants