Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-10234

Maven httpclient may receive SocketException Broken pipe instead of expected status code on deploy

    Details

    • Story Points:
      1
    • Sprint:
      Sprint 83, Sprint 84

      Description

      Using the standard mvn deploy:deploy-file to a Nexus 3 maven repository, *when a server section with matching id in ~/.m2/settings.xml is not configured properly*, then Maven throws a broken pipe exception instead of reporting the 401 unauthorized from Nexus. This causes a retry death spiral and changes the behaviour of how Maven would normally react.

      Using the same scenario with Nexus 2 causes Maven to report the 401 as expected and stop immediately.

      Nexus 3
      [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@45ee12a7]
      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
      [DEBUG]   (f) artifactId = project
      [DEBUG]   (f) file = /app/clm-testing/jenkins/hudson-2.2.1.war
      [DEBUG]   (f) generatePom = true
      [DEBUG]   (f) groupId = com.somecompany
      [DEBUG]   (s) localRepository =       id: local
            url: file:///Volumes/OSX/m2r/
         layout: default
      snapshots: [enabled => true, update => always]
       releases: [enabled => true, update => always]
      
      [DEBUG]   (f) offline = false
      [DEBUG]   (f) packaging = war
      [DEBUG]   (f) project = MavenProject: org.apache.maven:standalone-pom:1 @ 
      [DEBUG]   (f) repositoryId = local-nexu
      [DEBUG]   (f) repositoryLayout = default
      [DEBUG]   (f) retryFailedDeploymentCount = 1
      [DEBUG]   (f) uniqueVersion = true
      [DEBUG]   (f) updateReleaseInfo = false
      [DEBUG]   (f) url = http://localhost:9081/repository/maven-releases/
      [DEBUG]   (f) version = 1.0.0
      [DEBUG] -- end configuration --
      [DEBUG] Using transporter WagonTransporter with priority -1.0 for http://localhost:9081/repository/maven-releases/
      [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://localhost:9081/repository/maven-releases/ via 127.0.0.1:8888
      Uploading: http://localhost:9081/repository/maven-releases/com/somecompany/project/1.0.0/project-1.0.0.war
      May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
      INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://127.0.0.1:8888->http://localhost:9081: Broken pipe
      May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
      INFO: Retrying request to {}->http://127.0.0.1:8888->http://localhost:9081
      May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
      INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://127.0.0.1:8888->http://localhost:9081: Broken pipe
      May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
      INFO: Retrying request to {}->http://127.0.0.1:8888->http://localhost:9081
      May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
      INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://127.0.0.1:8888->http://localhost:9081: Broken pipe
      May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
      INFO: Retrying request to {}->http://127.0.0.1:8888->http://localhost:9081
      Uploading: http://localhost:9081/repository/maven-releases/com/somecompany/project/1.0.0/project-1.0.0.pom
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 0.628 s
      [INFO] Finished at: 2016-05-16T10:14:55-03:00
      [INFO] Final Memory: 12M/309M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      	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: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe
      	at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:284)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      	... 20 more
      Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe
      	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
      	at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171)
      	at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:280)
      	... 22 more
      Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe
      	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317)
      	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
      	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
      	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
      	... 24 more
      Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe
      	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
      	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
      	... 27 more
      Caused by: org.apache.maven.wagon.TransferFailedException: Broken pipe
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:646)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497)
      	at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
      	at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
      	at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
      	... 29 more
      Caused by: java.net.SocketException: Broken pipe
      	at java.net.SocketOutputStream.socketWrite0(Native Method)
      	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
      	at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:123)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:135)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:164)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon$RequestEntityImplementation.writeTo(AbstractHttpClientWagon.java:205)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:155)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:149)
      	at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:236)
      	at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:254)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:86)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
      	at org.apache.maven.wagon.providers.http.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:832)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:592)
      	... 38 more
      [ERROR] 
      [ERROR] 
      
      Nexus 2
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1.229 s
      [INFO] Finished at: 2016-05-16T10:19:45-03:00
      [INFO] Final Memory: 9M/309M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      	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: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
      	at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:284)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      	... 20 more
      Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
      	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
      	at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171)
      	at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:280)
      	... 22 more
      Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
      	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317)
      	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
      	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
      	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
      	... 24 more
      Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
      	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
      	at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
      	... 27 more
      Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:627)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517)
      	at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497)
      	at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
      	at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
      	at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
      	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
      	... 29 more
      [ERROR] 
      [ERROR] 
      
      
      

      Expected

      Nexus should report the 401 and fail immediately instead of getting a broken pipe - act like Nexus 2.x does.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jtom Joe Tom
                Reporter:
                plynch Peter Lynch
                Last Updated By:
                Peter Lynch
              • Votes:
                2 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: