Re: Why did pkg delete mysql80-server here?

From: Naman Sood <mail_at_nsood.in>
Date: Thu, 20 Jul 2023 13:22:29 UTC
Unfortunately I did hit y instead of N, so I've lost that information for now. If this happens again, I'll come back with this info. Thanks!

Thanks,
Naman.
(they/them)

On Thu, Jul 20, 2023, at 05:18, Baptiste Daroussin wrote:
> On Wed, Jul 19, 2023 at 07:07:34PM -0400, Naman Sood wrote:
> > Hi,
> > 
> > I just started using FreeBSD 13.2 for a personal storage server. I had this extremely surprising interaction with pkg today:
> > 
> > nsood@silicon:~ % sudo pkg install rclone
> > Password:
> > Updating FreeBSD repository catalogue...
> > Fetching packagesite.pkg: 100%    7 MiB 465.6kB/s    00:15    
> > Processing entries: 100%
> > FreeBSD repository update completed. 33793 packages processed.
> > All repositories are up to date.
> > New version of pkg detected; it needs to be installed first.
> > The following 1 package(s) will be affected (of 0 checked):
> > 
> > Installed packages to be UPGRADED:
> >         pkg: 1.19.1_1 -> 1.19.2
> > 
> > Number of packages to be upgraded: 1
> > 
> > 8 MiB to be downloaded.
> > 
> > Proceed with this action? [y/N]: y
> > [1/1] Fetching pkg-1.19.2.pkg: 100%    8 MiB   1.7MB/s    00:05    
> > Checking integrity... done (0 conflicting)
> > [1/1] Upgrading pkg from 1.19.1_1 to 1.19.2...
> > [1/1] Extracting pkg-1.19.2: 100%
> > Updating FreeBSD repository catalogue...
> > FreeBSD repository is up to date.
> > All repositories are up to date.
> > The following 2 package(s) will be affected (of 0 checked):
> > 
> > Installed packages to be REMOVED:
> >         mysql80-server: 8.0.32
> > 
> > New packages to be INSTALLED:
> >         rclone: 1.62.2
> > 
> > Number of packages to be removed: 1
> > Number of packages to be installed: 1
> > 
> > The operation will free 138 MiB.
> > 12 MiB to be downloaded.
> > 
> > Proceed with this action? [y/N]: y
> > [1/1] Fetching rclone-1.62.2.pkg: 100%   12 MiB   3.1MB/s    00:04    
> > Checking integrity... done (0 conflicting)
> > [1/2] Deinstalling mysql80-server-8.0.32...
> > [1/2] Deleting files for mysql80-server-8.0.32: 100%
> > ==> You should manually remove the "mysql" user. 
> > ==> You should manually remove the "mysql" group 
> > [2/2] Installing rclone-1.62.2...
> > [2/2] Extracting rclone-1.62.2: 100%
> > You may need to manually remove /usr/local/etc/mysql/my.cnf if it is no longer needed.
> > 
> > It's definitely on me to have not read the message carefully before saying yes, but also extremely unintuitive that installing rclone, presumably an unrelated package, caused mysql80-server to be uninstalled. Reinstalling mysql80-server worked fine, and did not remove rclone, so it wasn't a package conflict. Thankfully the mysqld process in memory kept running while I reinstalled the package so I did not experience any downtime, but I would still like to avoid a heart attack in the future. So can someone explained what I did wrong here that caused mysql80-server to be uninstalled?
> > 
> > Thanks,
> > Naman.
> > (they/them)
> > 
> 
> Very hard to determine, without the debug output, somehow the solver considered
> there was a conflict in the process.
> 
> Partial update (aka installing something on a new repo without upgrading all the
> packages at once) is fragile, and pkg needs to become more robust here.
> 
> I don't know what is the best here, before we were forbidding it and forcing the
> user to update everything. but this was not convenient for plenty of users as
> most of the time it works as expected.
> 
> So yes this a bug on pkg side, usually hard to debug when it happens, if you
> have a reproducible way to make it happen I will be more han happy if you can
> provide me your /var/db/pkg (the whole thing if you hit N instead of y).
> 
> I will then be able to reproduce locally and try to fix.
> 
> Another way to help me is when it happens, hit N and rerun with pkg -o
> DEBUG_LEVEL=4 which will be very verbose and provide me the output so I can
> analyze.
> 
> Best regards,
> Bapt
>