Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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!

    Error deleting Debian package from API

    Scheduled Pinned Locked Moved Support
    7 Posts 3 Posters 21 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ScatiS Offline
      Scati
      last edited by

      Hi,
      I'm trying to remove packages from a Debian feed using the HTTP Request described in the API documentation: https://docs.inedo.com/docs/proget/reference-api/proget-api-packages/proget-api-packages-delete#http-request-specification
      But it always returns an error 400 - Missing required qualifier component: distro, despite my using the purl returned by the server, as it's described here: https://docs.inedo.com/docs/proget/reference-api/proget-api-packages#using-a-purl-to-identify-a-package

      I'm making this POST request https://serverip/api/packages/unstable-lin/delete?purl=pkg:deb/scatimysqlcluster@7.3.0.0-0.202406122314.6df3a85167?arch=amd64&component=scati&distro=jammy from a python script.
      It doesn't seem to be a code error because the same script with a Windows purl works perfectly https://serverip/api/packages/unstable-win/delete?purl=pkg:nuget/scativision@7.3.5-2024-06-11

      Thanks a lot.

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @Scati
        last edited by

        Hi @Scati ,

        The request looks OK to me on a first glance, but I wonder... did you try using pgutil to delete the package?

        pgutil packages delete --feed=myDebianFeed --package=myDebianPackage --version=2.3.4 --component=main --distro=stable --arch=amd64

        I'm not sure if you're using the latest version of ProGet, but I think there was a bug regarding this.

        Thanks,
        Alana

        1 Reply Last reply Reply Quote 0
        • ScatiS Offline
          Scati
          last edited by

          Hi @atripp,
          using pgutil works OK:

          pgutil packages delete --feed=unstable-lin --package=scatimysqlcluster --version=7.3.0.0-0.202406122314.6df3a85167 --component=scati --distro=jammy --arch=amd64
          
          Deleting scatimysqlcluster 7.3.0.0-0.202406122314.6df3a85167 arch=amd64&component=scati&distro=jammy from unstable-lin feed...
          Package deleted.
          

          Although I'm not sure if it's the same, as pgutil doesn't really use a purl. In any case, we'd rather use the HTTP API to keep everything contained within the script code.

          Thanks.

          atrippA 1 Reply Last reply Reply Quote 0
          • atrippA Offline
            atripp inedo-engineer @Scati
            last edited by

            Hi @Scati,

            pgutil will construct an purl using this method:
            https://github.com/Inedo/pgutil/blob/c5b5e3733390b9e5dfb07752e36a3f6efaaa0f9c/pgutil/Packages/QualifierOptions.cs#L26

            So I'm thinking there's something off about your url, but I can't spot it. Maybe try

            https://serverip/api/packages/unstable-lin/delete?purl=pkg:deb/scatimysqlcluster@7.3.0.0-0.202406122314.6df3a85167?arch=amd64&distro=jammy&component=scati

            That appears to be the order that pgutil uses...

            Cheers,
            Alana

            1 Reply Last reply Reply Quote 0
            • ScatiS Offline
              Scati
              last edited by

              Hi again @atripp,
              I'm afraid it doesn't work by changing the order either. I tried with a simpler package version, not a prerelease one, and it fails in the same way:

              ERROR - Error '400 Client Error: Bad Request for url: https://serverip/api/packages/unstable-lin/delete?purl=pkg:deb/scatinat@7.2.2.0-1?arch=amd64&distro=jammy&component=scati'
              

              As I mentioned, I'm just catching the purl from a previous API request. Would you have any other suggestions to try?

              Thanks.

              1 Reply Last reply Reply Quote 0
              • gdivisG Offline
                gdivis inedo-engineer
                last edited by

                Hi @Scati

                Working with package qualifiers and purls is a little confusing with the API because they are already in a URL encoded query string format and you have to encode them again to be passed in through the API url. If you url encode what you are passing in to purl= then it should work:

                https://serverip/api/packages/unstable-lin/delete?purl=pkg%3Adeb%2Fscatinat%407.2.2.0-1%3Farch%3Damd64%26component%3Dscati%26distro%3Djammy

                The complexity of dealing with these is the reason we added all of the extra arguments and handling in pgutil to build these qualifiers out more easily.

                Hope this helps!
                -Greg

                1 Reply Last reply Reply Quote 0
                • ScatiS Offline
                  Scati
                  last edited by Scati

                  Hi @gdivis,
                  I've tried encoding the purl URL, and it works on both Windows and Linux, without having to interchange the distro and component order. However, it's a little strange that NuGet package purls work whether they are encoded or not.
                  Anyway, I'm going to encode the URL in the code.

                  Thank you very much.

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 1 / 1
                  • First post
                    Last post
                  Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation