Apt repositories (hosted & proxy) snapshots creating method does not work - Sonatype Nexus Repository - Sonatype Community

Apt repositories (hosted & proxy) snapshots creating method does not work

post by dmitro.biz on Mar 29, 2021

Sonatype Nexus Repository Manager OSS: 3.29.2-02

According to the manual “Taking a Snapshot of a repository metadata” - the method returns Error 500.

$ curl -vvvv -u 'changedadmin:changedpassword' -X MKCOL  https://nexus.mydomain.net:8443/repository/my-apt-proxy/snapshots/release123
*   Trying xx.yy.zz.aa...
* TCP_NODELAY set
* Connected to nexus.mydomain.net (xx.yy.zz.aa) port 8443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.mydomain.net
*  start date: Mar  3 15:46:33 2021 GMT
*  expire date: Jun  1 15:46:33 2021 GMT
*  subjectAltName: host "nexus.mydomain.net" matched cert's "*.mydomain.net"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Server auth using Basic with user 'changedadmin'
> MKCOL /repository/my-apt-proxy/snapshots/release123 HTTP/1.1
> Host: nexus.mydomain.net:8443
> Authorization: Basic YRWRtaW461pQ29yU2lnaHjOZXhBZGbjIwMAh
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 500 Server Error
< Server: Nexus/3.29.2-02 (OSS)
< X-Content-Type-Options: nosniff
< Content-Security-Policy: sandbox allow-forms allow-modals allow-pops allow-presentation allow-scripts allow-top-navigation
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: DENY
< Content-Length: 0
<
* Connection #0 to host nexus.mydomain.net left intact

I really need snapshots for apt hosted and proxy repositories. I ask the respected community to clarify the possibility of their creation.

post by mpiggott on Mar 29, 2021

You’d have to look at whatever error is on the server.

post by dmitro.biz on Mar 29, 2021

Thank you, Matthew! There is only this warning in the log:

2021-03-29 15:26:19,852+0100 WARN  [qtp1004474332-1067]  admin org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: MKCOL /repository/my-apt-proxy/snapshots/release123
java.lang.IllegalArgumentException: Illegal character in path at index 12: dists/bionic main restricted universe multiverse/Release
    at java.net.URI.create(URI.java:852)
    at java.net.URI.resolve(URI.java:1036)
    at org.sonatype.nexus.repository.apt.internal.proxy.AptProxyFacet.fetchLatest(AptProxyFacet.java:133)
    at org.sonatype.nexus.repository.apt.internal.proxy.AptProxyFacet.fetchLatest(AptProxyFacet.java:116)
    at org.sonatype.nexus.repository.apt.internal.proxy.AptProxyFacet.getSnapshotItems(AptProxyFacet.java:72)
    at org.sonatype.nexus.repository.apt.internal.snapshot.AptSnapshotFacetSupport.collectSnapshotItems(AptSnapshotFacetSupport.java:124)
    at org.sonatype.nexus.repository.apt.internal.snapshot.AptSnapshotFacetSupport.createSnapshot(AptSnapshotFacetSupport.java:65)
    at org.sonatype.nexus.repository.apt.internal.snapshot.AptSnapshotHandler.doMkcol(AptSnapshotHandler.java:96)
    at org.sonatype.nexus.repository.apt.internal.snapshot.AptSnapshotHandler.handleSnapshotAdminRequest(AptSnapshotHandler.java:85)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.storage.UnitOfWorkHandler.handle(UnitOfWorkHandler.java:39)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.view.handlers.ContentHeadersHandler.handle(ContentHeadersHandler.java:46)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.http.PartialFetchHandler.handle(Context.java:88)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.cache.NegativeCacheHandler.handle(Context.java:48)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at com.sonatype.nexus.clm.internal.orient.FirewallContributedHandler.handle(FirewallContributedHandler.java:101)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.view.handlers.ExceptionHandler.handle(Context.java:42)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.view.handlers.FormatHighAvailabilitySupportHandler.handle(FormatHighAvailabilitySupportHandler.java:52)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.security.SecurityHandler.handle(SecurityHandler.java:51)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at org.sonatype.nexus.repository.view.handlers.TimingHandler.handle(TimingHandler.java:58)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at com.sonatype.nexus.repository.cache.NegativeCacheHandler.handle(Context.java:48)
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
    at com.sonatype.nexus.repository.httpbridge.internal.ViewServlet.dispatchAndSend(ViewServlet.java:213)
    at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.doService(ViewServlet.java:175)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290)
    at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:280)
    at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184)
    at org.google.inject.servlet.DynamicServletPipeline.service(ServletDefinition.java:71)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
    at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChainInvocation.java:61)
    at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
    at org.apache.shiro.web.servlet.AdviceFilter.handle(OncePerRequestFilter.doFilterInternal(OncePerRequestFilter.java:137)
    at org.apache.shiro.web.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:450)
    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.doCall(SubjectCallable.java:90)
    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.doCall(SubjectCallable.java:83)
    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.execute(DelegatingSubject.getSubject().getCompletionHandler().setSubject(callable)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(OncePerRequestFilter.java:362)
    at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:96)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilter(OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at com.google.inject.servlet.DynamicFilterPipeline.dispatch(DelegatingFilter.doFilter)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at com.google.inject.servlet.DynamicFilterInvocation.doFilter(FilterChainInvocation.doFilter(OncePerRequestFilter.java:125)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.doFilter(OncePerRequestFilter.java:82)

post by dmitro.biz on Mar 29, 2021

the question was solved - leaving only the ‘bionic’ in the field ‘Distribution to fetch’

Thanks!

post by mpiggott on Mar 29, 2021

Cool, I put a ticket in to handle it more gracefully but I’m not sure when that will be tackled.

post by dushi404 on Jan 11, 2023

Hi Dmitro
There is no Contents-amd64.gz file in your snapshot.
without that file is that working fine? I am badly facing that issue in my environment.

“dists/jammy/Contents-amd64 404 Not Found” error.