New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paket restore not working with nexus nuget proxy and normalized version number #2320

Closed
PMudra opened this Issue May 8, 2017 · 14 comments

Comments

Projects
None yet
4 participants
@PMudra

PMudra commented May 8, 2017

Description

When I am trying to restore nuget package SourceLink.Fake with version 1.1.0 from a nexus nuget proxy server I get the following error message:

Paket version 4.8.5
Downloading SourceLink.Fake 1.1
Something went wrong while downloading SourceLink.Fake 1.1
Message: Could not download SourceLink.Fake 1.1.
    Couldn't get package details for package SourceLink.Fake 1.1 on http://localhost:8081/repository/nuget.org-proxy.
  ==> Trying again
Downloading SourceLink.Fake 1.1
Something went wrong while downloading SourceLink.Fake 1.1
Message: Could not download SourceLink.Fake 1.1.
    Couldn't get package details for package SourceLink.Fake 1.1 on http://localhost:8081/repository/nuget.org-proxy.
  ==> Last trial
Downloading SourceLink.Fake 1.1
Paket failed with:
        Could not download SourceLink.Fake 1.1.
    Couldn't get package details for package SourceLink.Fake 1.1 on http://localhost:8081/repository/nuget.org-proxy.

SourceLink.Fake is just an example. It will not work for any other package and version with trailing 0.

paket.dependencies

source http://localhost:8081/repository/nuget.org-proxy/
nuget SourceLink.Fake = 1.1.0

paket.lock

NUGET
  remote: http://localhost:8081/repository/nuget.org-proxy
    SourceLink.Fake (1.1)

#1777 might be related.

Repro steps

  1. Install nexus nuget proxy server. Easiest way using docker: docker run -d -p 8081:8081 --name nexus sonatype/nexus3. https://hub.docker.com/r/sonatype/nexus3/
  2. Setup minimal project with paket.exe and paket.dependencies as stated above.
  3. Run .paket/paket.exe install
  4. Delete package/ directory
  5. Run .paket/paket.exe clear-cache
  6. Run .paket/paket.exe restore

See test.zip. Steps 3 and 4 can be skipped when using project in zip file.

Expected behavior

The expected result is that paket restores the needed nuget paket to package/ folder

Actual behavior

An error occurs and the package is not restored.

I believe this is the important part of verbose output of .paket/paket.exe restore (full log: verbose.txt):

Downloading SourceLink.Fake 1.1
Response from http://localhost:8081/repository/nuget.org-proxy/Packages?$filter=(tolower(Id) eq 'sourcelink.fake') and (NormalizedVersion eq '1.1.0'):

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://localhost:8081/repository/nuget.org-proxy/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Packages</title>
  <id>http://localhost:8081/repository/nuget.org-proxy/Packages</id>
  <updated>2017-05-08T12:37:06.654Z</updated>
  <link rel="self" title="Packages" href="Packages"/>
  <m:count>0</m:count>
</feed>
Response from http://localhost:8081/repository/nuget.org-proxy/Packages?$filter=(tolower(Id) eq 'sourcelink.fake') and (Version eq '1.1'):

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://localhost:8081/repository/nuget.org-proxy/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Packages</title>
  <id>http://localhost:8081/repository/nuget.org-proxy/Packages</id>
  <updated>2017-05-08T12:37:06.890Z</updated>
  <link rel="self" title="Packages" href="Packages"/>
  <m:count>0</m:count>
</feed>
Error while retrieving 'http://localhost:8081/repository/nuget.org-proxy/Packages(Id='SourceLink.Fake',Version='1.1')': System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---

I believe the second request should be requesting Version eq '1.1.0' because 1.1.0 is the non-normalized version of the nuget package.

Known workarounds

There are multiple ways to work around this issue:

  1. Do not use nuget proxy but the official nuget.org server
  2. Run .paket/paket.exe update
  3. Delete paket.lock and run .paket/paket.exe install
@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid May 8, 2017

Member

Is this a regression? Ie is an older version of paket working?

Member

matthid commented May 8, 2017

Is this a regression? Ie is an older version of paket working?

@PMudra

This comment has been minimized.

Show comment
Hide comment
@PMudra

PMudra May 8, 2017

No, it does not seem so. I just tried it with versions 3.0.0 and 4.0.0 with the same result. Are there any specific versions I should try?

PMudra commented May 8, 2017

No, it does not seem so. I just tried it with versions 3.0.0 and 4.0.0 with the same result. Are there any specific versions I should try?

@b0urb4k1

This comment has been minimized.

Show comment
Hide comment
@b0urb4k1

b0urb4k1 Jun 21, 2017

I am experiencing problems with Nexus 3 also.

Paket version 5.1.7
Resolving packages for group Build:

  • NuGet.CommandLine is pinned to 3.4.3
    Package not available.
    Message: Unable to retrieve package details for 'NuGet.CommandLine'-3.4.3

I downgraded to 4.8.7 which works with no problems.
So in my case this is for sure a regression.

Is there any way to use the bootstrapper to grab a specific version of Paket?
At the moment i commit the bootstrapper and always grab Paket with the bootstrapper (Paket is not commited to the repository).

b0urb4k1 commented Jun 21, 2017

I am experiencing problems with Nexus 3 also.

Paket version 5.1.7
Resolving packages for group Build:

  • NuGet.CommandLine is pinned to 3.4.3
    Package not available.
    Message: Unable to retrieve package details for 'NuGet.CommandLine'-3.4.3

I downgraded to 4.8.7 which works with no problems.
So in my case this is for sure a regression.

Is there any way to use the bootstrapper to grab a specific version of Paket?
At the moment i commit the bootstrapper and always grab Paket with the bootstrapper (Paket is not commited to the repository).

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jun 21, 2017

Member

yes you call with the version as argument https://fsprojects.github.io/Paket/bootstrapper.html

Member

forki commented Jun 21, 2017

yes you call with the version as argument https://fsprojects.github.io/Paket/bootstrapper.html

@b0urb4k1

This comment has been minimized.

Show comment
Hide comment
@b0urb4k1

b0urb4k1 Jun 21, 2017

Thanks. It works now with the old version.
Here are some more errors i get. I am not sure if it helps or if i should run it in verbose mode maybe for a single package.

b0urb4k1 commented Jun 21, 2017

Thanks. It works now with the old version.
Here are some more errors i get. I am not sure if it helps or if i should run it in verbose mode maybe for a single package.

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jun 21, 2017

Member

@b0urb4k1 a full (with -v) and a minimal log (without -v) would be helpful. (+ dependencies file if possible)

Member

matthid commented Jun 21, 2017

@b0urb4k1 a full (with -v) and a minimal log (without -v) would be helpful. (+ dependencies file if possible)

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jun 21, 2017

Member

Also if possible please add the same logs for the old (working) version. Thanks!

Member

matthid commented Jun 21, 2017

Also if possible please add the same logs for the old (working) version. Thanks!

@b0urb4k1

This comment has been minimized.

Show comment
Hide comment
@b0urb4k1

b0urb4k1 Jun 21, 2017

I compiled a gist with all the (hopefully) relevant data.
https://gist.github.com/b0urb4k1/c724bac98629e561d96040cdc106d59b
Added the dependencies file also.

b0urb4k1 commented Jun 21, 2017

I compiled a gist with all the (hopefully) relevant data.
https://gist.github.com/b0urb4k1/c724bac98629e561d96040cdc106d59b
Added the dependencies file also.

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jun 21, 2017

Member

@b0urb4k1 Can you please open a new issue as I don't think it the same as the initial post.
Can you try setting PAKET_RESOLVER_TASK_TIMEOUT on higher values like 60000 for 60 seconds and report back?

Member

matthid commented Jun 21, 2017

@b0urb4k1 Can you please open a new issue as I don't think it the same as the initial post.
Can you try setting PAKET_RESOLVER_TASK_TIMEOUT on higher values like 60000 for 60 seconds and report back?

@matthid

This comment has been minimized.

Show comment
Hide comment
@matthid

matthid Jul 9, 2017

Member

@PMudra can you try again? This might have been solved recently.

Member

matthid commented Jul 9, 2017

@PMudra can you try again? This might have been solved recently.

@PMudra

This comment has been minimized.

Show comment
Hide comment
@PMudra

PMudra Jul 10, 2017

Unfortunately, I still get the same error message.

Version: 5.5.3

PMudra commented Jul 10, 2017

Unfortunately, I still get the same error message.

Version: 5.5.3

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jul 11, 2017

Member

ok I can repro!

Member

forki commented Jul 11, 2017

ok I can repro!

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Jul 11, 2017

Member

I just released paket 5.6.3 with a fix. But I assume it's a bug in sonatype since NormalizedVersion is 1.1.0 and it can't retrieve that. please also report it with sonatype directly.

Member

forki commented Jul 11, 2017

I just released paket 5.6.3 with a fix. But I assume it's a bug in sonatype since NormalizedVersion is 1.1.0 and it can't retrieve that. please also report it with sonatype directly.

@forki forki closed this in ce650d1 Jul 11, 2017

@PMudra

This comment has been minimized.

Show comment
Hide comment
@PMudra

PMudra Jul 11, 2017

Thanks for the fix. I tried again and it is working now!

I found this issue on sonatypes jira: https://issues.sonatype.org/browse/NEXUS-6159
The missing NormalizedVersion is mentioned there.

PMudra commented Jul 11, 2017

Thanks for the fix. I tried again and it is working now!

I found this issue on sonatypes jira: https://issues.sonatype.org/browse/NEXUS-6159
The missing NormalizedVersion is mentioned there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment