Skip to content

Is it just me? NullReferenceException in paket.exe #319

Closed

Description

@haf

On this source tree

It's getting a bit old. So far I have successfully converted zero projects to paket. =s

mono tools/paket.exe convert-from-nuget -v
Paket version 0.11.10.0
Paket failed with:
   Object reference not set to an instance of an object
StackTrace:
    at [email protected] (System.Xml.XmlNode node) [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Core.OptionModule.Map[XmlNode,Auth] (Microsoft.FSharp.Core.FSharpFunc`2 mapping, Microsoft.FSharp.Core.FSharpOption`1 option) [0x00000] in <filename unknown>:0
  at [email protected] (IEnumerable`1& next) [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[Paket.PackageSources+PackageSource].MoveNextImpl () [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[Paket.PackageSources+PackageSource].System-Collections-IEnumerator-MoveNext () [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Collections.SeqModule.ToList[PackageSource] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
  at Paket.NuGetConvert.applyConfig (Paket.NugetConfig config, System.Xml.XmlDocument doc) [0x00000] in <filename unknown>:0
  at [email protected] (Paket.NugetConfig config, System.Xml.XmlDocument doc) [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Collections.ListModule.loop@151-20[XmlDocument,NugetConfig] (Microsoft.FSharp.Core.FSharpFunc`3 f, Paket.NugetConfig s, Microsoft.FSharp.Collections.FSharpList`1 xs) [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Collections.ListModule.Fold[XmlDocument,NugetConfig] (Microsoft.FSharp.Core.FSharpFunc`2 folder, Paket.NugetConfig state, Microsoft.FSharp.Collections.FSharpList`1 list) [0x00000] in <filename unknown>:0
  at Paket.NuGetConvert.readNugetConfig () [0x00000] in <filename unknown>:0
  at Paket.NuGetConvert.ConvertFromNuget (Boolean force, Boolean installAfter, Boolean initAutoRestore) [0x00000] in <filename unknown>:0
  at [email protected] (Microsoft.FSharp.Core.Unit unitVar) [0x00000] in <filename unknown>:0
  at <StartupCode$paket>.$Paket.Program.main@ () [0x00000] in <filename unknown>:0
 mono --version
Mono JIT compiler version 3.10.0 ((detached/e204655 Mon Oct 13 08:50:28 EDT 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug
    LLVM:          yes(3.4svn-mono-(detached/e656cac)
    GC:            sgen

Activity

  1. forki commented on Nov 1, 2014

    @forki
    Member

    let me check.

  2. forki commented on Nov 1, 2014

    @forki
    Member

    convert worked for me. Without any problems. Let me send you a pull request to suave

    will still try to reproduce your error.

  3. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    Funny. I'm on a OS X 10.9.5 mac if that helps.

  4. forki commented on Nov 1, 2014

    @forki
    Member
  5. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    Great. I've merged it to master now.

    Do you want me to give you any more data on the null reference exception?

  6. forki commented on Nov 1, 2014

    @forki
    Member

    yes. please.

    I tried to reproduce, but no luck.

    I assume the error is at
    https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/NugetConvert.fs#L25

    2014-11-01 15:55 GMT+01:00 Henrik Feldt [email protected]:

    Great. I've merged it to master now.

    Do you want me to give you any more data on the null reference exception?

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

  7. forki commented on Nov 1, 2014

    @forki
    Member

    ok. seems the error is with a nuget.config - probably one which exists on your machine and not on mine - somehwere in Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "nuget"

  8. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    Yes, I've found it...

    The problem is that you loop over each key of the add-elements in packageSources, but for some keys you can't assume you have a credential. E.g. for the key https://www.nuget.org/api/v2/ there's no corresponding element in the packageSourceCredentials element.

  9. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    On this line you assume SelectNodes doesn't return null.

  10. forki commented on Nov 1, 2014

    @forki
    Member

    thanks. will rewrite that part.

  11. forki commented on Nov 1, 2014

    @forki
    Member

    ok this is now super verbose but hopefully safer. @theimowski could you please review my changes? Thx

  12. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    Now it fails with:

    Paket failed with:
       Could not retrieve data from https://tc/httpAuth/app/nuget/v1/FeedService.svc/Packages?$filter=Id eq 'RazorEngine'
     Message: The remote server returned an error: (401) Unauthorized.
    

    Because I have a nuget source that's authorized.

  13. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    ok, now I've spent too much time on this again :p. See you in a month.

  14. forki commented on Nov 1, 2014

    @forki
    Member

    Can you send me your nuget config? With modified password of course. Will
    make it a unittest
    On Nov 1, 2014 4:39 PM, "Henrik Feldt" [email protected] wrote:

    Now it fails with:

    Paket failed with:
    Could not retrieve data from https://tc/httpAuth/app/nuget/v1/FeedService.svc/Packages?$filter=Id eq 'RazorEngine'

    Because I have a nuget source that's authorized.

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

  15. haf commented on Nov 1, 2014

    @haf
    MemberAuthor

    Done

  16. theimowski commented on Nov 1, 2014

    @theimowski
    Member

    my guess would be this line - nuget supports also encrypted passwords

  17. theimowski commented on Nov 1, 2014

    @theimowski
    Member

    ... which convert-nuget does not, my bad I didn't handle that.

  18. forki commented on Nov 1, 2014

    @forki
    Member

    @haf thanks. I used it as a first sample. should work in 0.11.11

    I'm now starting to cleanup and add couple of new test cases.

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