From owner-freebsd-ports@FreeBSD.ORG Wed Nov 19 00:26:22 2014 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 A9D16582; Wed, 19 Nov 2014 00:26:22 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 340BBAFC; Wed, 19 Nov 2014 00:26:22 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x12so1310287wgg.33 for ; Tue, 18 Nov 2014 16:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4/gRNVUTtJK1b/undXDMXiGbrbzyzw1WqpFXxYcmmY8=; b=qsE0pBnTmpTggbg4qZ1DFNjSE0963+xiJQSHid+86yZ8XZnP2pf8/dFmMCB0tQmfYr 6nKpnaM0bXxeBfsPICqi7f5nNeoWV9rkObfwhbZuhOQ6EUPPqSwmjMDo52nNdtmEmbFS 8tvlOtWp4QFmxw5jTx3v0PWwv51NyyV7t2O8JCE8uM/MXvJLbzPLwKe4o1UxfPsJTBcn DE0JmeRuX9Nyj52cGdYjhMUA0Y4dg8QEYfdrI3z3HP/zd/fKZSOifYoBwfCr9+KQZ/1+ cn7JyIIObJ4SxKUa/zpPJERWcUkqUTz6XF+fDJWtcESqLuWxT26pMBQfUh51ujQ+oCYC LY3g== X-Received: by 10.195.11.6 with SMTP id ee6mr53012992wjd.95.1416356780661; Tue, 18 Nov 2014 16:26:20 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id cz3sm65342wjb.23.2014.11.18.16.26.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 16:26:19 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 19 Nov 2014 01:26:17 +0100 From: Baptiste Daroussin To: Chris H Subject: Re: How to recover local.sqlite (pkg(8) problem) Message-ID: <20141119002617.GO48896@ivaldir.etoilebsd.net> References: <61ee02eda8e8d3c86fadc175453ffb68@ultimatedns.net> <20141119002126.GN48896@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hXth9cGL35Nvpk4x" Content-Disposition: inline In-Reply-To: <20141119002126.GN48896@ivaldir.etoilebsd.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: FreeBSD STABLE , FreeBSD ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 00:26:22 -0000 --hXth9cGL35Nvpk4x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 19, 2014 at 01:21:27AM +0100, Baptiste Daroussin wrote: > On Tue, Nov 18, 2014 at 04:18:33PM -0800, Chris H wrote: > > Greetings, > > During the building of a meta-port in the ports tree. My > > /var/db/pkg/local.sqlite database became corrupted. I > > spent some time, both with the pkg man pages, and with > > sqlite3 itself attempting to use one of the backups > > created by periodic(8). Located in /var/backups. But all > > to no avail. For the record, I used > > pkg backup -r /var/backup/pkg.sql.xz, as well as unpacking > > a copy of that file, and issuing the same. Moving (renaming) > > the corrupted database aside, prior to. I also issued > > sqlite3 local.sqlite > > followed by > > read pkg.sql > > and > > quit > > went w/o issue. But issuing > > pkg info > > emitted several error messages. Which appeared to be from > > sqlite3(8). > > This is on RELENG_9, w/source, and kernel world from about > > 1 week ago. I know that the backup is in good shape, as I > > had been using it w/o issue. > > Is this a bug? > >=20 > > Thank you for all your time, and consideration. > >=20 > This is really surprising and first time this can of things get reported,= can > you provide me the the pkg.sql.xz file? >=20 > Are you runing on nfs? if yes start the lockd first (pkg should fallback = on a > working solution (I need to check for pkg backup) but sqlite3 cli tool do= es not > and sqlite3 cli tool on nfs without proper locking is known to corrupt da= tabase > file. >=20 > Best regards, > Bapt Right checked I forgot to add the lock workaround on pkg backup I'll fix in 1.4.0 in the mean time you just have to start lockd (service lockd start) a= nd the recovery will just work. It might have been corrupted because a background backup (without the proper lock workaround) happened at the same time you were via the ports tree runn= ing the pkg command. Best regards, Bapt --hXth9cGL35Nvpk4x Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRr46kACgkQ8kTtMUmk6EzqBQCgpNhn7amV9M3kLCCGW2Gt4Zle 9VwAnjUBZdn5hhxIm06yEgQeThNqXgla =4yjF -----END PGP SIGNATURE----- --hXth9cGL35Nvpk4x--