From owner-freebsd-ports@FreeBSD.ORG Tue May 12 06:59:51 2015 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A39F56FF for ; Tue, 12 May 2015 06:59:51 +0000 (UTC) Received: from udns.ultimatedns.net (unknown [IPv6:2602:d1:b4d6:e600:4261:86ff:fef6:aa2a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A68F1FD6 for ; Tue, 12 May 2015 06:59:51 +0000 (UTC) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.14.9/8.14.9) with ESMTP id t4C709m5035736; Tue, 12 May 2015 00:00:15 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) To: freebsd-ports@freebsd.org, Scott Bennett In-Reply-To: <201505120617.t4C6HkA3019096@sdf.org> References: <201505120617.t4C6HkA3019096@sdf.org> From: "Chris H" Subject: Re: damage to pkg's sqlite data base Date: Tue, 12 May 2015 00:00:15 -0700 Content-Type: text/plain; charset=UTF-8; format=fixed MIME-Version: 1.0 Message-id: <0dcbdcb9fdfdebc53a2563b11494f61b@ultimatedns.net> Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2015 06:59:51 -0000 On Tue, 12 May 2015 01:17:46 -0500 Scott Bennett wrote > For nearly two weeks I've been stymied by an apparently damaged record > in the sqlite data base used by pkg(8) and pkg-static(8). Unfortunately, > it is a record for a port that is depended upon rather heavily, lang/gcc. > lang/gcc compiled and linked just fine, but any attempt to install the result > ends up like this. > > ===> Checking if gcc already installed > ===> Registering installation for gcc-4.8.4_3 > Installing gcc-4.8.4_3... > pkg-static: sqlite error while executing iterator in file > pkgdb_iterator.c:931: database disk image is malformed pkg-static: sqlite > error while executing INSERT OR REPLACE INTO files (path, sha256, package_id) > VALUES (?1, ?2, ?3) in file pkgdb.c:1722: database disk image is malformed > *** Error code 70 > > Stop. > make: stopped in /usr/ports/lang/gcc > > I'm not familiar with sqlite commands, nor with the structure of the > pkg data base, nor any of several other relevant topics. But I do have > questions: > > 1) how might the damage have happened? > > 2) how might such an event be avoided/prevented in the future? > > 3) most urgently, how can I *fix* it? You should get a backup made on the nightly cron(8) (periodic(8)). It'll be located in /var/backups Off the top of my head I can't remember which of the 2, is which. But a simple size comparison should tell the tale. :) Simply rename your (now) corrupt db, and copy the backup over. I ran into this problem as well, and this was how I was finally able to overcome it. Hope this helps! --Chris > > 4) I was unable to find any instructions for recreating a pkg data > base if the data base gets damaged/destroyed. Is there a way to > do that that I missed? > > Thanks again for any help here. > > > Scott Bennett, Comm. ASMELG, CFIAG > ********************************************************************** > * Internet: bennett at sdf.org *xor* bennett at freeshell.org * > *--------------------------------------------------------------------* > * "A well regulated and disciplined militia, is at all times a good * > * objection to the introduction of that bane of all free governments * > * -- a standing army." * > * -- Gov. John Hancock, New York Journal, 28 January 1790 * > ********************************************************************** > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"