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

REST API to create a repository does not always log failures

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.38.1
    • Fix Version/s: None
    • Component/s: Maven, Repository, REST
    • Labels:
    • Notability:
      3

      Description

      Run the= "POST /service/rest/v1/repositories/maven/group" API, and when running it, specify the group ID of a repository that already exists.

      This will return an HTTP 400 response as expected with this error sent back to the requestor:

      "Cannot index record #61:1: found duplicated key 'test' in index 'repository_repository_name_idx' previously assigned to the record #59:1
       DB name="config""
      

      However, the nexus.log file will not show anything:

      2022-06-20 12:36:35,461-0500 INFO [qtp921467611-126] admin org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Creating repository in memory: test -> OrientConfiguration{repositoryName='test', recipeName='maven2-group', attributes=

      Unknown macro: {storage= Unknown macro}

      , group=
      Unknown macro: {memberNames=[maven-releases]}
      }}

      Expected: If repository creation through REST API fails, the reason for the failure should always be logged in the nexus.log such that it is visible with default logging levels.

      Expected 2: We should be checking for duplicate repositories when creating them and returning a reasonable error message. We should not be depending on database integrity constraints to catch such a common error.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:

                  tigCommentSecurity.panel-title