jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-1905

Delete remote files before uploading them to avoid permission problems

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 2.0.2
  • Fix Version/s: None
  • Component/s: Artifacts and Repositories
  • Labels:
    None
  • Complexity:
    Intermediate

Description

If metadata files in server are owned by other person and not group writeable wagon doesn't try to delete them first, causing a permission denied error

org.apache.maven.lifecycle.LifecycleExecutionException: Error installing artifact's metadata: Error while deploying metadata: Exit code: 1 - pscp: unable to open /home/projects/maven/repository-staging/snapshots/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/maven-metadata.xml: permission denied

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error installing artifact's metadata: Error while deploying metadata: Exit code: 1 - pscp: unable to open /home/projects/maven/repository-staging/snapshots/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/maven-metadata.xml: permission denied

at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:143)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:414)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
... 16 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error installing artifact's metadata: Error while deploying metadata: Exit code: 1 - pscp: unable to open /home/projects/maven/repository-staging/snapshots/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/maven-metadata.xml: permission denied

at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:99)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:131)
... 18 more
Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataDeploymentException: Error while deploying metadata: Exit code: 1 - pscp: unable to open /home/projects/maven/repository-staging/snapshots/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/maven-metadata.xml: permission denied

at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:433)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:83)
... 19 more
Caused by: org.apache.maven.wagon.TransferFailedException: Exit code: 1 - pscp: unable to open /home/projects/maven/repository-staging/snapshots/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/maven-metadata.xml: permission denied

at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.executeScpCommand(ScpExternalWagon.java:294)
at org.apache.maven.wagon.providers.sshext.ScpExternalWagon.put(ScpExternalWagon.java:337)
at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:180)
at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifactMetadata(DefaultWagonManager.java:116)
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.deploy(DefaultRepositoryMetadataManager.java:429)
... 20 more

Issue Links

relates to

Improvement - An improvement or enhancement to an existing feature or task. WAGON-19 Make file upload more robust

  • Critical - Crashes, loss of data, severe memory leak.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Porter added a comment - 30/Dec/05 12:13 PM

I'm not sure about this, let's discuss a little first.

Show
Brett Porter added a comment - 30/Dec/05 12:13 PM I'm not sure about this, let's discuss a little first.
Hide
Permalink
Trygve Laugstol added a comment - 02/Jun/06 2:02 AM

Wouldn't it be best to write the files to a temporary name and the move them once the upload is complete? This is what we do when downloading files from a remote repository and would make the most sense when uploading too.

Show
Trygve Laugstol added a comment - 02/Jun/06 2:02 AM Wouldn't it be best to write the files to a temporary name and the move them once the upload is complete? This is what we do when downloading files from a remote repository and would make the most sense when uploading too.
Hide
Permalink
Carlos Sanchez added a comment - 02/Jun/06 2:14 AM

This is a problem in apache for instance where you don't want people to change the files without changing ownership. You have write permission in the directory but not in the files, so you have to delete first and then upload or move.

Seems that WAGON-19 would fit here too.

Show
Carlos Sanchez added a comment - 02/Jun/06 2:14 AM This is a problem in apache for instance where you don't want people to change the files without changing ownership. You have write permission in the directory but not in the files, so you have to delete first and then upload or move. Seems that WAGON-19 would fit here too.
Hide
Permalink
Trygve Laugstol added a comment - 02/Jun/06 2:32 AM

Ok, I understand the case better now, but deleting the files first is not a good solution as you risk messing up the repository. I know that uploading the artifact before doing a server side move gives the risk of first uploading a file and then the build fails might be annoying but I don't see a better way right now.

Show
Trygve Laugstol added a comment - 02/Jun/06 2:32 AM Ok, I understand the case better now, but deleting the files first is not a good solution as you risk messing up the repository. I know that uploading the artifact before doing a server side move gives the risk of first uploading a file and then the build fails might be annoying but I don't see a better way right now.
Hide
Permalink
Brett Porter added a comment - 17/Jul/06 12:26 AM

there's a risk that this will cause metadata to be erased and then uploading the new one will fail (which can't be rolled back). Currently, since this is done last a failure means the old version continues to be used which is not as serious.

How could we accommodate that possibility?

Show
Brett Porter added a comment - 17/Jul/06 12:26 AM there's a risk that this will cause metadata to be erased and then uploading the new one will fail (which can't be rolled back). Currently, since this is done last a failure means the old version continues to be used which is not as serious. How could we accommodate that possibility?
Hide
Permalink
Carlos Sanchez added a comment - 17/Jul/06 6:30 AM

WAGON-19 would fix this problem too. Upload to temp file, delete old, rename temp to old

Show
Carlos Sanchez added a comment - 17/Jul/06 6:30 AM WAGON-19 would fix this problem too. Upload to temp file, delete old, rename temp to old
Hide
Permalink
Jason van Zyl added a comment - 29/Dec/09 6:30 PM

Reopen if desired. It's been sitting there for two years.

Show
Jason van Zyl added a comment - 29/Dec/09 6:30 PM Reopen if desired. It's been sitting there for two years.

People

  • Assignee:
    Unassigned
    Reporter:
    Carlos Sanchez
Vote (2)
Watch (2)

Dates

  • Created:
    30/Dec/05 10:58 AM
    Updated:
    29/Dec/09 6:30 PM
    Resolved:
    29/Dec/09 6:30 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.