f



I can see keys I can't fetch, and now I'm getting DB_RUNRECOVERY.

G'day, everyone.

I'm one of the developers of iPodder, and we're using Python 2.3's
inclusion of Berkely DB to implement our state database.

C:\dev\db-4.2.52.NC>python
>>> import bsddb
>>> bsddb.__version__
'4.2.0.2'

We've taken great pains to avoid having iPodder run twice, so the
database shouldn't be open to more than one process at a time, but we
*do* run a lot of threads all of which pound the database at once. That
might not have been such a good idea, as we're spotting a few of weird
things. Perhaps amusingly, it's only now that I've looked up the
documentation for the 'bsddb' module rather than 'shelve' that I've
noticed the big fat warning that:

Warning: This legacy interface is not thread safe
in python 2.3.x or earlier. Data corruption, core
dumps or deadlocks may occur if you attempt multi-
threaded access. You must use the modern pybsddb
interface linked to above if you need multi-threaded
or multi-process database access.

Oops. I'm a little weirded out, as pybsddb is supposed to be included
as bsddb; perhaps the mistake is using shelve() rather than
bsddb.dbshelve().

So, amongst the results are database keys we can't fetch:

>>> db = bsddb.hashopen(r"ipodder.db", 'w')
>>> tot = 0
>>> for k in db.keys(): tot = tot + len(db[k])
....
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\lib\bsddb\__init__.py", line 116, in __getitem__
return self.db[key]
KeyError:
'cache\x00http://slashdotreview.com/wp-rss2bt.xmlrants.xmlw.wholewheatradio.org/jbb/WWR_rants.xml'

I've got a few dozen such keys in my database, and I can't get rid of
them.

>>> db[k] = ''
>>> db.sync()
>>> del db[k]
>>> db.sync()
>>> k in db.keys()
True

Things have gone from bad to worse recently, with iPodder throwing up a
great number of these in one of my recent runs:

