org.sonatype.nexus.repository.InvalidContentException: Detected content type [text/plain], but expected [application/x-gzip, application/gzip, application/x-tgz, application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip-compressed, gzip/document]: .index/nexus-maven-repository-index.gz

Sonatype JIRA | Dan McLaughlin | 10 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    We are getting the following exception trying to create Maven2 proxy repositories that point to our Nexus 2 hosted repositories. We've confirmed that the Content Type header is set to application/x-gzip for the file /nexus/content/repositories/thirdparty/.index/nexus-maven-repository-index.gz, so I'm not sure why Nexus is is trying to detect the Content Type and not just using the HTTP header. org.sonatype.nexus.repository.InvalidContentException: Detected content type [text/plain], but expected [application/x-gzip, application/gzip, application/x-tgz, application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip-compressed, gzip/document]: .index/nexus-maven-repository-index.gz at org.sonatype.nexus.repository.storage.DefaultContentValidator.determineContentType(DefaultContentValidator.java:95) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenContentValidator.determineContentType(MavenContentValidator.java:79) [na:na] at org.sonatype.nexus.repository.storage.StorageTxImpl.determineContentType(StorageTxImpl.java:717) [na:na] at org.sonatype.nexus.repository.storage.StorageTxImpl.createBlob(StorageTxImpl.java:544) [na:na] at sun.reflect.GeneratedMethodAccessor260.invoke(Unknown Source) [na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_77] at org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53) [na:na] at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39) [na:na] at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270) [na:na] at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53) [na:na] at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63) [na:na] at com.sun.proxy.$Proxy162.createBlob(Unknown Source) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.doPut(MavenFacetImpl.java:224) [na:na] at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:54) [org.sonatype.nexus.transaction:3.0.0.03] at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:53) [org.sonatype.nexus.transaction:3.0.0.03] at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.put(MavenFacetImpl.java:200) [na:na] at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet.store(MavenProxyFacet.java:90) [na:na] at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:166) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetch(MavenIndexPublisher.java:244) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetchIndexFiles(MavenIndexPublisher.java:151) [na:na] at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyIndexFacet.publishIndex(MavenProxyIndexFacet.java:80) [na:na] at org.sonatype.nexus.repository.maven.tasks.PublishMavenIndexTask.execute(PublishMavenIndexTask.java:39) [na:na] at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:56) [na:na] at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:89) [org.sonatype.nexus.scheduling:3.0.0.03] at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:141) [org.sonatype.nexus.quartz:3.0.0.03] at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:103) [org.sonatype.nexus.quartz:3.0.0.03] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [org.quartz-scheduler.quartz:2.2.2] at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40) [org.sonatype.nexus.thread:3.0.0.03] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [org.apache.shiro.core:1.2.4] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [org.apache.shiro.core:1.2.4] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77] 2016-04-18 20:49:20,319-0500 WARN [quartz-2-thread-10] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 4b273a19-b582-4659-bc7c-f0c044b62492 : 'Publish Indexes' [repository.maven.publish-dotindex] execution failure org.sonatype.goodies.common.MultipleFailures$MultipleFailuresException: Failed to run task 'Publish Maven indexes of *'; 2 failures at org.sonatype.goodies.common.MultipleFailures.maybePropagate(MultipleFailures.java:95) [org.sonatype.goodies.common:2.1.0] at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:64) [na:na] at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:89) [org.sonatype.nexus.scheduling:3.0.0.03] at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:141) [org.sonatype.nexus.quartz:3.0.0.03] at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:103) [org.sonatype.nexus.quartz:3.0.0.03] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [org.quartz-scheduler.quartz:2.2.2] at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40) [org.sonatype.nexus.thread:3.0.0.03] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [org.apache.shiro.core:1.2.4] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [org.apache.shiro.core:1.2.4] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77] Suppressed: org.sonatype.nexus.repository.InvalidContentException: Detected content type [text/plain], but expected [application/x-gzip, application/gzip, application/x-tgz, application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip-compressed, gzip/document]: .index/nexus-maven-repository-index.gz at org.sonatype.nexus.repository.storage.DefaultContentValidator.determineContentType(DefaultContentValidator.java:95) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenContentValidator.determineContentType(MavenContentValidator.java:79) [na:na] at org.sonatype.nexus.repository.storage.StorageTxImpl.determineContentType(StorageTxImpl.java:717) [na:na] at org.sonatype.nexus.repository.storage.StorageTxImpl.createBlob(StorageTxImpl.java:544) [na:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_77] at org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53) [na:na] at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39) [na:na] at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270) [na:na] at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53) [na:na] at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63) [na:na] at com.sun.proxy.$Proxy162.createBlob(Unknown Source) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.doPut(MavenFacetImpl.java:224) [na:na] at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:54) [org.sonatype.nexus.transaction:3.0.0.03] at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:53) [org.sonatype.nexus.transaction:3.0.0.03] at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.put(MavenFacetImpl.java:200) [na:na] at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet.store(MavenProxyFacet.java:90) [na:na] at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:166) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetch(MavenIndexPublisher.java:244) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetchIndexFiles(MavenIndexPublisher.java:151) [na:na] at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyIndexFacet.publishIndex(MavenProxyIndexFacet.java:80) [na:na] at org.sonatype.nexus.repository.maven.tasks.PublishMavenIndexTask.execute(PublishMavenIndexTask.java:39) [na:na] at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:56) [na:na] ... 12 common frames omitted Suppressed: org.sonatype.nexus.repository.InvalidContentException: Detected content type [text/plain], but expected [application/x-gzip, application/gzip, application/x-tgz, application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip-compressed, gzip/document]: .index/nexus-maven-repository-index.gz at org.sonatype.nexus.repository.storage.DefaultContentValidator.determineContentType(DefaultContentValidator.java:95) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenContentValidator.determineContentType(MavenContentValidator.java:79) [na:na] at org.sonatype.nexus.repository.storage.StorageTxImpl.determineContentType(StorageTxImpl.java:717) [na:na] at org.sonatype.nexus.repository.storage.StorageTxImpl.createBlob(StorageTxImpl.java:544) [na:na] at sun.reflect.GeneratedMethodAccessor260.invoke(Unknown Source) [na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_77] at org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53) [na:na] at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39) [na:na] at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270) [na:na] at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53) [na:na] at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63) [na:na] at com.sun.proxy.$Proxy162.createBlob(Unknown Source) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.doPut(MavenFacetImpl.java:224) [na:na] at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:54) [org.sonatype.nexus.transaction:3.0.0.03] at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:53) [org.sonatype.nexus.transaction:3.0.0.03] at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.put(MavenFacetImpl.java:200) [na:na] at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet.store(MavenProxyFacet.java:90) [na:na] at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:166) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetch(MavenIndexPublisher.java:244) [na:na] at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetchIndexFiles(MavenIndexPublisher.java:151) [na:na] at org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyIndexFacet.publishIndex(MavenProxyIndexFacet.java:80) [na:na] at org.sonatype.nexus.repository.maven.tasks.PublishMavenIndexTask.execute(PublishMavenIndexTask.java:39) [na:na] at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:56) [na:na] ... 12 common frames omitted

    Sonatype JIRA | 10 months ago | Dan McLaughlin
    org.sonatype.nexus.repository.InvalidContentException: Detected content type [text/plain], but expected [application/x-gzip, application/gzip, application/x-tgz, application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip-compressed, gzip/document]: .index/nexus-maven-repository-index.gz

    Root Cause Analysis

    1. org.sonatype.nexus.repository.InvalidContentException

      Detected content type [text/plain], but expected [application/x-gzip, application/gzip, application/x-tgz, application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip-compressed, gzip/document]: .index/nexus-maven-repository-index.gz

      at org.sonatype.nexus.repository.storage.DefaultContentValidator.determineContentType()
    2. org.sonatype.nexus
      StorageTxImpl.createBlob
      1. org.sonatype.nexus.repository.storage.DefaultContentValidator.determineContentType(DefaultContentValidator.java:95)[na:na]
      2. org.sonatype.nexus.repository.maven.internal.MavenContentValidator.determineContentType(MavenContentValidator.java:79)[na:na]
      3. org.sonatype.nexus.repository.storage.StorageTxImpl.determineContentType(StorageTxImpl.java:717)[na:na]
      4. org.sonatype.nexus.repository.storage.StorageTxImpl.createBlob(StorageTxImpl.java:544)[na:na]
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor260.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_77]
      3. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_77]
      3 frames
    4. org.sonatype.nexus
      StateGuardAspect$1.invoke
      1. org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53)[na:na]
      2. org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)[na:na]
      3. org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270)[na:na]
      4. org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)[na:na]
      5. org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63)[na:na]
      5 frames
    5. com.sun.proxy
      $Proxy162.createBlob
      1. com.sun.proxy.$Proxy162.createBlob(Unknown Source)[na:na]
      1 frame
    6. org.sonatype.nexus
      RepositoryTaskSupport.execute
      1. org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.doPut(MavenFacetImpl.java:224)[na:na]
      2. org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:54)[org.sonatype.nexus.transaction:3.0.0.03]
      3. org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:53)[org.sonatype.nexus.transaction:3.0.0.03]
      4. org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.put(MavenFacetImpl.java:200)[na:na]
      5. org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyFacet.store(MavenProxyFacet.java:90)[na:na]
      6. org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:166)[na:na]
      7. org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetch(MavenIndexPublisher.java:244)[na:na]
      8. org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.prefetchIndexFiles(MavenIndexPublisher.java:151)[na:na]
      9. org.sonatype.nexus.repository.maven.internal.proxy.MavenProxyIndexFacet.publishIndex(MavenProxyIndexFacet.java:80)[na:na]
      10. org.sonatype.nexus.repository.maven.tasks.PublishMavenIndexTask.execute(PublishMavenIndexTask.java:39)[na:na]
      11. org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:56)[na:na]
      11 frames
    7. ${project.groupId}:${project.artifactId}
      TaskSupport.call
      1. org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:89)[org.sonatype.nexus.scheduling:3.0.0.03]
      1 frame
    8. org.sonatype.nexus
      QuartzTaskJob.execute
      1. org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:141)[org.sonatype.nexus.quartz:3.0.0.03]
      2. org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:103)[org.sonatype.nexus.quartz:3.0.0.03]
      2 frames
    9. quartz
      JobRunShell.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:202)[org.quartz-scheduler.quartz:2.2.2]
      1 frame
    10. org.sonatype.nexus
      MDCAwareRunnable.run
      1. org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)[org.sonatype.nexus.thread:3.0.0.03]
      1 frame
    11. Shiro
      SubjectRunnable.run
      1. org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)[org.apache.shiro.core:1.2.4]
      2. org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)[org.apache.shiro.core:1.2.4]
      2 frames
    12. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0_77]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_77]
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_77]
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_77]
      5. java.lang.Thread.run(Thread.java:745)[na:1.8.0_77]
      5 frames