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

file content validation fails for application/x-msdownload jar files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10
    • Fix Version/s: 2.11, 3.0.0-m3
    • Component/s: Repository
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      Sprint 29

      Description

      Create a Maven 2 release proxy repo to https://maven.atlassian.com/content/groups/public/
      Set file content validation to true.

      Request http://localhost:8081/nexus/content/repositories/atlassian/com/atlassian/support/healthcheck/support-healthcheck-plugin/1.0.3/support-healthcheck-plugin-1.0.3.jar

      This returns 404. The reason is content validation fails.

      jvm 1    | 2014-10-22 09:26:43,113-0300 DEBUG [qtp1935993203-108] admin remote.storage.outbound - [atlassian] GET https://maven.atlassian.com/content/groups/public/com/atlassian/support/healthcheck/support-healthcheck-plugin/1.0.3/support-healthcheck-plugin-1.0.3.jar - 245.3 ms
      jvm 1    | 2014-10-22 09:26:43,192-0300 INFO  [qtp1935993203-108] admin org.sonatype.nexus.proxy.maven.MavenFileTypeValidator - StorageFileItem atlassian:/com/atlassian/support/healthcheck/support-healthcheck-plugin/1.0.3/support-healthcheck-plugin-1.0.3.jar MIME-magic validation failed: expected MIME types: [application/java-archive], detected MIME types: [application/x-msdownload, application/x-msdownload, application/octet-stream]
      jvm 1    | 2014-10-22 09:26:43,192-0300 INFO  [qtp1935993203-108] admin org.sonatype.nexus.proxy.repository.validator.DefaultFileTypeValidatorHub - File item atlassian:/com/atlassian/support/healthcheck/support-healthcheck-plugin/1.0.3/support-healthcheck-plugin-1.0.3.jar evaluated as INVALID during file type validation (validator=maven)
      jvm 1    | 2014-10-22 09:26:43,193-0300 INFO  [qtp1935993203-108] admin org.sonatype.nexus.proxy.maven.maven2.M2Repository - Proxied item atlassian:/com/atlassian/support/healthcheck/support-healthcheck-plugin/1.0.3/support-healthcheck-plugin-1.0.3.jar evaluated as INVALID during content validation (validator=filetypevalidator, sourceUrl=https://maven.atlassian.com/content/groups/public/com/atlassian/support/healthcheck/support-healthcheck-plugin/1.0.3/support-healthcheck-plugin-1.0.3.jar)
      

      Turns out this jar is correctly parsed by Apache Tika ( MIME lib Nexus uses ) as application/x-msdownload.

      https://github.com/apache/tika/blob/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml#L3039

      Nexus thinks this should be application/java-archive

      Expected:

      • Nexus should treat this jar as the proper expected type and not fail content validation.

      Perhaps similar fix as we did in NEXUS-6271 for empty zip

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alin Alin Dreghiciu
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Peter Lynch Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title