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

HTTP error status code not logged on proxy repository automatic blocking

Details

    • n/a

    Description

      When certain valid and well known HTTP response codes are returned from a remote, they may end up Automatically blocking a proxy repository. Example nexus.log messages look like this:

      2021-02-25 05:17:52,430-0800 INFO [qtp1606288645-338023] *UNKNOWN org.sonatype.nexus.repository.httpclient.internal.HttpClientFacetImpl - Repository status for docker-registry changed from AVAILABLE to AUTO_BLOCKED_UNAVAILABLE until 2021-02-25T05:18:32.430-08:00 - reason Unrecognized HTTP error for https://registry-1.docker.io

      The problem is the actual HTTP response code is not logged there, only a static message "Unrecognized HTTP error" in place of a not present description of the status code.

      The problem code generating the message does this:

        private String getReason(final int statusCode) {
          String reason = EnglishReasonPhraseCatalog.INSTANCE.getReason(statusCode, ENGLISH);
          return reason == null ? "Unrecognized HTTP error" : reason;
        }
      

      Expected

      Always include the HTTP status code as part of the "reason" logged. That way we at least have a clue of the type of response being returned from the remote.

      Attachments

        Activity

          People

            mkalachov Maksym Kalachov [X] (Inactive)
            plynch Peter Lynch
            Igor Udovika Igor Udovika
            NXRM - Rocket Raccoon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              tigCommentSecurity.panel-title