Not able to proxy python link

Hi,
I am not able to proxy pass this link https://download.pytorch.org/whl/torch_stable.html in Nexus Repository OSS 3.30.0-01 under pypi format.

Any help will be appreciated.
Thank you.

Hi Gopal, what is the error you are experiencing? Have you checked what’s being logged?

That doesn’t look like a pypi repository, I don’t see a “simple” index page in it. You’ll likely need to use a raw proxy for this.

1 Like

raw proxy for https://download.pytorch.org/whl/torch_stable.html not work , 404 error

@rseddon @dsawa Hi, I’m experiencing the same issue with pytorch. Could you please advise?

Proxy Pytorch pypi https://download.pytorch.org/whl/ → http://10.101.223.200:10000/repository/torch-local/

terminal:

 pip install --no-cache --index-url http://10.101.223.200:10000/repository/torch-local --trusted-host 10.101.223.200  torch==1.11.0+cu113
Looking in indexes: http://10.101.223.200:10000/repository/torch-local
ERROR: Could not find a version that satisfies the requirement torch==1.11.0+cu113 (from versions: none)
ERROR: No matching distribution found for torch==1.11.0+cu113

logs:

2023-01-18 01:56:36,243+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - RESTEASY002315: PathInfo: /internal/logging/logs/nexus.log
2023-01-18 01:56:36,244+0000 DEBUG [qtp1178343794-681]  admin org.sonatype.nexus.internal.log.LogbackLogManager - Retrieving log file
2023-01-18 01:56:36,248+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - MessageBodyWriter: org.jboss.resteasy.spi.ResteasyProviderFactory$SortedKey
2023-01-18 01:56:36,249+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - MessageBodyWriter: org.jboss.resteasy.plugins.providers.InputStreamProvider
2023-01-18 01:56:36,249+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - MessageBodyWriter: org.jboss.resteasy.plugins.providers.InputStreamProvider
2023-01-18 01:56:36,249+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - Interceptor Context: org.jboss.resteasy.core.interception.ServerWriterInterceptorContext,  Method : proceed
2023-01-18 01:56:36,250+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - MessageBodyWriter: org.jboss.resteasy.spi.ResteasyProviderFactory$SortedKey
2023-01-18 01:56:36,250+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - MessageBodyWriter: org.jboss.resteasy.plugins.providers.InputStreamProvider
2023-01-18 01:56:36,250+0000 DEBUG [qtp1178343794-681]  admin org.jboss.resteasy.resteasy_jaxrs.i18n - Provider : org.jboss.resteasy.plugins.providers.InputStreamProvider,  Method : writeTo
2023-01-18 01:56:38,342+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.apache.shiro.session.mgt.DefaultSessionManager - Unable to resolve session ID from SessionKey [org.apache.shiro.web.session.mgt.WebSessionKey@705cfe6d].  Returning null to indicate a session could not be found.
2023-01-18 01:56:38,343+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.apache.shiro.session.mgt.DefaultSessionManager - Unable to resolve session ID from SessionKey [org.apache.shiro.web.session.mgt.WebSessionKey@2b46aec].  Returning null to indicate a session could not be found.
2023-01-18 01:56:38,344+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Servicing: GET /repository/torch-local/torch/ (http://10.101.223.200:10000/repository/torch-local/torch/)
2023-01-18 01:56:38,345+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Parsed path: RepositoryPath{repositoryName='torch-local', remainingPath='/torch/'}
2023-01-18 01:56:38,345+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Looking for repository: torch-local
2023-01-18 01:56:38,345+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Repository: RepositoryImpl$$EnhancerByGuice$$691501445{type=proxy, format=pypi, name='torch-local'}
2023-01-18 01:56:38,345+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Dispatching to view facet: org.sonatype.nexus.repository.view.ConfigurableViewFacet$$EnhancerByGuice$$682328406@7003c2ea
2023-01-18 01:56:38,346+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.HttpResponseSenderSelector - Looking for HTTP response sender: pypi
2023-01-18 01:56:38,347+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.Router - Request: Request{action='GET', path='/torch/', parameters=null, payload=HttpRequestPayloadAdapter{contentType='null', size=-1}, multipart=false}
2023-01-18 01:56:38,347+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.logic.AndMatcher - Matching: org.sonatype.nexus.repository.view.matchers.ActionMatcher@16e83247 AND OrMatcher{matchers=[org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@e75e31f, org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@60f43486]}
2023-01-18 01:56:38,348+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.logic.OrMatcher - Matching: org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@e75e31f OR org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@60f43486
2023-01-18 01:56:38,348+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.token.TokenMatcher - Matching: /torch/~=TokenParser{pattern=\Q/simple/\E(?<name>[0-9a-zA-z._-]+), variables=[var(name,[0-9a-zA-z._-]+)]}
2023-01-18 01:56:38,348+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.token.TokenMatcher - Matching: /torch/~=TokenParser{pattern=\Q/simple/\E(?<name>[0-9a-zA-z._-]+)\Q/\E, variables=[var(name,[0-9a-zA-z._-]+)]}
2023-01-18 01:56:38,348+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.logic.AndMatcher - Matching: org.sonatype.nexus.repository.view.matchers.ActionMatcher@64493f85 AND org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@513a6baa
2023-01-18 01:56:38,348+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.token.TokenMatcher - Matching: /torch/~=TokenParser{pattern=\Q/simple/\E, variables=[]}
2023-01-18 01:56:38,349+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.logic.AndMatcher - Matching: org.sonatype.nexus.repository.view.matchers.ActionMatcher@55677df6 AND org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@29fe7767
2023-01-18 01:56:38,349+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.token.TokenMatcher - Matching: /torch/~=TokenParser{pattern=\Q/\E(?<path>packages/[^/]+/[^/]+/[^/]+), variables=[var(path,packages/[^/]+/[^/]+/[^/]+)]}
2023-01-18 01:56:38,349+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.matchers.logic.AndMatcher - Matching: org.sonatype.nexus.repository.view.matchers.ActionMatcher@466c0ca AND org.sonatype.nexus.repository.view.matchers.token.TokenMatcher@6838cd7
2023-01-18 01:56:38,349+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.handlers.BrowseUnsupportedHandler$MatcherImpl - Matching: GET /torch/
2023-01-18 01:56:38,349+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.Context - Starting: Route{matcher=org.sonatype.nexus.repository.view.handlers.BrowseUnsupportedHandler$MatcherImpl@68e5c93c, handlers=[org.sonatype.nexus.repository.security.SecurityHandler@10d8da86, org.sonatype.nexus.repository.view.handlers.BrowseUnsupportedHandler@32fade08]}
2023-01-18 01:56:38,349+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.Context - Proceeding: org.sonatype.nexus.repository.security.SecurityHandler@10d8da86
2023-01-18 01:56:38,350+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.Context - Proceeding: org.sonatype.nexus.repository.view.handlers.BrowseUnsupportedHandler@32fade08
2023-01-18 01:56:38,352+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.view.Router - Response: Response{status=Status{successful=true, code=200, message='null'}, payload=StringPayload{size=2067, charset=UTF-8, contentType='text/html'}}
2023-01-18 01:56:38,352+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Request: Request{action='GET', path='/torch/', parameters=null, payload=HttpRequestPayloadAdapter{contentType='null', size=-1}, multipart=false}
2023-01-18 01:56:38,353+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.DefaultHttpResponseSender - Sending response: Response{status=Status{successful=true, code=200, message='null'}, payload=StringPayload{size=2067, charset=UTF-8, contentType='text/html'}}
2023-01-18 01:56:38,353+0000 DEBUG [qtp1178343794-175]  *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Service completed
2023-01-18 01:56:38,363+0000 DEBUG [qtp1178343794-177]  *UNKNOWN org.apache.shiro.session.mgt.DefaultSessionManager - Unable to resolve session ID from SessionKey 

Nexus implements the PEP 503 spec, which Dawid & Rich pointed out this pytorch site does not appear to follow.

1 Like

Is there any workaround for this?

You could probably download the whl(s) you’re interested in and upload them to a pypi hosted repository.

Aside from that you might be able to ask the Pytorch folks if they could provide a PEP503 repository.

How exactly the Nexus make the request?

Because all dependencies could be installed via the canonical pip python package manager.