Thread: [Refdb-users] Cannot add reference.
Status: Beta
Brought to you by:
mhoenicka
|
From: Wei-Wei G. <ww...@gm...> - 2009-04-26 17:00:11
|
Dear all,
I'm stuck in the first step when trying to get my RefDB working.
I cannot add reference.
I doesn't meet any error when run the command 'refdbc'.
Here is part of the log info. Every entry has a part of this.
7:pid=3326:Sun Apr 26 16:51:49 2009:BEGIN
7:pid=3326:Sun Apr 26 16:51:49 2009:SELECT refdb_id, refdb_citekey FROM t_refdb WHERE refdb_id=6
6:pid=3326:Sun Apr 26 16:51:49 2009:ignore numerical ID
7:pid=3326:Sun Apr 26 16:51:49 2009:INSERT INTO t_refdb (refdb_type,refdb_citekey) VALUES ('DUMMY','DUMMYwhiz3326')
7:pid=3326:Sun Apr 26 16:51:49 2009:SELECT user_id FROM t_user WHERE user_name='wwguo'
7:pid=3326:Sun Apr 26 16:51:49 2009:INSERT INTO t_xuser (user_id, refdb_id) VALUES (1,3)
7:pid=3326:Sun Apr 26 16:51:49 2009:SELECT refdb_id, refdb_citekey FROM t_refdb WHERE refdb_id=3
7:pid=3326:Sun Apr 26 16:51:49 2009:SELECT note_id, note_user_id FROM t_note WHERE note_key='wwguo-wwguo'
4:pid=3326:Sun Apr 26 16:51:49 2009:inserting reference data failed
7:pid=3326:Sun Apr 26 16:51:49 2009:ROLLBACK
4:pid=3326:Sun Apr 26 16:51:49 2009:failed processing dataset
I tried the database with
$ sqlite3 /home/wwguo/biblio/wwguodb
sqlite> INSERT INTO t_refdb (refdb_type,refdb_citekey) VALUES ('DUMMY','DUMMYwhiz3326');
And it's works.
Here is my 'refdbdrc':
# refdbdrc
refdblib /usr/share/refdb
main_db refdb
serverip localhost
dbsport
dbserver sqlite3
dbpath /home/wwguo/studio/science/biblio
port 9734
logfile /var/log/refdbd.log
logdest file
loglevel debug
pidfile /var/run/refdbd.pid
remoteadmin f
remoteconnect f
keep_pnames t
keyword_scan t
db_encoding UTF-8
in_encoding UTF-8
My 'refdbcrc':
# refdbcrc
serverip 127.0.0.1
port 9734
pager less
username wwguo
passwd
defaultdb wwguodb
logdest file
loglevel info
logfile /var/log/refdbc.log
cssurl /usr/share/refdb/css/refdb.css
fromencoding UTF-8
toencoding UTF-8
Please give some help! Any suggestion is appreciated.
Best wishes,
Wei-Wei
|
|
From: Markus H. <mar...@mh...> - 2009-04-27 06:24:53
|
Hi, Quoting Wei-Wei Guo <ww...@gm...>: > 4:pid=3326:Sun Apr 26 16:51:49 2009:inserting reference data failed thank you for posting most of the relevant information along with your problem. The only thing I'd like to know in addition is the type of reference data which you try to add. The error above is often caused by trying to add data without using the proper -A switch. If refdbd attempts to read risx data as ris or vice versa, it'll fail right away. If you're not sure, please send the exact command which you issue to add the data, along with the dataset(s). regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Markus H. <mar...@mh...> - 2009-04-27 09:05:21
|
Quoting Wei-Wei Guo <ww...@gm...>: > 7:pid=3326:Sun Apr 26 16:51:49 2009:SELECT note_id, note_user_id > FROM t_note WHERE note_key='wwguo-wwguo' This appears to be the command which fails, or which causes a failure a few lines further down. Could you please run this command in sqlite3 using one of your test databases after you tried to add references? thanks Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-04-29 00:25:15
|
Hi Markus,
Sorry I didn't notice I keep on sending my replies to your email instead of
to refdb-users.
Since I don't get your feedback, I'm wandering whether you get it. So I
send it again. If you get duplicated email, sorry for that.
Markus Hoenicka 写道:
> Quoting Wei-Wei Guo <ww...@gm...>:
>
>> 7:pid=3326:Sun Apr 26 16:51:49 2009:SELECT note_id, note_user_id
>> FROM t_note WHERE note_key='wwguo-wwguo'
>
> This appears to be the command which fails, or which causes a failure
> a few lines further down. Could you please run this command in sqlite3
> using one of your test databases after you tried to add references?
>
$ rm studio/science/biblio/wwguodb
$ refdba -C createdb wwguodb
999:1 created:0 failed
$ refdbc -C addref -A ris testrefs.utf8.ris
999:1 added:0 skipped:21 failed
$ sqlite3 studio/science/biblio/wwguodb
SQLite version 3.6.10
sqlite> SELECT note_id, note_user_id FROM t_note WHERE note_key='wwguo-wwguo';
1|1
Best wishes,
Wei-Wei
|
|
From: Markus H. <mar...@mh...> - 2009-04-29 07:56:04
|
Hi, Quoting Wei-Wei Guo <ww...@gm...>: > Since I don't get your feedback, I'm wandering whether you get it. So I > send it again. If you get duplicated email, sorry for that. > I'm sorry but I didn't receive those mails. For whatever reasons, the mail you sent to the list went through ok. > $ refdbc -C addref -A ris testrefs.utf8.ris > 999:1 added:0 skipped:21 failed > > $ sqlite3 studio/science/biblio/wwguodb > SQLite version 3.6.10 > sqlite> SELECT note_id, note_user_id FROM t_note WHERE > note_key='wwguo-wwguo'; > 1|1 > Unfortunately this doesn't make sense. The only reasonable way for RefDB to return the error which you originally posted is if the above SELECT fails, but it returns the expected values. Strange. Now, what I'll do is to upgrade my SQLite (I think I run something older than 3.6.10) and see if I can reproduce the problem. If I don't succeed, we'd have to analyze more closely what's happening on your box. First of all, which RefDB version are you using? Would you be able to use to test the current svn revision? Would you be comfortable with testing source code patches (to get additional debug output) which I send to you? And, if nothing else helps, would you be able to provide temporary access via ssh to your box? regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-04-29 11:53:10
Attachments:
refdbd.log
|
Markus Hoenicka 写道:
Hi Markus,
> First of all, which RefDB version are you using?
I'm using refdb-0.9.9-1.
> Would you be able to use to test the current svn revision?
I'm using Gentoo and usually install packages by ebuilds provided by others.
I tried to make a ebuild for svn version. It complains "no configure script" when
compiling. After compare files in svn trunk and refdb-0.9.9-1.tar.gz, I found
there is no "configure" file in svn trunk. I'm not familiar with this kind of
things, so I'm not sure whether it's a problem of my ebuild or svn source.
> Would you be comfortable with testing source code patches (to get additional
> debug output) which I send to you?
Do you mean patches for refdb-0.9.9-1.tar.gz? I can do that.
> And, if nothing else helps, would you be able to provide temporary access
> via ssh to your box?
I'm not sure. I rarely use ssh. If it's necessary, I can ask someone teach me.
And I did a clear try with a newly created refdbd.log. I send the complete log to
you. Hope it helpful.
$ rm studio/science/biblio/wwguodb
$ refdba -C createdb wwguodb
999:1 created:0 failed
$ refdbc -C addref -A ris testrefs.utf8.ris
999:1 added:0 skipped:21 failed
$ cp /var/log/refdbd.log .
Best wishes,
Wei-Wei
|
|
From: Markus H. <mar...@mh...> - 2009-04-29 12:17:06
|
Hi, Quoting Wei-Wei Guo <ww...@gm...>: >> Would you be able to use to test the current svn revision? > > I'm using Gentoo and usually install packages by ebuilds provided by others. > I tried to make a ebuild for svn version. It complains "no configure > script" when > compiling. After compare files in svn trunk and refdb-0.9.9-1.tar.gz, I found > there is no "configure" file in svn trunk. I'm not familiar with this kind of > things, so I'm not sure whether it's a problem of my ebuild or svn source. > No, it's just a matter of running "./autogen.sh" in the top-level directory of your svn checkout. This script generates all required files for the autotools, including the configure script. In fact, you don't need to *install* the svn version in order to test it. IIRC the current svn revision does not depend on stuff which is not installed anyway if you use a 0.9.9-1 ebuild. You could just build the svn revision and run that from the build directory, without even installing it. > >> Would you be comfortable with testing source code patches (to get additional >> debug output) which I send to you? > > Do you mean patches for refdb-0.9.9-1.tar.gz? I can do that. > I guess that'll work. I'm using the svn revision, but the code in question didn't change that much, so patches against my version are likely to apply cleanly to your version. > >> And, if nothing else helps, would you be able to provide temporary access >> via ssh to your box? > > I'm not sure. I rarely use ssh. If it's necessary, I can ask someone > teach me. That's not a problem at this time. I'd like to retrieve as much information as possible using some patches before trying anything else. > > > And I did a clear try with a newly created refdbd.log. I send the > complete log to > you. Hope it helpful. > Thanks for the log. Unfortunately it just confirms what we already know: the first dataset is added ok, all subsequent datasets fail while refdbd tries to add them to your personal reference list. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Markus H. <mar...@mh...> - 2009-05-04 21:05:15
Attachments:
refdbdref.c.patch
|
Wei-Wei Guo writes: > Do you mean patches for refdb-0.9.9-1.tar.gz? I can do that. > I've appended a simple patch for one of the source files to provide additional debug output. Please apply the patch to the sources with a command like: patch < refdbdref.c.patch from within the src subdirectory of the source tree. Then please rebuild this directory and install it, or (whichever is easier for you), run the server as a regular app from the src directory, like this: ./refdbd -s [other options] (kill it with Ctrl-c when done) Then repeat your "add references" test from another xterm, and send the refdbd log. Just ask if anything is unclear, I'll be happy to help. I've just tested this on a FreeBSD box using the current svn revision and the sqlite3 driver. Things work ok for me. regards, Markus |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-05 14:42:42
Attachments:
refdbd.log
|
Markus Hoenicka 写道: > Wei-Wei Guo writes: > > Do you mean patches for refdb-0.9.9-1.tar.gz? I can do that. > > > > I've appended a simple patch for one of the source files to provide > additional debug output. Please apply the patch to the sources with a > command like: > > patch < refdbdref.c.patch > The patch cannot be applied, so I open refdbdref.c and changed it by hand. $ patch < refdbdref.c.patch patching file refdbdref.c Hunk #1 succeeded at 2114 (offset 1 line). Hunk #2 FAILED at 2142. 1 out of 2 hunks FAILED -- saving rejects to file refdbdref.c.rej > from within the src subdirectory of the source tree. Then please > rebuild this directory and install it, or (whichever is easier for > you), run the server as a regular app from the src directory, like > this: > > ./refdbd -s [other options] > Cause I don't know how make install will affect the system consistence, I just repack the refdb-0.9.9-1.tar.gz with the modified refdbdref.c and rebuild it by Gentoo emerge. And I run refdb by "/etc/init.d refdb start". Is what I have done ok? > Then repeat your "add references" test from another xterm, and send > the refdbd log. Just ask if anything is unclear, I'll be happy to > help. I repeat the process I did before. The refdbd.log is gotten by remove the old one first and run the test second. It's verbose than the ones get in previous tests. See the attachment. BTW. I'm moving flat in those days, so my feedback might be a little late. Sorry for that. Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-05 20:29:03
Attachments:
dbfncs.c.patch
|
Wei-Wei Guo writes: > Do you mean patches for refdb-0.9.9-1.tar.gz? I can do that. Unfortunately I can't reply to the proper message as I didn't receive your last reply in my inbox. I can see it in the list archives though. I've checked your log output. I've designed another small patch to drill a bit deeper. Please apply it in addition to the previous patch and rebuild RefDB again. The procedure you used last time was apparently successful. BTW which type of processor do you use? Is it a non-x86, by any chance? regards, Markus |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-05 23:39:31
Attachments:
refdbd.log
|
Markus Hoenicka 写道: > I've checked your log output. I've designed another small patch to > drill a bit deeper. Please apply it in addition to the previous patch > and rebuild RefDB again. The procedure you used last time was > apparently successful. > I attached the newly produced refdbd.log with the same procedure. > BTW which type of processor do you use? Is it a non-x86, by any > chance? > My processor is Intel Pentium 4. Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-06 07:49:54
|
Quoting Wei-Wei Guo <ww...@gm...>: > Markus Hoenicka 写道: >> I've checked your log output. I've designed another small patch to >> drill a bit deeper. Please apply it in addition to the previous patch >> and rebuild RefDB again. The procedure you used last time was >> apparently successful. >> > > I attached the newly produced refdbd.log with the same procedure. Thanks for repeating the test. Unfortunately I can't find the additional log output from the latest patch. There should be couple of lines starting with either "uint:" or "ulonglong:" providing additional clues. Could you please retry patching the sources with dbfncs.c.patch? thanks Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-06 10:48:59
Attachments:
refdbd.log
|
Markus Hoenicka 写道: > > Thanks for repeating the test. Unfortunately I can't find the additional > log output from the latest patch. There should be couple of lines > starting with either "uint:" or "ulonglong:" providing additional clues. > Could you please retry patching the sources with dbfncs.c.patch? > The new refdbd.log has 'ulonglong' now. I should restart refdbd before run the test procedure. Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-06 20:27:18
|
Wei-Wei Guo writes: > The new refdbd.log has 'ulonglong' now. I should restart refdbd before run > the test procedure. Yes, it is all too easy to forget this. Maybe I should have mentioned it. Your log indicates that this is apparently not a RefDB problem, but a problem of the libdbi driver which you use to access the SQLite database. We (that is, a few libdbi developers and myself) came across a platform-dependent problem with the sqlite and sqlite3 drivers just the other day. In a nutshell, these drivers do not handle 8 byte integers correctly on Linux, returning 0 instead of the real value. This is what your logs indicate as well. The id value returned by this query: 7:pid=3251:Wed May 06 10:55:45 2009:SELECT note_id, note_user_id FROM t_note WHERE note_key='wwguo-wwguo' 7:pid=3251:Wed May 06 10:55:45 2009:ulonglong: u 0<< lu 0<< llu 0 ought to be 1, which you already confirmed by running this query in the sqlite command line app. However, the driver returns 0 as indicated by the debug log output. I'll investigate this driver problem in the next days. I'll let you know as soon as there are good news. Also, feel free to watch the libdbi-drivers-devel list for further news (http://sourceforge.net/mailarchive/forum.php?forum_name=libdbi-drivers-devel). Unfortunately, at this time there are only two options to get RefDB up and running: use FreeBSD (or any other OS not affected by this bug), or use a different database engine. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-08 15:53:14
|
Markus Hoenicka 写道: Hi Markus, Sorry for late rely. I just settled down. > I'll investigate this driver problem in the next days. I'll let you > know as soon as there are good news. Also, feel free to watch the > libdbi-drivers-devel list for further news > (http://sourceforge.net/mailarchive/forum.php?forum_name=libdbi-drivers-devel). > > Unfortunately, at this time there are only two options to get RefDB up > and running: use FreeBSD (or any other OS not affected by this bug), > or use a different database engine. > Thanks. I'd better wait since PG or MySql is kind of heavy for me. Hope the driver problem could be solved soon :> Best wishes, Wei-Wei |
|
From: Markus H. <mar...@mh...> - 2009-05-08 23:41:25
|
Wei-Wei Guo writes: > Thanks. I'd better wait since PG or MySql is kind of heavy for me. Hope the > driver problem could be solved soon :> > It turned out that this was not a driver problem, but a bug in the libdbi library itself. I've checked in a fix today. I assume you won't be able to wait until the next libdbi release, which may take some time to be picked up by package maintainers. If you feel comfortable with installing libdbi from the sources, please use the appended patch for src/dbi_main.c. regards, Markus --- dbi_main.c 2008/11/28 22:28:51 1.95 +++ dbi_main.c 2009/05/08 23:22:33 1.96 @@ -1570,8 +1574,19 @@ /* hahaha! who woulda ever thunk strawberry's code would come in handy? */ // find first (highest) bit set; methods not using FP can be found at // http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious - unsigned startbit = log(rangemin)/log(2); - unsigned endbit = log(rangemax)/log(2); +/* unsigned startbit = log(rangemin)/log(2); */ +/* unsigned endbit = log(rangemax)/log(2); */ + unsigned int startbit = 0; + unsigned int endbit = 0; + + while (rangemin >>= 1) { + startbit++; + } + + while (rangemax >>= 1) { + endbit++; + } + // construct mask from startbit to endbit inclusive unsigned attrib_mask = ((1<<(endbit+1))-1) ^ ((1<<startbit)-1); return attribs & attrib_mask; -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
|
From: Wei-Wei G. <ww...@gm...> - 2009-05-09 03:32:22
|
Markus Hoenicka 写道: > It turned out that this was not a driver problem, but a bug in the > libdbi library itself. I've checked in a fix today. I assume you won't > be able to wait until the next libdbi release, which may take some > time to be picked up by package maintainers. If you feel comfortable > with installing libdbi from the sources, please use the appended patch > for src/dbi_main.c. > Thanks, it solves the problem. Best wishes, Wei-Wei |