I'm short on time right now, so I'll defer my replies to Andrew Clark
and Chris H until late tonight after I (hope to) have had a chance to try
out Andrew's suggested procedure. I do have sqlite installed, though (see
far below).
Chris? You already responded to my question 4) above, which answers
your question. Why are you now asking this? Any data base intended for
production use MUST be accompanied by a method of recreating it before
the data base goes into production. This has been the case as long as
data bases have been used. The Wallendas may walk without nets between
skyscraper roofs, but I assure you that a) not all of them arrive at the
intended destinations and b) normal mortals have a different perspective
on that sort of risk.
Further, if portmaster produces that output *from the corrupted data
base*, then it stands to reason that other cases of corruption that differed
in particulars from this one might prevent portmaster from providing said
output.
> > >
> Coming very late to the discussion I would like to understand what lead you to a
> broken database, from what I am aware of the only way to end up with a broken db
> is using pkg over nfs without rpc lock properly running (note that the default
>
> nfs client service on freebsd does not start rpc lock...)
>
> pkg work around this case by detecting the filesystem it is running on and
> changing the locking system it uses when running on network filesystem so this
> problem cannot in theory happen anymore even if one forgot to start rpc lockd.
>
> It remains however one case where this can happen: it is one the host is running
> over nfs and it starts a jail, in that case, the jail does not know it is
> running over nfs so pkg cannot know it needs to switch the locking system.
>
> Are you in one of those situation, if not can you describe a a bit more your
> system?
FreeBSD hellas 10.1-STABLE FreeBSD 10.1-STABLE #54 r282368: Sun May 3 15:48:37 CDT 2015 bennett@hellas:/usr/obj/usr/src/sys/hellas amd64
I have only one machine running these days, so there is no NFS. At
present, I have no jails set up.
Here are data concerning the relevant drive, which is the boot drive.
There are many other file systems on this machine, but they all involve
external devices and are unrelated to this issue, except for /buildwork,
where WRKDIRPREFIX=/buildwork/ports and CCACHE_DIR=/buildwork/ccache. The
same sort of information for /buildwork is included below.
/dev/mirror/fbsds1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/mirror/fbsds1d on /var (ufs, local)
/dev/mirror/fbsds1e on /usr (ufs, local, soft-updates)
/dev/mirror/fbsds1f on /usr/local (ufs, local)
/dev/mirror/fbsds3a on /usr/home (ufs, local)
/dev/mirror/fbsds3d on /usr/ports (ufs, local, soft-updates)
/dev/ufs/stripework on /buildwork (ufs, local, soft-updates)
mirror/fbsds1 COMPLETE ada0s1 (ACTIVE)
mirror/fbsds3a COMPLETE ada0s3a (ACTIVE)
mirror/fbsds3d COMPLETE ada0s3d (ACTIVE)
ufs/stripework N/A stripe/5x15g1
stripe/5x15g1 UP da0p5
da2p5
da3p5
da5p5
da6p5
Note that the mirrors listed above have only one device in each. At one
point a few weeks ago, there were two devices in each for a bit under
eight hours until the brand-new second drive failed. Unfortunately, it
turns out that the manufacturer does not provide any support for its
internal hard drive products, other than replacement under warranty via
a web page that requires an unsecured web browser to apply for the
replacement. Grrr. Until I get that straightened out and have a second
drive, all of the mirrors listed above on the boot drive are unreplicated.
>
> Now by default pkg creates back up of the db daily to allow recovery, there was
> an issue before pkg 1.5 which requires a manual intervention and fixed after pkg
> 1.5 so it is easier to recover.
One serious problem for recovery is that I don't know when the
corruption actually occurred. All I can tell you is that it must have
happened no earlier than the previous update to lang/gcc (lang/gcc48).
The error messages first appeared with the update to gcc-4.8.4_3.
>
> sqlite is a pretty solid db I would like to understand how you ended up with a
> corrupted db if not what I described above.
So would I because I would seriously like it not to happen again.
Long ago, I used to use portupgrade, but I eventually switched to
portmaster for three reasons: speed (ruby is awfully slow), dougb@
massively reworked portmaster and made it work much more correctly
than portupgrade, and portupgrade's frustrating habit of always deciding
that the package data base had to be rebuilt from nothing, which always
took a long time and failed as often as it succeeded. Because portmaster
now has to use a data base instead of direct evidence, it seems that that
fourth complaint has partly returned to haunt us.
sqlite3-3.8.9_1 is what is installed on my system. I have no idea
which version is incorporated into pkg or pkg-static.