Traceback (most recent call last):
....
File "C:\Python23\lib\bsddb\__init__.py", line 120, in __setitem__
self.db[key] = value
DBRunRecoveryError: (-30982, 'DB_RUNRECOVERY: Fatal error, run
database recovery -- fatal region error detected; run recovery')

So, I'm trying to recover, and can't. db_recovery.exe doesn't seem to
do anything -- the documentation assumes we've got a whole directory
for the environment, which my legacy interface doesn't seem to specify
-- and I can't pass DB_RECOVERY to bsddb.hashopen() without complaint:

>>> db = bsddb.hashopen('ipodder.db', hflags=bsddb._bsddb.DB_RECOVER)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\lib\bsddb\__init__.py", line 192, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- call implies
an access method which is inconsistent with previous calls')
>>> db = bsddb.hashopen('ipodder.db',
hflags=bsddb._bsddb.DB_RECOVER|bsddb._bsddb.DB_CREATE)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\lib\bsddb\__init__.py", line 192, in hashopen
d.open(file, db.DB_HASH, flags, mode)
bsddb._db.DBInvalidArgError: (22, 'Invalid argument -- call implies
an access method which is inconsistent with previous calls')

Trying to do it directly using the new API doesn't appear to actually
do the recovery part:

>>> from bsddb import db
>>> env = db.DBEnv()
>>> env.open('.', db.DB_RECOVER|db.DB_CREATE|db.DB_INIT_MPOOL)
>>> idb = db.DB(env)
>>> idb.open('ipodder.db', dbtype=db.DB_HASH, flags=db.DB_CREATE)
>>> for k in idb.keys():
....   v = idb.get(k)
....   if v is None:
....     print k
....
cache
http://slashdotreview.com/wp-rss2bt.xmlrants.xmlw.wholewheatradio.org/jbb/
# ... and 30 more.

Can anyone help me recover my database?

If I use bsddb.dbshelve from now on, will that cope with multi-threaded
key setting and attempted overlapping sync() operations?
Regards,
Garth.

0
garthk
1/24/2005 12:25:31 PM
comp.databases.berkeley-db 1749 articles. 0 followers. fw12 (438) is leader. Post Follow

0 Replies
697 Views

Similar Articles

[PageSpeed] 32

Reply:

Similar Artilces:

Can you see why I'm getting a NoClassDefFoundError here? I can't see it :<
I'm going through the HeadFirt EJB book, and I stuck on one example. :< The code is here (simple example used to illustrate simple ejb creation/usage, but my example has that commented out). import javax.naming.*; import java.rmi.*; import javax.rmi.*; import headfirst.*; import javax.ejb.*; public class AdviceClient{ public static void main( String[] args ){ System.err.println( "BEG" ); //new AdviceClient().go(); System.err.println( "END" ); } public void go(){ try{ Context ic = new InitialContext(); Object o = ic.lookup( "Advisor" ); ...

Can't see all of the queries when merging to MS Word and can't get to reports
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I think - it might have been XP) to 2003. The database is impressive, both in what it does and the obtuse and inconsistent ways it works. There are several hundred queries, for example, with no indication of where they are used or if they are in fact necessary at all... The database is for the local Hospice service, and their entire operation is based on it - from patient records to donations. The ...

SQL Server Management Studio can't 'see' the 2005 engine?? But can see 2000 ?!?
Hello, I had SQL2000 server running fine on the windows 2003 box. I then installed SQL 2005 Express. They both worked together fine. I then uninstalled SQL 2005 Express and installed SQL 2005 Server. But when I open SQL Server Management Studio, I can only connect to the SQL 2000 engine. In the Object explorer, it says v8.0.2039 (which I think is SQL 2000 Server, because I can see the existing SQL 2000 databases). How can I get SQL Server Management Studio to 'see' the SQL 2005 database engine so I can create tables? I *think* its running because there is the 'sqlservr.exe...

Can't use my //e because I can't get any software for it
Here's my problem. I have an Apple //e, but I have absolutely no software for it. I have an older Mac. All of the images I have found are 5.25" and I can't write those back to the floppy using the Mac (or a PC for that matter). I don't have a null modem, but that doesn't matter because I don't have any comm software. Basically I have no way to get anything onto a bootable floppy. Now, if I could find a bootable image of a 3.5" disk I would be in business, but everything is in 5.25" format. Would an emaulator be able to create a bootable 3.5" di...

Can't see hard drive/can't boot.
Using an Intel Mac with 2gb ram with updated Leopard. When starting up, the hard drive does its usual whine, then stops, and starts again. I get the Apple logo on the grey background. But it refuses to go further. Just does this over and over. Its like its hitting some block on the startup. So I take that hard drive and try it on another Mac. It sees it perfectly. I try some utilities to test it - tests 100%. It behaves perfectly. Then I take the 2nd hard drive I use all the time on that system (firewire) and plug it into the other Mac. Its invisible. Nothing in the Finder. ...

Messages . . . Now you see them . . . Now you don't . . . Guess Epson can't stand criticism
Isn't it amazing how a message critical of Epson can vanish soon after posting to this newsgroup . . . or maybe an Epson sympathiser had a hand in deleting the message. I can still see loads of messages in here that are critical of Epson. Hey if they all dissappeared the NG would be allmost empty! CrimsonLiar "Raymond Owen" <raymwo@iprimus.com.au> wrote in message news:40761d03_1@news.iprimus.com.au... > Isn't it amazing how a message critical of Epson can vanish soon after > posting to this newsgroup . . . or maybe an Epson sympathiser had a ha...

OS X
after a bit of reading, it looks like I did a veeeeery shtupid thing... (I'm copying my post to this newsgroup, as the alt.sys.mac.newuser-help group didn't look quite as highly-trafficked...) anyways, here's what I did... ----------------------------------- in an effort to help the owner of a nice shiny new eMac 'clean up' their personal folder, I moved a few items... including the Library folder! it appears.... correct me if I'm wrong... that Mac OS X then created a NEW library... so we restarted it, and all the Quicken data, dialup info, (etc.) was gone... so we ...

Can't see print preview and can't print under Lexmark Z32!
Hi, I face a problem that my customer using lexmark z32 USB prot printer, clarion 5.5 can't generate print preview and can't to printer also. Does anybody face this problem before? How to solve this problem? TQ. Best Regards, Nelson ...

Getting Error can't find '__main__' module in 'X'
Hey I am newbie in python.I have installed python 2.7.5 correctly.It is working fine but I am having some issues.I have set windows Enviroment variables. The problem is when I try to save my program in a folder(C:\Users\John\X)it shows that module error but when I save it outside this X folder ( C:\Users\John ) It runs successfully.How to fix it? On 06/02/2013 07:04 AM, meakaakka wrote: > Hey I am newbie in python.I have installed python 2.7.5 correctly.It is working fine but I am having some issues.I have set windows Enviroment variables. Please be a lot more specific. Do you have ...

can't get the $_GET['id'] after the header is sent but page doesn't redirect
In the first if, the page is displayed without any company cars selected. If there is a company selected, then the id value is posted and captured by the redirect (1st elseif). Then one of two things can happen. The final else the selected company/id cars get displayed in the browser, or in the case of a post to a form for excel, the a header gets sent to the to the current_sightingsXL.php page. The current_sightingsXL.php and current_sightings.php pages test out. The second elseif works with one minor problem. I have to type in the url with the id to get it to download to excel. i...

Branch can't get to internet, can't ping anything but ethernet at main site.
Ok, What am i missing? I've got a new MPLS connection up and running. I can ping the branch site from my main site just fine. I can not ping ANYTHING past the main site ethernet port via the branch router. Can someone please help me out!!! Heres so configs Main: interface FastEthernet0/0 description $ETH-SW-LAUNCH$$INTF-INFO-FE 0/0$$ETH-LAN$ ip address 192.168.1.251 255.255.255.0 duplex auto speed auto ! interface Serial0/0/0 ip address 63.239.127.226 255.255.255.252 ip access-group 189 in service-module t1 timeslots 1-12 ! router rip version 2 passive-interface FastEthernet0/0...

M$ can't create an OS that doesn't get sick from viruses
Read and weep Win### http://www.slashgear.com/microsoft-testing-fix-for-windows-phone-sms-bug-desktop-software-not-immune-29204989/ ...

Computer can't 'see' itself
I have three Windows XP Pro computers with SP2 on a peer-to-peer network connected to a DSL router. Two of those computers can see one another and themselves(In Network Neighborhood) but cannot see the third. The third can see the other two but cannot see itself. The two can share files with the third by going through Start>Run>"3rd computer name". Under normal circumstances this condition is not a problem but I now have some software that requires that the third computer 'sees' itself, otherwise it locks the other two out of the software. Anyone know how...

Need Advice: Can't get crashed HD to boot as slave so I can see if any files can be recovered.
80 gig WD HD crashed on E macnine. Drive had 6 partitions. Tried recovery software x4 which fully installed but boot up stops and I always get "disk read error". Talked with e machine tech in live chat, we retried recovery disks, chkdsk said there was 1 partition and we both suspect a trashed MBR which we failed to recover. I don't want to format the drive because I have many files I want to recover if possible, the most important are health information files concerning leukemia. Purchased a WD 120 gig HD and installed XP with recovery discs. Computer is up and runn...

can't include 'http...foo.php', but can include 'http...foo.txt'
This seems weird, but when I use the following code, include 'http://www.foo.com/includes.php'; includedfunction(); I am told that it is a call to an undefined function, but 'includedfunction' is on the server. the following includes work fine, and the run the called function with no trouble: include 'http://www.foo.com/includes.phtml'; include 'http://www.foo.com/includes.txt'; all three include.php,.phtml & .txt are on the server and are exactly identical. I am running php version 4.1.1. Anyone have any ideas? In article <768682d0.0308190004.dd...

OT: Ah Lawyers. Can't live with 'em, can't shoot them...
http://zdnet.com.com/2100-1104_2-1024234.html Is Google's cache cutting a cash flow? By Stefanie Olsen CNET News.com July 10, 2003, 7:03 AM PT Quote: "Many of us copyright lawyers have been waiting for this issue to come up: Google is making copies of all the Web sites they index and they're not asking permission," said Fred von Lohman, an attorney at the Electronic Frontier Foundation. "From a strict copyright standpoint, it violates copyright." * To join/leave the list, search archives, change list settings, * * etc., please visit http://rave...

Re: OT: Ah Lawyers. Can't live with 'em, can't shoot them...
Mark writes: > Is Google's cache cutting a cash flow? But on the positive side, last week the federal 9th circuit court affirmed that offering "thumbnails" of graphic images is "fair use"... http://yro.slashdot.org/article.pl?sid=03/07/07/2141216 G. * To join/leave the list, search archives, change list settings, * * etc., please visit http://raven.utc.edu/archives/hp3000-l.html * ...

Re: OT: Ah Lawyers. Can't live with 'em, can't shoot them...
Does that mean that every PC that maintains a cache of web content is violating copyright ? -----Original Message----- From: Mark Wonsil [mailto:wonsil@4m-ent.com] Sent: Friday, July 11, 2003 10:40 AM To: HP3000-L@RAVEN.UTC.EDU Subject: [HP3000-L] OT: Ah Lawyers. Can't live with 'em, can't shoot them... http://zdnet.com.com/2100-1104_2-1024234.html Is Google's cache cutting a cash flow? By Stefanie Olsen CNET News.com July 10, 2003, 7:03 AM PT Quote: "Many of us copyright lawyers have been waiting for this issue to come up: Google is making cop...

Can't do math. Can't read.
Can't do math. Can't read. We must be talking about Snit. LOL! ...

Can't Print, Can't Forward
Dear LN Experts, I have a simple Lotus Notes database containing a form with several fields but no subforms. In production, the application does not allow anyone to print documents created with the main form or to forward them via email. I have checked each field individually and confirmed that the form security setting allows printing and forwarding and I am at a loss to resolve the problem. Although I am a manager in the db, I myself am not allowed to print a document. The print option is grey in the file menu. If I create a new document, enter some data and save it,...

Can't get patches via smpatch, update manager, web, or wget; can't re-register with sconadm or update manager
I have a Sun software support contract. Since the new My Oracle thing went alive, I've been unable to update via smpatch or the update manager--voluminous Java error messages in / var/adm/messages include: Jan 23 16:33:41 osprey root: [ID 702911 user.error] => com.sun.patchpro.util.CachingDownloader@16c79d7 <=Downloader.getResponseCode() : IOExceptionNo route to host Other messages seem to suggest failure to use a proxy server (I have no proxy server here), although my network is behind a Solaris 10 'ipfilter' firewall that nat's the internal hosts. I&#...

can't open 'databases' folder
Hello, I just installed SQL Server 2000 on my home computer and am connecting to a remote SQL server over the Internet. I can log into the server just fine and see 7 folders including the 'Databases' folder. I can open up all of the other 6 folders but for some crazy reason when I double click on the 'Databases' folder, I can't open it! The hourglass appears and Enterprise Manager basically locks up. Does anyone know what's going on????? Please email response to nkulshresh@hotmail.com as well as posting to group. Thanks, Navin [posted and mailed, please reply in news]...

Can't get 'require' to work
I just started tinkering with Ruby. From "The Poignant Ruby Programmer" or whatever it's called (you know what I mean) I tried running the small example but get an error. This is the first file called m2.rb: require '/usr/home/me.rb' # Get evil idea and swap in code words print "Enter your new idea: " idea = gets code_words.each do |real, code| idea.gsub!( real, code ) end # Save the jibberish to a new file print "File encoded. Please enter a name for this idea: " idea_name = gets.strip File::open( "idea-" + idea_name + "...

can't open 'm file'
when i open 'file-> new-> m-file' this message.... 'Failed to open editor. Load of Java classes failed.' what is it? what is wrong with my computer~~ ninaki wrote: > when i open 'file-> new-> m-file' > > this message.... > > 'Failed to open editor. Load of Java classes failed.' > > what is it? what is wrong with my computer~~ I'm going to assume you're using some version of Windows. I know this is trite, but have you tried exiting MATLAB, restarting Windows, and then restarting MATLAB? Bob Pownall i did it.. ...

Web resources about - I can see keys I can't fetch, and now I'm getting DB_RUNRECOVERY. - comp.databases.berkeley-db

Resources last updated: 2/15/2016 2:09:57 PM