[elephant-devel] DB_NOTFOUND and Unknown error: -5

Florian Obser florian.obser at t-online.de
Mon Nov 7 16:40:22 UTC 2005


hi,
I tried the tutorial on
http://common-lisp.net/project/elephant/doc/Tutorial.html with SBCL
0.8.16 and libdb4.2 from debian sarge and elephant 0.2.1.

Opening the store results in:

CL-USER> (open-store "/tmp/testdb1")
-----------------------------------------
Berkeley DB error: DB_NOTFOUND: No matching key/data pair found
   [Condition of type SLEEPYCAT:DB-ERROR]

Restarts:
  0: [ABORT] Abort handling SLIME request.
  1: [ABORT] Reduce debugger level (leaving debugger, returning to
toplevel).
  2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.

Backtrace:
  0: ((OPEN-CONTROLLER (STORE-CONTROLLER)) #<unavailable argument>
#<unavailable argument> #<unavailable argument> #<unavailable argument>)
  1: (SB-INT:EVAL-IN-LEXENV 2 (OPEN-STORE "/tmp/testdb1")
#S(SB-KERNEL:LEXENV :FUNS NIL :VARS NIL :BLOCKS NIL :TAGS NIL
:TYPE-RESTRICTIONS NIL :LAMBDA NIL :CLEANUP NIL :HANDLED-CONDITIONS NIL
:DISABLED-PACKAGE-LOCKS NIL :POLICY ((SPEED . 1) (SPACE . 1) (SAFETY .
1) (INHIBIT-WARNINGS . 1) (DEBUG . 1) (COMPILATION-SPEED . 1))))[:EXTERNAL]
  2: ("hairy arg processor for SWANK::EVAL-REGION" "(open-store
\"/tmp/testdb1\")
" T)
  3: ("#'(LAMBDA NIL (MULTIPLE-VALUE-BIND # # ...))")
[...]
-----------------------------------------
(The backtrace continues after this point but I assume it's only slime
related)
I tried different locations for the store directory (current working
directory or /tmp/ in this case. I found the suggestion that this libdb
error message might be related to permissions on the directory so I
tried a chmod 777. In all cases after running the open-store using a
fresh empty directory the following files are in the directory:
__db.001
__db.002
__db.003
__db.004
__db.005
%ELEPHANT
log.0000000001

I aborted (using 0) the backtrace and tried to continue the tutorial.
Inserting and retrieving of strings works fine, but when I tried to
create a persistence-class instance I get a new error:
CL-USER> (defclass my-persistent-class ()
                ((slot1 :accessor slot1)
	         (slot2 :accessor slot2))
		         (:metaclass persistent-metaclass))

CL-USER> (setq foo (make-instance 'my-persistent-class))
-----------------------------------------------------------
Berkeley DB error: Unknown error: -5
   [Condition of type SLEEPYCAT:DB-ERROR]

Restarts:
  0: [ABORT] Abort handling SLIME request.
  1: [ABORT] Reduce debugger level (leaving debugger, returning to
toplevel).
  2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.

Backtrace:
  0: (SLEEPYCAT::NEXT-COUNTER #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP
#X0827A1E8 :TYPE (* T)> #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X0827AAB8
:TYPE (* T)> #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X00000000 :TYPE (*
T)> #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X08278FF0 :TYPE (* (SIGNED
8))> 12 #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X0827A1D0 :TYPE (*
(SIGNED 8))> 16)
  1: ((INITIALIZE-INSTANCE :BEFORE (PERSISTENT)) #<unavailable argument>
#<unavailable argument> #<MY-PERSISTENT-CLASS {939EA59}> NIL)
  2: ("#'(LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL.
SB-PCL::.ARG0. ...) (DECLARE #) ...)" #<unavailable argument>
#<unavailable argument> #<MY-PERSISTENT-CLASS {939EA59}> NIL)
  3: ((MAKE-INSTANCE (CLASS)) #<unavailable argument> #<unavailable
argument> #<PERSISTENT-METACLASS MY-PERSISTENT-CLASS> NIL)
-----------------------------------------------------------

and after this I can't continue working with the object:
CL-USER> (add-to-root "foo" foo)
---------------------
The variable FOO is unbound.
   [Condition of type UNBOUND-VARIABLE]

Restarts:
  0: [ABORT] Abort handling SLIME request.
  1: [ABORT] Reduce debugger level (leaving debugger, returning to
toplevel).
  2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.

Backtrace:
  0: (SB-INT:EVAL-IN-LEXENV 2 FOO #S(SB-KERNEL:LEXENV :FUNS NIL :VARS
NIL :BLOCKS NIL :TAGS NIL :TYPE-RESTRICTIONS NIL :LAMBDA NIL :CLEANUP
NIL :HANDLED-CONDITIONS NIL :DISABLED-PACKAGE-LOCKS NIL :POLICY ((SPEED
. 1) (SPACE . 1) (SAFETY . 1) (INHIBIT-WARNINGS . 1) (DEBUG . 1)
(COMPILATION-SPEED . 1))))[:EXTERNAL]
  1: (SB-INT:EVAL-IN-LEXENV 2 (ADD-TO-ROOT "foo" FOO)
---------------------

Any suggestions what might be going wrong here? (I think I understand
the third backtrace, but what about the first two?)
- Florian
-- 
If c++ had garbage collection most programs would delete themself upon
execution.



More information about the elephant-devel mailing list