sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.96k stars 577 forks source link

The path containing ':' in the url cannot be properly proxied - yum proxy repo #340

Closed VladimirDe closed 3 months ago

VladimirDe commented 9 months ago

Issue https://github.com/sonatype/nexus-public/issues/205 (currently closed) relates to raw repository. But if you try to reproduce it on yum proxy repository - you will get almost the same error: as long as ":" is included in the first-level path name, you will definitely get a 400 error Steps to reproduce:

  1. make proxy repository. Type: yum. Remote storage: https://pkgs.k8s.io
  2. try to get nexus-proxy_base_url/core:/stable:/v1.28/rpm/repodata/repomd.xml.key
  3. you will get error in log: 2024-02-14 10:01:16,981+0300 WARN [qtp1836931861-638] admin org.sonatype.nexus.repository.yum.orient.internal.proxy.OrientYumProxyFacetImpl - Unable to resolve url. Reason: Illegal character in scheme name at index 0: core:/stable:/v1.28/rpm/repodata/repomd.xml.key

Nexus version: 3.65.0-02

VladimirDe commented 9 months ago

replacing : with %3A does not help, error remains the same

nblair commented 9 months ago

Hi @VladimirDe thanks for opening an issue. I spent some time investigating this issue, and ultimately I have to label it as an enhancement request. The colons in the path fragment are definitely the sticking point, and it's not something we can surgically fix without impacting a lot of other formats. There are countless yum repositories that do not use colons in their path structure that we can properly support. This one will require careful investment to add support for, we'll need to gauge interest first before we start.

VladimirDe commented 9 months ago

Certainly you are right - the most of yum repositories do not have semicolon inside url path. But if some (which you need) has it - it would be a problem. And what is difference between yum and raw proxy repositories ? I suppose only metadata processing...

DamianoMarletta commented 7 months ago

thank you very much for your work I would like to inform that also pkgs.k8s.io move to an url that include ":". This repo own all the kubernetes stuff :( If you have a work around rather than use hosted i will enjoy it

perestoronin commented 3 months ago

It's possible use mirror e.g. https://mirror.yandex.ru/mirrors/pkgs.k8s.io/core/stable/ instead of https://pkgs.k8s.io/ But property "distibution" left empty in this case ?

nexus-kubernetes.sls:

nexus:
  repos:
    proxy:
      ubuntu-kubernetes:
        repo_type: apt
        remote_url: https://mirror.yandex.ru/mirrors/pkgs.k8s.io/core/stable/
        distribution: ./
        strictContentTypeValidation: false
        blob_store: deb
        policyNames:
          '""'
nblair commented 3 months ago

I'm happy to say that this issue is fixed in next week's release of 3.71.0 - you can now successfully proxy pkgs.k8s.io directly in that version (it will be mentioned as NEXUS-42529 in the release notes).