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!

    pgutil upack remove wiped most of my home folder.

    Scheduled Pinned Locked Moved Support
    pgutil
    3 Posts 2 Posters 25 Views
    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.
    • R Offline
      rickard.hagelin_7259
      last edited by rickard.hagelin_7259

      I wanted to share a little adventure I had with your pgutil tool version 2.1.2.0 on Ubuntu 24.04.

      What Happened:

      I was debugging a pipeline and wanted to try it locally, I ran:

      pgutil upack install --package=prod-tool --version=2.0.6 --feed=tools --target=.
      

      Here I fucked up by installing to . which was currently my home folder.
      I then wanted to remove it:

      pgutil upack remove --package=prod-tool
      

      Much to my surprise, instead of just removing the package, it wiping out almost everything in my home folder. It even managed to remove symlinks in my .config folder and folders like Downloads.

      Command Output:

      pgutil upack remove --package=prod-tool
      
      Removing package from registry...
      
      Deleting content of /home/rhagelin.creatorctek.local...
      
      Unhandled exception. System.IO.IOException: Directory not empty: '/home/rhagelin.creatorctek.local/.config/teams-for-linux/Partitions/teams-4-linux'
      
         at System.IO.FileSystem.RemoveDirectoryRecursive(String)
      
         at System.IO.FileSystem.RemoveDirectory(String, Boolean)
      
         at System.IO.DirectoryInfo.Delete(Boolean)
      
         at PgUtil.Program.UpackCommand.RemoveAsync(RegisteredUniversalPackage package, UniversalPackageRegistry registry, CancellationToken cancellationToken)
      
         at PgUtil.Program.UpackCommand.RemoveCommand.ExecuteAsync(CommandContext context, CancellationToken cancellationToken)
      
         at ConsoleMan.Command.ExecuteAsync(String[])
      
         at PgUtil.Program.Main(String[] args)
      
         at PgUtil.Program.<Main>(String[] args)
      
      zsh: IOT instruction (core dumped)
      
      pgutil upack remove --package=prod-tool
      

      Thankfully it it stopped there.

      I did not dare to test it with the lasted version of pgutil,
      While this mishap was probably due to my user error, the enthusiastic removal of my home folder's contents seemed worth reporting. :)

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

        @rickard-hagelin_7259 not a good surprise 😧

        Definitely open to ideas, but the general use case for these commands is like:

        $> pgutil upack install --package=prod-tool --version=2.0.6 --feed=tools --target=/var/prod-tool
        
        $> pgutil upack remove --package=prod-tool
        

        Do you think that clarifying that remove deletes all the files would have helped?

        1 Reply Last reply Reply Quote 0
        • R Offline
          rickard.hagelin_7259
          last edited by rickard.hagelin_7259

          Yes, I do understand that is was user error. Not sure what a good solution for it would be.
          Showing a dry-run or a confirmation prompt before the deletion might have helped in my case, but that is just annoying when using the tool as intended 😋
          Or perhaps preventing me from installing it in a "shared" folder is better, if it should always be installed in a new/empty folder anyway?

          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