Error upload file to apt hosted repository

Hello. I runed Sonatype Nexus Repository Manager in docker container. Generated the gpg key, then create the apt hosted repository with the gpg key

Tried upload deb file to the apt repository, but got an error

Logs nexus

nexus     | 2020-07-13 13:46:01,135+0000 ERROR [qtp1659810936-183] admin org.sonatype.nexus.coreui.UploadResource - Unable to perform upload to repository roschat-client.deb
nexus     | java.io.IOException: unknown object in stream: 19
nexus     |     at org.bouncycastle.openpgp.PGPObjectFactory.nextObject(Unknown Source)
nexus     |     at org.bouncycastle.openpgp.PGPSecretKeyRingCollection.<init>(Unknown Source)
nexus     |     at org.sonatype.nexus.repository.apt.internal.gpg.AptSigningFacet.readSecretKey(AptSigningFacet.java:170)
nexus     |     at org.sonatype.nexus.repository.apt.internal.gpg.AptSigningFacet.signInline(AptSigningFacet.java:108)
nexus     |     at org.sonatype.nexus.repository.apt.internal.hosted.AptHostedFacet.rebuildIndexes(AptHostedFacet.java:177)
nexus     |     at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:49)
nexus     |     at org.sonatype.nexus.repository.apt.internal.hosted.AptHostedFacet.ingestAsset(AptHostedFacet.java:133)
nexus     |     at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:57)
nexus     |     at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)
nexus     |     at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
nexus     |     at org.sonatype.nexus.repository.apt.internal.hosted.AptHostedFacet.ingestAsset(AptHostedFacet.java:101)
nexus     |     at org.sonatype.nexus.repository.apt.AptUploadHandler.handle(AptUploadHandler.java:85)
nexus     |     at org.sonatype.nexus.repository.upload.internal.UploadManagerImpl.handle(UploadManagerImpl.java:106)
nexus     |     at org.sonatype.nexus.coreui.internal.UploadService.upload(UploadService.java:78)
nexus     |     at org.sonatype.nexus.coreui.UploadResource.postComponent(UploadResource.java:86)
nexus     |     at com.palominolabs.metrics.guice.ExceptionMeteredInterceptor.invoke(ExceptionMeteredInterceptor.java:23)
nexus     |     at com.palominolabs.metrics.guice.TimedInterceptor.invoke(TimedInterceptor.java:26)
nexus     |     at org.sonatype.nexus.validation.internal.ValidationInterceptor.invoke(ValidationInterceptor.java:53)
nexus     |     at org.apache.shiro.guice.aop.AopAllianceMethodInvocationAdapter.proceed(AopAllianceMethodInvocationAdapter.java:49)
nexus     |     at org.apache.shiro.authz.aop.AuthorizingAnnotationMethodInterceptor.invoke(AuthorizingAnnotationMethodInterceptor.java:68)
nexus     |     at org.apache.shiro.guice.aop.AopAllianceMethodInterceptorAdapter.invoke(AopAllianceMethodInterceptorAdapter.java:36)
nexus     |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
nexus     |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
nexus     |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
nexus     |     at java.lang.reflect.Method.invoke(Method.java:498)
nexus     |     at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
nexus     |     at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:294)
nexus     |     at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:248)
nexus     |     at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:235)
nexus     |     at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)
nexus     |     at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)
nexus     |     at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
nexus     |     at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
nexus     |     at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
nexus     |     at org.sonatype.nexus.siesta.internal.resteasy.ComponentContainerImpl.service(ComponentContainerImpl.java:109)
nexus     |     at org.sonatype.nexus.siesta.SiestaServlet.service(SiestaServlet.java:137)
nexus     |     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
nexus     |     at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
nexus     |     at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
nexus     |     at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
nexus     |     at com.google.inject.servlet.DynamicServletPipeline.service(DynamicServletPipeline.java:71)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
nexus     |     at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
nexus     |     at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
nexus     |     at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
nexus     |     at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
nexus     |     at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
nexus     |     at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
nexus     |     at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
nexus     |     at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
nexus     |     at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
nexus     |     at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
nexus     |     at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
nexus     |     at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
nexus     |     at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
nexus     |     at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
nexus     |     at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:85)
nexus     |     at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
nexus     |     at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
nexus     |     at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
nexus     |     at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
nexus     |     at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
nexus     |     at org.sonatype.nexus.security.SecurityFilter.doFilterInternal(SecurityFilter.java:101)
nexus     |     at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at com.sonatype.nexus.licensing.internal.LicensingRedirectFilter.doFilter(LicensingRedirectFilter.java:116)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:112)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at org.sonatype.nexus.internal.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:79)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at org.sonatype.nexus.internal.web.EnvironmentFilter.doFilter(EnvironmentFilter.java:101)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at org.sonatype.nexus.internal.web.HeaderPatternFilter.doFilter(HeaderPatternFilter.java:98)
nexus     |     at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
nexus     |     at com.google.inject.servlet.DynamicFilterPipeline.dispatch(DynamicFilterPipeline.java:104)
nexus     |     at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
nexus     |     at org.sonatype.nexus.bootstrap.osgi.DelegatingFilter.doFilter(DelegatingFilter.java:73)
nexus     |     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
nexus     |     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
nexus     |     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
nexus     |     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
nexus     |     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
nexus     |     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
nexus     |     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
nexus     |     at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
nexus     |     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
nexus     |     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
nexus     |     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
nexus     |     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
nexus     |     at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
nexus     |     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
nexus     |     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
nexus     |     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
nexus     |     at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:239)
nexus     |     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
nexus     |     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
nexus     |     at org.eclipse.jetty.server.Server.handle(Server.java:505)
nexus     |     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
nexus     |     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
nexus     |     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
nexus     |     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
nexus     |     at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
nexus     |     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
nexus     |     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
nexus     |     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
nexus     |     at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
nexus     |     at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
nexus     |     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
nexus     |     at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
nexus     |     at java.lang.Thread.run(Thread.java:748)

