From: Denny Date: 15:32 on 07 Mar 2007 Subject: RPM: Random Package Manglement AKA: the story of how work's main database server got an unexpected MySQL upgrade last night. So I get fed up with mysql_setpermissions not working on our CentOS database server. "Time to get that fixed", I think. Firstly, a quick recap of the error message; apparently it bombs out for lack of the perl DBD::mysql modules. "Easy!" I think, and try to install it from CPAN, before remembering that this always fails due to lack of the MySQL devel libs. Hrm. So, on to plan B, install those libs or the perl module itself from RPM packages. Secondly then, a quick look at what's already installed on the box: [root@d01-olg ~]# rpm -qa | grep -i mysql MySQL-server-standard-5.0.21-1.rhel4 MySQL-client-standard-5.0.21-1.rhel4 MySQL-shared-standard-5.0.21-1.rhel4 [root@d01-olg ~]# rpm -qa | grep -i perl perl-Filter-1.30-6 perl-5.8.5-24.RHEL4 perl-DBI-1.40-8 Thirdly, a quick google for what's available. Aha, perl-DBD-MySQL, just the thing. Now this is where it goes a bit wrong, so pay attention: [root@d01-olg ~]# up2date perl-DBD-MySQL Fetching rpm headers... ######################################## Name Version Rel ---------------------------------------------------------- perl-DBD-MySQL 2.9004 3.1 Testing package set / solving RPM inter-dependencies... Downloading headers to solve dependencies... ######################################## perl-DBD-MySQL-2.9004-3.1.i ########################## Done. mysql-4.1.20-1.RHEL4.1.i386 ########################## Done. Preparing ########################################### [100%] Installing... 1:mysql warning: /etc/my.cnf created as /etc/my.cnf.rpmnew ########################################### [100%] 2:perl-DBD-MySQL ########################################### [100%] The following packages were added to your selection to satisfy dependencies: Name Version Release -------------------------------------------------------------- mysql 4.1.20 1.RHEL4.1 Wait, what? You did /what/?! Fourth step then, would be to run in circles screaming and panicking. Fifth, check that it just did what it looked like it just did: [root@d01-olg downloads]# rpm -qa | grep -i mysql perl-DBD-MySQL-2.9004-3.1 MySQL-shared-standard-5.0.21-1.rhel4 mysql-4.1.20-1.RHEL4.1 It did. To install the requested perl module, with no prompting whatsoever it has downgraded the MySQL server from 5.0 to 4.1, and then removed any MySQL client packages that didn't fit in with this master plan. Sixth, panic some more. Intersperse with a lot of swearing. Seventh, check the mysql data dir is still there: [root@d01-olg ~]# cd /var/lib/ [root@d01-olg lib]# du -sh mysql/ 13G mysql/ It is. Start breathing again. Eighth, backup the mysql data dir before anything else happens: [root@d01-olg lib]# cp -a mysql/ mysql.20070306 [root@d01-olg lib]# Ninth, download the latest MySQL-5.0 packages from mysql.com: [root@d01-olg downloads]# ll total 28632 -rw-r--r-- 1 root root 6908341 Oct 26 20:06 MySQL-client-standard-5.0.27-0.rhel4.i386.rpm -rw-r--r-- 1 root root 7110183 Oct 26 20:07 MySQL-devel-standard-5.0.27-0.rhel4.i386.rpm -rw-r--r-- 1 root root 13561014 Oct 26 20:10 MySQL-server-standard-5.0.27-0.rhel4.i386.rpm -rw-r--r-- 1 root root 1685652 Oct 26 20:11 MySQL-shared-standard-5.0.27-0.rhel4.i386.rpm Tenth, install them: [root@d01-olg downloads]# rpm -Uvh MySQL-* warning: MySQL-client-standard-5.0.27-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 Preparing... ########################################### [100%] 1:MySQL-shared-standard ########################################### [ 25%] 2:MySQL-client-standard ########################################### [ 50%] 3:MySQL-devel-standard ########################################### [ 75%] 4:MySQL-server-standard ########################################### [100%] Eleventh, connect to the database and look for the data: [root@d01-olg downloads]# mysql -uroot -p Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 to server version: 5.0.27-standard mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | client1 | | client1_test | | client2 | | client2_test | [...] Twelfth, start breathing again (apparently stopped again somewhere around step ten). *head-desk* Jesus fucking Christ, what the FUCKING fuck? Call that package management?? "Friends don't let friends run Red Hat. Or cheap Red Hat clones."
From: Aaron Crane Date: 16:10 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement Denny writes: > Installing... > 1:mysql warning: /etc/my.cnf created as /etc/my.cnf.rpmnew > ########################################### [100%] > 2:perl-DBD-MySQL ########################################### [100%] > The following packages were added to your selection to satisfy dependencies: > > Name Version Release > -------------------------------------------------------------- > mysql 4.1.20 1.RHEL4.1 Wow. I particularly hate how it says "by the way, I've just broken your system; was that OK?" rather than "here's what I'm about to downgrade; would that be OK?". Really, though. How does software like that escape into the wild?
From: Martin Ebourne Date: 16:42 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement Denny <denny@xxxxxxxxxxx.xxx> wrote: > [root@d01-olg ~]# up2date perl-DBD-MySQL > > Fetching rpm headers... > ######################################## > > Name Version Rel > ---------------------------------------------------------- > perl-DBD-MySQL 2.9004 3.1 > > Testing package set / solving RPM inter-dependencies... > > Downloading headers to solve dependencies... > ######################################## > perl-DBD-MySQL-2.9004-3.1.i ########################## Done. > mysql-4.1.20-1.RHEL4.1.i386 ########################## Done. > Preparing ########################################### [100%] > > Installing... > 1:mysql warning: /etc/my.cnf created as > /etc/my.cnf.rpmnew > ########################################### [100%] > 2:perl-DBD-MySQL ########################################### [10= 0%] > The following packages were added to your selection to satisfy dependencie= s: > > Name Version Release > -------------------------------------------------------------- > mysql 4.1.20 1.RHEL4.1 > > > Wait, what? You did /what/?! Hey, you can't blame RPM for something up2date did. Now up2date is demonstrably one of the worst package dependency =20 resolvers of all time (you just went a good way to demonstrating why) =20 and should be subjected to all the vitriol you can give it. Focus the =20 hate where it is most deserved. Cheers, Martin.
From: imacat Date: 16:59 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement --===[PGP/MIME_RFC2015]===45EEEF6E.1B82=== Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit On Wed, 07 Mar 2007 15:32:22 +0000 Denny <denny@xxxxxxxxxxx.xxx> wrote: > [root@d01-olg ~]# rpm -qa | grep -i mysql > MySQL-server-standard-5.0.21-1.rhel4 > MySQL-client-standard-5.0.21-1.rhel4 > MySQL-shared-standard-5.0.21-1.rhel4 > [root@d01-olg ~]# up2date perl-DBD-MySQL > The following packages were added to your selection to satisfy dependencies: > mysql 4.1.20 1.RHEL4.1 Well, up2date does not recognize the foreign RPM you downloaded from the MySQL AB website. It only knows the so called "legal" RPMs from the RPM repository server of your distribution. So, it has not idea that the installing "lower-cased" "mysql" 4.1 conflicts with the existing "MySQL" 5.0. I'm not using RPM, but Debian apt. I do not install foreign apt packages except for those came from the Debian repository servers, for the same reason. I do not want to confuse apt with something not within its knowledge. Computers are stupid. Be sympathetic, and do not do things too complicated to confuse them. -- Best regards, imacat ^_*' <imacat@xxxx.xxxxxx.xxx.xx> PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt <<Woman's Voice>> News: http://www.wov.idv.tw/ Tavern IMACAT's: http://www.imacat.idv.tw/ TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug --===[PGP/MIME_RFC2015]===45EEEF6E.1B82=== Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iEYEABECAAYFAkXu720ACgkQi9gubzC5S1yvvACfcHimZZG+tVV43ptFHpz6dHKK auQAniZtQzN8OVipNLi1VMlC/StgTQ0i =Rj+Z -----END PGP SIGNATURE----- --===[PGP/MIME_RFC2015]===45EEEF6E.1B82===--
From: Martin Ebourne Date: 17:15 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement imacat <imacat@xxxx.xxxxxx.xxx.xx> wrote: > Well, up2date does not recognize the foreign RPM you downloaded from > the MySQL AB website. It only knows the so called "legal" RPMs from the > RPM repository server of your distribution. So, it has not idea that > the installing "lower-cased" "mysql" 4.1 conflicts with the existing > "MySQL" 5.0. Funny, apt-rpm, smart, and yum all manage such a scenario. There's no excuse for what up2date did, it was evil all the way. The more stupid package managers (yes, yum) will say can't install X because of conflict with Y. The 'smart'er ones will always try to let you do what you ask, but give suitable warnings and ask for appropriate confirmation. Of course, up2date was never meant to be a proper package manager and even Red Hat gave up on it as a POS. Cheers, Martin.
From: jrodman Date: 17:18 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement On Thu, Mar 08, 2007 at 12:59:45AM +0800, imacat wrote: > On Wed, 07 Mar 2007 15:32:22 +0000 > Denny <denny@xxxxxxxxxxx.xxx> wrote: > > [root@d01-olg ~]# rpm -qa | grep -i mysql > > MySQL-server-standard-5.0.21-1.rhel4 > > MySQL-client-standard-5.0.21-1.rhel4 > > MySQL-shared-standard-5.0.21-1.rhel4 > > [root@d01-olg ~]# up2date perl-DBD-MySQL > > The following packages were added to your selection to satisfy dependencies: > > mysql 4.1.20 1.RHEL4.1 > > Well, up2date does not recognize the foreign RPM you downloaded from > the MySQL AB website. It only knows the so called "legal" RPMs from the > RPM repository server of your distribution. So, it has not idea that > the installing "lower-cased" "mysql" 4.1 conflicts with the existing > "MySQL" 5.0. Well, this is a nice theory to shelter the poor crippled up2date, but it doesn't wash. Since up2date (as you can see in the original email) _removed_ the 5.0 MySQL. Removing packages without warning that it doesn't think are the same is not more excusable than downgrading packages without warning. > I'm not using RPM, but Debian apt. I do not install foreign apt > packages except for those came from the Debian repository servers, for > the same reason. I do not want to confuse apt with something not within > its knowledge. I don't love apt. Just today apt started segfaulting on update. (Debian people contacting tried to claim I had BAD RAM.) Apparently my cache size wasn't large enough to properly generate a file, and then later when it tried to read it, the file wasn't complete, and it fell over saying error, segfault, line number (with two numbers). BUT! apt does not remove packages without getting your explicit permission, even if those packages were installed behind its back. And for this I am grateful. -josh
From: imacat Date: 17:28 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement --===[PGP/MIME_RFC2015]===45EEF636.7D08=== Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit On Thu, 08 Mar 2007 00:59:45 +0800 imacat <imacat@xxxx.xxxxxx.xxx.xx> wrote: > On Wed, 07 Mar 2007 15:32:22 +0000 > Denny <denny@xxxxxxxxxxx.xxx> wrote: > > [root@d01-olg ~]# rpm -qa | grep -i mysql > > MySQL-server-standard-5.0.21-1.rhel4 > > MySQL-client-standard-5.0.21-1.rhel4 > > MySQL-shared-standard-5.0.21-1.rhel4 > > [root@d01-olg ~]# up2date perl-DBD-MySQL > > The following packages were added to your selection to satisfy dependencies: > > mysql 4.1.20 1.RHEL4.1 > I'm not using RPM, but Debian apt. I do not install foreign apt > packages except for those came from the Debian repository servers, for > the same reason. I do not want to confuse apt with something not within > its knowledge. Oh, sorry I made a mistake. Debian apt is obviously smarter in that it always pause, ask and wait for your answer if it needs to do something more than what you were ordering. In this case, it shall wait for your answer if it is going to install the additional mysql 4.1 that you weren't asking in the beginning, even that it does not know mysql 4.1 and MySQL 5.0 conflicts. I do not know YUM, but obviously RPM and up2date are no option. -- Best regards, imacat ^_*' <imacat@xxxx.xxxxxx.xxx.xx> PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt <<Woman's Voice>> News: http://www.wov.idv.tw/ Tavern IMACAT's: http://www.imacat.idv.tw/ TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug --===[PGP/MIME_RFC2015]===45EEF636.7D08=== Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iEYEABECAAYFAkXu9jYACgkQi9gubzC5S1z9YACfSdaVoqiotJObDErxJn895YLP bfkAnA/lIAeYqiVCJE50tGWGp9FIEAF8 =5mqZ -----END PGP SIGNATURE----- --===[PGP/MIME_RFC2015]===45EEF636.7D08===--
From: Denny Date: 18:38 on 07 Mar 2007 Subject: Re: RPM: Random Package Manglement On Thu, 2007-03-08 at 01:28 +0800, imacat wrote: > Oh, sorry I made a mistake. Debian apt is obviously smarter in that > it always pause, ask and wait for your answer if it needs to do > something more than what you were ordering. > > In this case, it shall wait for your answer if it is going to > install the additional mysql 4.1 that you weren't asking in the > beginning, even that it does not know mysql 4.1 and MySQL 5.0 conflicts. As others have already pointed out, if up2date didn't know that MySQL and mysql are the same thing then why did it remove MySQL when it installed mysql? If it didn't realise that they were the same, then it just removed a random package from my system - even more hateful! And yes, an 'Are you sure?' question would have been nice before it did anything additional - let alone a downgrade, which one would generally expect to come with a fairly noticeable warning as well as the bail-out opportunity.
Generated at 10:28 on 16 Apr 2008 by mariachi