Error while deploying mule appliction in RTF runtime 3.9.1

660 Views Asked by At

I am currently creating ci/cd for RTF deployments. Now I managed to make it for Mule runtim 4.x only for runtime 3.9.1 things are a little different. For example, another mule maven version is used, namely; 2.3.2 this does not work via connectedAPP but only with the old method username and password. However, during deployment I get the connection time out error.

I found an article from mulesoft which indicates that there is probably network/infrastructure issue but this can't be right, because mule runtime 4.x works just fine.

My pom.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test.mulesoft</groupId>
    <artifactId>hello-test-project</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>mule</packaging>
    <name>hello-test-project</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <mule.version>3.9.1-20220127</mule.version>
        <mule.tools.version>1.7</mule.tools.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/app/</directory>
                                </resource>
                                <resource>
                                    <directory>src/main/api/</directory>
                                </resource>
                                <resource>
                                    <directory>mappings/</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>2.3.2</version>
                <extensions>true</extensions>
                <configuration>
                    <runtimeFabricDeployment>
                        <uri>https://eu1.anypoint.mulesoft.com</uri>
                        <muleVersion>3.9.1</muleVersion>
                        <username>xxxxxx</username>
                        <password>xxxxxx</password>
                        <applicationName>hello-test-project</applicationName>
                        <environment>DEV</environment>
                        <target>RTF</target>
                        <provider>MC</provider>
                        <deploymentSettings>
                            <memoryReserved>100Mi</memoryReserved>
                        </deploymentSettings>
                    </runtimeFabricDeployment>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-app-maven-plugin</artifactId>
                <version>${mule.tools.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <copyToAppsDirectory>true</copyToAppsDirectory>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <!-- Mule Dependencies -->
    <dependencies>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb.modules</groupId>
            <artifactId>mule-module-spring-config-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Transports -->
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-file</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jdbc-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jms-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-vm</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Modules -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-scripting</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-xml</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-spring-config</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>Central</id>
            <name>Central</name>
            <url>http://repo1.maven.org/maven2/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>

    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mule-public</id>
            <url>https://repository.mulesoft.org/nexus/content/repositories/releases</url>
        </pluginRepository>
        <pluginRepository>
            <id>mulesoft-release</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>http://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

Error:

[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:2.3.2:deploy (deploy) on project hello-test-project-391: Execution deploy of goal org.mule.tools.maven:mule-maven-plugin:2.3.2:deploy failed: java.net.ConnectException: Connection timed out (Connection timed out) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mule.tools.maven:mule-maven-plugin:2.3.2:deploy (deploy) on project hello-test-project-391: Execution deploy of goal org.mule.tools.maven:mule-maven-plugin:2.3.2:deploy failed: java.net.ConnectException: Connection timed out (Connection timed out)
    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:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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.PluginExecutionException: Execution deploy of goal org.mule.tools.maven:mule-maven-plugin:2.3.2:deploy failed: java.net.ConnectException: Connection timed out (Connection timed out)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    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:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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: javax.ws.rs.ProcessingException: java.net.ConnectException: Connection timed out (Connection timed out)
    at org.glassfish.jersey.client.internal.HttpUrlConnector.apply (HttpUrlConnector.java:287)
    at org.glassfish.jersey.client.ClientRuntime.invoke (ClientRuntime.java:252)
    at org.glassfish.jersey.client.JerseyInvocation$1.call (JerseyInvocation.java:684)
    at org.glassfish.jersey.client.JerseyInvocation$1.call (JerseyInvocation.java:681)
    at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process (Errors.java:228)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope (RequestScope.java:444)
    at org.glassfish.jersey.client.JerseyInvocation.invoke (JerseyInvocation.java:681)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.method (JerseyInvocation.java:437)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.post (JerseyInvocation.java:343)
    at org.mule.tools.client.core.AbstractClient.post (AbstractClient.java:55)
    at org.mule.tools.client.authentication.AuthenticationServiceClient.login (AuthenticationServiceClient.java:111)
    at org.mule.tools.client.authentication.AuthenticationServiceClient.getBearerToken (AuthenticationServiceClient.java:71)
    at org.mule.tools.client.AbstractMuleClient.getBearerToken (AbstractMuleClient.java:303)
    at org.mule.tools.client.AbstractMuleClient.init (AbstractMuleClient.java:79)
    at org.mule.tools.client.core.AbstractClient.initialize (AbstractClient.java:104)
    at org.mule.tools.client.fabric.RuntimeFabricClient.getAgentsPath (RuntimeFabricClient.java:113)
    at org.mule.tools.client.fabric.RuntimeFabricClient.getTargets (RuntimeFabricClient.java:118)
    at org.mule.tools.deployment.fabric.RequestBuilder.resolveTargetId (RequestBuilder.java:121)
    at org.mule.tools.deployment.fabric.RequestBuilder.buildTarget (RequestBuilder.java:70)
    at org.mule.tools.deployment.fabric.RequestBuilder.buildDeploymentRequest (RequestBuilder.java:45)
    at org.mule.tools.deployment.fabric.RuntimeFabricArtifactDeployer.deployApplication (RuntimeFabricArtifactDeployer.java:56)
    at org.mule.tools.deployment.fabric.RuntimeFabricApplicationDeployer.deploy (RuntimeFabricApplicationDeployer.java:36)
    at org.mule.tools.deployment.DefaultDeployer.deploy (DefaultDeployer.java:50)
    at org.mule.tools.maven.mojo.deploy.DeployMojo.doExecute (DeployMojo.java:37)
    at org.mule.tools.maven.mojo.deploy.AbstractMuleDeployerMojo.execute (AbstractMuleDeployerMojo.java:85)
    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:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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)
    
     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/PluginExecutionException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
1

There are 1 best solutions below

3
On

Mule 3 and Mule 4 are not compatible. They require different versions of the Mule Maven Plugin. You are not even using the last available version of the Mule Maven Plugin 2.x (at this time) that contains some fixes for Runtime Fabric deployments. Note that you would need to rename memoryReserved for the newer version. It is strongly recommended to use the latest available release of the version compatible with your deployment target.

The error is happening when the plugin tried to authenticate according to the stack trace you shared. Also you mentioned using a connected app to deploy to Mule 4. The Mule Maven Plugin 2.x (for Mule 3.x) doesn't support connected apps. If you are using a user and password, you need to be sure it is excluded from multi factor authentication (MFA) restrictions. Otherwise it is not going to be able to login in a non-interactive way, which is what you need for a Maven deployment. A time out at authentication with the platform suggest this could be the cause of the error.

It would be also recommended to use the last release of Mule 3 (3.9.5) to include all possible bug fixes for known issues, though that is not related to your issue. Mule 3.9.1 was released in 2018.