Hi Pavel,
Most likely you have an issue with GPG key.

  1. Next instruction will help you to generate new GPG key in the Docker. Also, you can do it on the Debian machine if you don’t have Docker.

docker run -v /Users/<USER_NAME>/share_folder/:/root/share -it ubuntu
apt-get update
apt-get install gpg
gpg --gen-key
gpg --list-keys
cd /root/share
gpg --armor --output public.gpg.key --export 315F58C16D58E682E39A816AD7
gpg --armor --output private.gpg.key --export-secret-key 315F58C16D58E682E39A816AD7

  1. Be sure you are using private key not public in the Nexus repository settings.
  2. Important thing is to copy private key with all headers, next lines. If something in the document will be changed, GPG key becomes broken.
  3. If nothing help, I can share with you my temporary created GPG just for testing.

Good luck!

1 Like

Pavel, I found your post also on the stackoverflow.
I found that you have inserted incorrect value into the Signing Key field.
Instead of ID:
image

Please insert private.gpg.key file content. e.g.

-----BEGIN PGP PRIVATE KEY BLOCK-----

lQVYBF8MzdsBDAC+5E1TpZXgAohiOYcdA9DUkMs++5L0KZcSiEDY9X5i+IqRnJkd
ErZYx0C3dJzpHjUx0bTajyXcGP4Mbq5qAPAEhJvav3AR/9gMMWCsmL66yhbzMkLR
...
DScPryrIzM3EG3r39NkLnQi8wz1ZYpodFMLyChhj5mPoT/H+h81F1QEf1QvV72Fy
xrTSJfL9Btg4Vy+g3Uh1fo0hLhqU36pFNnmoaWu90uRc
=53GK
-----END PGP PRIVATE KEY BLOCK-----

Regards!

2 Likes

@aornatovskyy Many thanks. That helped. I did this through

docker-compose exec -u 0 nexus3 bash

All that was needed was to install a pinentry to generate a gpg key. And everything else was done according to your instructions.

you are welcome!