From owner-freebsd-ports@FreeBSD.ORG Mon Aug 5 15:38:37 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77143819 for ; Mon, 5 Aug 2013 15:38:37 +0000 (UTC) (envelope-from mueller6724@bellsouth.net) Received: from nm27.access.bullet.mail.bf1.yahoo.com (nm27.access.bullet.mail.bf1.yahoo.com [216.109.114.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17B1C23BA for ; Mon, 5 Aug 2013 15:38:36 +0000 (UTC) Received: from [66.196.81.163] by nm27.access.bullet.mail.bf1.yahoo.com with NNFMP; 05 Aug 2013 15:36:18 -0000 Received: from [98.138.84.183] by tm9.access.bullet.mail.bf1.yahoo.com with NNFMP; 05 Aug 2013 15:36:18 -0000 Received: from [127.0.0.1] by smtp105.sbc.mail.ne1.yahoo.com with NNFMP; 05 Aug 2013 15:36:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bellsouth.net; s=s1024; t=1375716978; bh=G698XkVma+9Uf5FgwlwCdbjfCqLs6jgreDtH+ngOrcM=; h=X-Yahoo-Newman-Id:Message-ID:Date:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:From:To:Subject; b=3GlsMfbBFO+Ny6yOyNAtHZOHuI0jDwn/Oa3sK8XhUrKq+VgkH9dkbtLQrJQSM6Hr00u+Cl2WEEr6ty4USfGlRvIBM29IUrB9HFhE0RDypVZRvH1kOGYGAUt74LfarjEJob9fnAY6qMCpMUV6AchWCi0e6OoNykGqh46Quz7IgRM= X-Yahoo-Newman-Id: 322389.43675.bm@smtp105.sbc.mail.ne1.yahoo.com Message-ID: <322389.43675.bm@smtp105.sbc.mail.ne1.yahoo.com> Date: Mon, 5 Aug 2013 15:36:18 +0000 (UTC) X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: pTcuaBYVM1n2fTlzUpuDfqJOaWPXyciqNStKgz0p5_X96Bi zHptd6ELHc_R2S90xNeMD7sipMr611jT0dFgl_T1XDyuKSAJhl1k9jGRi3qT KWFY8XY7mJMoXW_Sxlv8BZ6g3ThwCSzocDFbj1pLfzFHIRB2KURSE0WyrmRg A91mohslT_v5dMhQUWoG9AbZVrueLJq0dk2oprt00IZlsvu8Wkph1Qmc.0_O YTV30rQqEHAy6yGJp0TEP.MOIf6oAITMd5e9mDKkLsaQsYWnHgQPvpzVcHNT OQIMwZtnem1PsTVqzHWtlmglFIHSW.PXviTLA3fTZRps9tyOZx4yyuLpwpiJ D02wnAC3Yp6hsYWTlLm_Kqgm3K2I38iMdhaGgrEiP985OX5uXCH2P8yPwyDo f8BztXXlpDf5Z19_FgSCHL1derFoDU4ad1fy0ZaRLIUJcO129OuXK3oCgXgm h.0kjF8WQMHoRTfc.RPt4ScDpkMYcWNeSEdgDRSaNQEg0CVi0vuFhixlC4gG m20JfjzhHn26v0obe6Bz._rTZ4iAMO_AqTuASs7s.kddzfJteiChLExiy_m0 .SP5auQJG1D.L03RSortGWTFOvjOg3zlfj5y.4WvQgB9FKHFJ5FzPVgzWopK 9TQPtHR_kj61eOUO5R7.Dg8ryM.1hIQD09gSHrC9dHDk65IwJxpghVMyIbhB g.vyhFOc- X-Yahoo-SMTP: Kz_aW1.swBBYof3zAD7.RWzXz9ZAQVDMml1VADsbgPT4Kq79LC0- X-Rocket-Received: from localhost (mueller6724@74.130.200.176 with plain) by smtp105.sbc.mail.ne1.yahoo.com with SMTP; 05 Aug 2013 15:36:18 +0000 UTC From: "Thomas Mueller" To: freebsd-ports@freebsd.org Subject: Re: libpkg, sqlite and database problems prevent building any packages X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2013 15:38:37 -0000 On 05/08/2013 14:30, Thomas Mueller wrote: > I could see my pkg client is out of date, but how do I update it? > > Attempts to update all gave me those error messages. Installation fails. Matthew Seaman responded: > Your package database has got into an inconsistent state. pkg(8) is > attempting to auto-update the schema to the latest version, but failing > because it's trying to remove an 'infos' column from a table where that > column has apparently already been removed. (Likely this situation has > come about because pkg got killed in the middle of doing this update > previously.) > How happy are you to get down'n'dirty with the source code and running > SQL from the command line? If you look at the updates pkg is attempting > to run shown here: > https://github.com/freebsd/pkg/blob/master/libpkg/private/db_upgrades.h > would you be capable of looking at the DB schema, working out which of > those updates had been applied, aplying any outstanding ones by hand and > then setting the user version to 19 by: > sql> PRAGMA user_version = 19 ; ? > If not, check in /var/backups for a good copy of your local.sqlite > database and try and restore from there. Unfortunately, there's no > guarantee that any backup copy doesn't have the same inconsistencies as > your live copy. > We need to make pkg(8) databases more resilient to the effects of SIGHUP > or similar while they are elbows-deep in the bowels of the DB schema... Trying to do what you suggest would in all likelihood be an exercise in futility, especially when I am very tired from being unable to sleep. I didn't realize pkgng was so non-sturdy. I wonder what would happen if I delete /var/db/pkg/local.sqlite, or perhaps better, move it to another location and name so as not to burn my bridges. But anything so I can upgrade pkg. Does pkgng have no means of recovery? Can pkg regenerate a database, and from what? My /var/backups on the USB-stick 9.2-BETA2 amd64 installation shows total 280 -rw-r--r-- 1 root wheel 1674 Apr 2 2012 aliases.bak -rw-r--r-- 1 root wheel 436 Apr 2 2012 group.bak -rw------- 1 root wheel 1500 Apr 2 2012 master.passwd.bak -rw-r--r-- 1 root wheel 269144 Dec 13 2012 pkgdb.bak.tbz -rw-r--r-- 1 root wheel 129 Jul 16 2012 pkgdb.bak.tbz.2 pkg.bak.tbz looks like the database from the old format. My /var/backups on the USB-stick 9.1-STABLE i386 installation shows total 140 -rw-r--r-- 1 root wheel 1688 Jan 20 2013 aliases.bak -rw-r--r-- 1 root wheel 1674 Jun 6 2012 aliases.bak2 -rw-r--r-- 1 root wheel 481 Jan 17 2013 group.bak -rw-r--r-- 1 root wheel 449 Jul 13 2012 group.bak2 -rw------- 1 root wheel 1761 Jan 17 2013 master.passwd.bak -rw------- 1 root wheel 1500 Jun 6 2012 master.passwd.bak2 -rw-r--r-- 1 root wheel 8524 May 28 03:01 pkgdb.bak.tbz -rw-r--r-- 1 root wheel 130 Jan 19 2013 pkgdb.bak.tbz.2 -rw-r--r-- 1 root wheel 100352 May 28 04:29 pkgng.db pkgng.db looks like the new format, but that was before I built wine and dependencies. Tom