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

The "rebuild checksums" option in metadata rebuild task fails unless deployment policy allows overwrite

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.17.0
    • Fix Version/s: None
    • Component/s: Maven, Scheduled Tasks
    • Labels:

      Description

      Reproduce steps.

      1. Start with stock configuration, so the "maven-releases" hosted repository's deployment policy is "disable redeploy"
      2. Upload a pom and a pom.sha1 file to the "maven-releases" repository using curl, making sure the checksum in the pom.sha1 file is incorrect
      3. Create and run an "repair - rebuild maven metadata" task with the "rebuild checksums" option enabled against the "maven-releases" repository.

      This will fail:

      2019-07-19 13:06:17,620-0500 ERROR [quartz-3-thread-2] *SYSTEM org.sonatype.nexus.repository.maven.tasks.RebuildMaven2MetadataTask - Failed to run task 'Rebuilding Maven Metadata of maven-releases' on repository 'maven-releases'
      org.sonatype.nexus.repository.IllegalOperationException: Repository does not allow updating assets: maven-releases
      at org.sonatype.nexus.repository.storage.StorageTxImpl.maybeDeleteBlob(StorageTxImpl.java:820)
      at org.sonatype.nexus.repository.storage.StorageTxImpl.attachBlob(StorageTxImpl.java:716)
      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.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53)
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)

      If you then change the deployment policy of the repository to "allow redeploy" it will work.

      Expected: The rebuild metadata task shouldn't take into account the deployment policy of the repository, it should always work.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Peter Lynch Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title