Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Can't delete package using nuget.exe



  • I have the latest version of proget. I have in the past used nuget.exe to delete packages from my feeds. This no longer works. (though it does report success in one of the examples)
    Two examples of how I'm trying to delete:

    $ ./nuget.exe delete My.Nuget.Package 8888.8888.6244 deleter:deleter -Source http://my.nuget.server -verbosity detailed

    NuGet Version: 4.7.0.5104
    My.Nuget.Package 8888.8888.6244 will be deleted from the 'http://my.nuget.server'. Would you like to continue? (y/N) y

    WARNING: Deleting My.Nuget.Package 8888.8888.6244 from the 'http://my.nuget.server'.
    DELETE http://my.nuget.server/api/v2/package/My.Nuget.Package/8888.8888.6244
    OK http://my.nuget.server/api/v2/package/My.Nuget.Package/8888.8888.6244 60ms
    My.Nuget.Package 8888.8888.6244 was deleted successfully.

    (This was not deleted successfully. Still exists on the server)

    $ ./nuget.exe delete My.Nuget.Package 8888.8888.6244 deleter:deleter -Source http://my.nuget.server:81 -verbosity detailed

    NuGet Version: 4.7.0.5104
    My.Nuget.Package 8888.8888.6244 will be deleted from the 'http://my.nuget.server:81'. Would you like to continue? (y/N) y

    WARNING: Deleting My.Nuget.Package 8888.8888.6244 from the 'http://my.nuget.server:81'.
    DELETE http://my.nuget.server:81/api/v2/package/My.Nuget.Package/8888.8888.6244
    NotFound http://my.nuget.server:81/api/v2/package/My.Nuget.Package/8888.8888.6244 28ms
    Response status code does not indicate success: 404 (Not Found).
    System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
    at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c.<DeletePackageFromServer>b__22_1(HttpResponseMessage response)
    at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__18`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.Core.Types.PackageUpdateResource.<DeletePackageFromServer>d__22.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.Core.Types.PackageUpdateResource.<DeletePackage>d__21.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Protocol.Core.Types.PackageUpdateResource.<Delete>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.Commands.DeleteRunner.<Run>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at NuGet.CommandLine.DeleteCommand.<ExecuteCommandAsync>d__16.MoveNext()

    Notice the only difference between the two commands is using a port number at the end of the URL. Example is using a user for the APIKEY that has rights to delete. nuget.exe is using an "api/v2" path to attempt deletion, from what I can see, that doesn't exist. I've also tried to use "http://my.nuget.server:81/feeds/feedname" as the -Source, with and without the port number, and get the same results. In previous version, 4,x,x, using the port number was what worked properly.

    Any clue if using nuget.exe for deleting from nuget feeds has changed or is broken? I've tried nearly all of the version of nuget.exe that exist. Any help would be appreciated.

    Thanks

    Product: ProGet
    Version: 5.0.12



  • Looking at the API there is no method to delete a nuget package either. There is for nearly every other kind of package, but not for nuget packages. At least according to the servers API documentation found at

    http://my.nuget.server/api/json?API_KEY=1234

    I have thousands of nuget packages to delete. Not going to do that through the UI...



  • To delete NuGet packages, please refer to the NuGet API.

    Of course you can also use commandline nuget.exe, which is what you seem to have done. But in this case, you do not seem to be using the correct URL/source for ProGet.

    It should be something like, http://my.nuget.server/nuget/Feedname.



  • Hi @ReginaldD, did you manage to bulk-delete packages from your server using inedo API?
    Cheers,


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation