Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7980

artifact deployment runs shell commands without proper quoting

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: core
    • Labels:
      None
    • Environment:
      debian lenny, maven 2.2.1 installed from apache by hudson
    • Similar Issues:

      Description

      (filing under 'core' since there are a gazillion components under the hudson project and I don't know which one to pick)

      Trying to use the hudson 'deploy artifact to repository' feature, it failed like this (OURGROUP substituted for real group id):

      ERROR: Error deploying artifact: Exit code: 1 - /bin/sh: line 0: cd: /var/lib/hudson/jobs/java-base/modules/OURGROUP-base/builds/2010-11-02_12-49-03/archive/OURGROUP/java-base/1.0-SNAPSHOT: No such file or directory

      Notice that the real path is ".../OURGROUP$java-base....", but the $java is being expanded by the shell to the empty string. Something, whether Hudson or Maven, is incorrectly generating shell commands with improper quoting. (I tried with Maven 3.0 but that broke for unrelated reasons, so I have no idea whose fault it is right now.)

      I turned off the feature and configure 'clean deploy' as build goals instead, to get around this.

      The stack trace is as followed:

      at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:94)
      at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119)
      at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79)
      at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:118)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:651)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
      at hudson.model.Run.run(Run.java:1348)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:349)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:139)

        Attachments

          Issue Links

            Activity

            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            I think you omitted the crucial part of the stack trace that starts by "Caused by"

            Please attach the complete stack trace so that we can look into it.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - I think you omitted the crucial part of the stack trace that starts by "Caused by" Please attach the complete stack trace so that we can look into it.
            Hide
            scode scode added a comment -

            Sorry about that. I was finally able to go back and trigger it again to get a new trace. It appears below, with groupid/artifactid censored out.

            Again, the problem is the use of '$' in the local filename so that the path com.group$our-artifact is interpreted by the shell so that, in that example, the value of $our is substituted.

            org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error deploying artifact: Exit code: 1 - /bin/sh: line 0: cd: /var/lib/hudson/jobs/JOB/modules/GROUPID-BROKEN_ARTIFACTID/builds/2010-12-15_15-42-12/archive/GROUPID/ARTIFACTID/1.0-SNAPSHOT: No such file or directory

            at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:94)
            at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119)
            at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79)
            at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:214)
            at hudson.model.TaskThread.run(TaskThread.java:126)
            Caused by: org.apache.maven.wagon.TransferFailedException: Exit code: 1 - /bin/sh: line 0: cd: /var/lib/hudson/jobs/JOBS/modules/GROUPID-BROKENARTIFACTID/builds/2010-12-15_15-42-12/archive/GROUPID/ARTIFACTID/1.0-SNAPSHOT: No such file or directory

            at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:236)
            at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.put(ScpExternalWagon.java:295)
            at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:244)
            at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:160)
            at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80)
            ... 4 more

            Show
            scode scode added a comment - Sorry about that. I was finally able to go back and trigger it again to get a new trace. It appears below, with groupid/artifactid censored out. Again, the problem is the use of '$' in the local filename so that the path com.group$our-artifact is interpreted by the shell so that, in that example, the value of $our is substituted. org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error deploying artifact: Exit code: 1 - /bin/sh: line 0: cd: /var/lib/hudson/jobs/JOB/modules/GROUPID-BROKEN_ARTIFACTID/builds/2010-12-15_15-42-12/archive/GROUPID/ARTIFACTID/1.0-SNAPSHOT: No such file or directory at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:94) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:214) at hudson.model.TaskThread.run(TaskThread.java:126) Caused by: org.apache.maven.wagon.TransferFailedException: Exit code: 1 - /bin/sh: line 0: cd: /var/lib/hudson/jobs/JOBS/modules/GROUPID-BROKENARTIFACTID/builds/2010-12-15_15-42-12/archive/GROUPID/ARTIFACTID/1.0-SNAPSHOT: No such file or directory at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:236) at org.apache.maven.wagon.providers.ssh.external.ScpExternalWagon.put(ScpExternalWagon.java:295) at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:244) at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:160) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80) ... 4 more
            Hide
            evernat evernat added a comment -

            This is a duplicate of JENKINS-4861

            Show
            evernat evernat added a comment - This is a duplicate of JENKINS-4861

              People

              • Assignee:
                Unassigned
                Reporter:
                scode scode
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: