Skip to content

Paket mixed responses and downloads #966

Closed

Description

@SavaNDragos

I found a pretty ugly bug on the new servers (not sure if it matters but the servers are windows server 2012 with Jenkins). We also are using our internal feed.
The bug is like this:
When paket asks for details related to a package and you have more packages for which it needs details, it will end up mixing the reponses and also the downloads:
From what I can tell there isn't a secure way to receive the callback from the nuget feed and they look to be processed randonly.

So from the log:
...
Response from http://nuget.mycompany.net/NugetWebFeed/nuget/Packages?$filter=Id eq 'Graphite.NET' and Version eq '1.1':

Graphite.NET
<feed xml:base="http://nuget.mycompany.net/NugetWebFeed/nuget/"....

<title type="text">Packages</title> ... http://nuget.mycompany.net/NugetWebFeed/nuget/Packages(Id='Mycompany.Assambly',Version='0.0.075.8635') <title type="text">Mycompany.Assambly</title>

In from of the response I added the package name (for debug purpose: Graphite.NET <?xml version="1.0).
Now what is more funny is because everything is parallel you can end up getting as a response a package:

Response from http://nuget.mycompany.net/NugetWebFeed/nuget/Packages?$filter=Id eq 'Microsoft.Web.Services3' and NormalizedVersion eq '3.0.0':

Microsoft.Web.Services3 PK��

5�Gզ�� �� � � _

The mix happens when the downloads take place also. So even if you received a good response you can get a wrong package.

At the end the builds fail because in packages\apackage you will have binaries belonging to anothe package.

This is happening on all our new servers.

At the moment I tried to limit the calls to the internal feed [singleton when making calls] and the response get back ok, but there is no parallel anymore.
We want to use the official release so any suggestions?

Activity

  1. SavaNDragos commented on Aug 7, 2015

    @SavaNDragos
    Author

    I should not this is happening with both restore and update (stuff i tested)

  2. forki commented on Aug 7, 2015

    @forki
    Member

    That sounds really strange. The parallel calls are not matching the results? So that's a bug in the async parallel calls?

    /cc @dsyme ever heard of something like that in other F# code?

  3. forki commented on Aug 7, 2015

    @forki
    Member

    Is there a way to reproduce this behavior? What did you change exactly to make it work?

  4. SavaNDragos commented on Aug 7, 2015

    @SavaNDragos
    Author

    I used Monitor.Enter Paket.Constants.InUse in the download packages method but this is not ok because it is not intended to be used in async

  5. forki commented on Aug 7, 2015

    @forki
    Member

    Could you also please test with version 1.21.1?

  6. SavaNDragos commented on Aug 7, 2015

    @SavaNDragos
    Author

    Have no idea how to reproduce it, on my machine it works fine but on the new build servers it happens.

  7. forki commented on Aug 7, 2015

    @forki
    Member

    Any details about the installed .NET framework versions? And does the
    1.21.1 work?
    On Aug 7, 2015 11:29 AM, "SavaNDragos" notifications@github.com wrote:

    Have no idea how to reproduce it, on my machine it works fine but on the
    new build servers it happens.

    —
    Reply to this email directly or view it on GitHub
    #966 (comment).

  8. SavaNDragos commented on Aug 7, 2015

    @SavaNDragos
    Author

    Tested it with 1.21.1 and is still happening.
    the machine have .net framework 4.5.2 and VS 2013.

  9. forki commented on Aug 7, 2015

    @forki
    Member

    Ok good, so at least this is not an error in the latest FSharp.Core.
    I'm currently in vacation, but I'd love to investigate this on Monday. I
    hope we can find the issue.
    On Aug 7, 2015 11:45 AM, "SavaNDragos" notifications@github.com wrote:

    Tested it with 1.21.1 and is still happening.
    the machine have .net framework 4.5.2 and VS 2013.

    —
    Reply to this email directly or view it on GitHub
    #966 (comment).

  10. SavaNDragos commented on Aug 7, 2015

    @SavaNDragos
    Author

    I rerun the same tests i have done on windows 8 and everything works fine. Also the old servers are fine (Windows server 2008 with .net framework 4.5.2 and VS 2010, 2012, 2013).
    Conclusion is only affected from what I have seen Windows Server 2012 R2 (maybe the R2 matters).

  11. SavaNDragos commented on Aug 7, 2015

    @SavaNDragos
    Author

    Ok so played a little bit more: so if we make some async operations to runSynchroniosly paket works fine (just strange, was expected to fail after a couple of tries but it looks fine).
    My changes where:
    1.In let getFromUrl (auth:Auth option, url : string) ... return client.DownloadString(Uri(url))
    2.in let getXmlFromUrl (auth:Auth option, url : string) ... return client.DownloadString(Uri(url))
    3.in let safeGetFromUrl (auth:Auth option, url : string) ... let raw = client.DownloadString(Uri(url))
    In let getDetailsFromNuGetViaODataFast\let getDetailsFromNuGetViaOData:
    4.5.let raw = getFromUrl(auth,url) |> Async.RunSynchronously
    6.let raw =
    match response with
    | Some(r) -> async { return r } |> Async.RunSynchronously
    | None ->
    let url = sprintf "%s/odata/Packages(Id='%s',Version='%s')" nugetURL package (version.ToString())
    getXmlFromUrl(auth,url) |> Async.RunSynchronously

  12. forki commented on Aug 7, 2015

    @forki
    Member

    Could you please send a pull request for easier diff?

    Btw: thanks for being so patient and helping with finding the root cause.
    On Aug 7, 2015 16:18, "SavaNDragos" notifications@github.com wrote:

    Ok so played a little bit more: so if we make some async operations to
    runSynchroniosly paket works fine (just strange, was expected to fail after
    a couple of tries but it looks fine).
    My changes where:
    1.In let getFromUrl (auth:Auth option, url : string) ... return
    client.DownloadString(Uri(url))
    2.in let getXmlFromUrl (auth:Auth option, url : string) ... return
    client.DownloadString(Uri(url))
    3.in let safeGetFromUrl (auth:Auth option, url : string) ... let raw =
    client.DownloadString(Uri(url))
    In let getDetailsFromNuGetViaODataFast\let getDetailsFromNuGetViaOData:
    4.5.let raw = getFromUrl(auth,url) |> Async.RunSynchronously
    6.let raw =
    match response with
    | Some(r) -> async { return r } |> Async.RunSynchronously
    | None ->
    let url = sprintf "%s/odata/Packages(Id='%s',Version='%s')" nugetURL
    package (version.ToString())
    getXmlFromUrl(auth,url) |> Async.RunSynchronously

    —
    Reply to this email directly or view it on GitHub
    #966 (comment).

  13. SavaNDragos commented on Aug 10, 2015

    @SavaNDragos
    Author

    I have created the pull #969

  14. SavaNDragos commented on Aug 10, 2015

    @SavaNDragos
    Author

    Have you managed to look over the pull request?

  15. forki commented on Aug 10, 2015

    @forki
    Member

    Yes, but I try to reproduce this on our own 2012 R2 servers. No luck. Does
    paket's own build work for you?
    On Aug 10, 2015 2:31 PM, "SavaNDragos" notifications@github.com wrote:

    Have you managed to look over the pull request?

    —
    Reply to this email directly or view it on GitHub
    #966 (comment).

  16. 12 remaining items

  17. forki commented on Aug 10, 2015

    @forki
    Member
  18. SavaNDragos commented on Aug 10, 2015

    @SavaNDragos
    Author

    thanks, I will start now to deploy it on the servers :d

  19. SavaNDragos commented on Aug 10, 2015

    @SavaNDragos
    Author

    Run it on the build server with a clean cache and error is still there (less packages failling).

  20. SavaNDragos commented on Aug 10, 2015

    @SavaNDragos
    Author

    This is absurd, the changes you made works but the executable I downloaded seem to have an issue, so i downloaded the code again compiled it obtained the lose files and deployed them and succes. Will wait till tomorrow to see what happens. [one server with run with the downloalded executable also]

  21. SavaNDragos commented on Aug 10, 2015

    @SavaNDragos
    Author

    "I downloaded seem to have an issue" .. the same issue

  22. forki commented on Aug 10, 2015

    @forki
    Member

    Maybe I messed up the release. Will check later
    On Aug 10, 2015 7:20 PM, "SavaNDragos" notifications@github.com wrote:

    "I downloaded seem to have an issue" .. the same issue

    —
    Reply to this email directly or view it on GitHub
    #966 (comment).

  23. SavaNDragos commented on Aug 11, 2015

    @SavaNDragos
    Author

    I think the late part was an issue from my side, I installed latest version with choco and the error persisted so I just downloaded the executable and deployed it manually on a build server.
    All builds on that server looks great no paket issue dedected.
    I will clear the nuget cache on 2 other build servers and deploy paket 1.26 to confirm that everything is perfect.

  24. forki commented on Aug 11, 2015

    @forki
    Member

    so it's fixed in 1.26.0 and we can close this case?

    if yes, then please open an issue at https://gitter.im/Microsoft/visualfsharp - it seems we have identified an issue with AsyncDownloadString in FSharp.Core.

  25. forki commented on Aug 11, 2015

    @forki
    Member

    @SavaNDragos since you are the only one that can reproduce that error, are you up for further rounds of testing? If the issue is really outside of Paket (whereever that might be) then we still want to fix that.

  26. SavaNDragos commented on Aug 11, 2015

    @SavaNDragos
    Author

    sounds good, I have allready cloned a build server

  27. SavaNDragos commented on Aug 12, 2015

    @SavaNDragos
    Author

    I think it should be marked as resolved

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions