Python related exception for Drizzle tests

Asked by Natacha Crooks

Running on Debian Lenny

When running any test (from test run, or dbqp) the following exception occurs: 20110707-112222 INFO STATUS: 1
20110707-112225 ===============================================================
<type 'exceptions.Exception'> 'str' object has no attribute 'format'

The client and server both work when not being tested.

The following packages are installed :
python-drizzle_0.08.2-1_amd64.deb
python3.1_3.1.3-1_amd64.deb and their dependencies

Any help would be much appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Drizzle Edit question
Assignee:
No assignee Edit question
Solved by:
CaptTofu
Solved:
Last query:
Last reply:
Revision history for this message
Patrick Crews (patrick-crews) said :
#1

Hrm - two things:
1) You probably shouldn't see this if you try drizzle-test-run / dtr. What you are showing is a python exception and test-run.pl (dtr) is perl. Could you run: ./dtr --suite=main and share any failure output?

2) For dbqp, this appears to be an issue with python not having access to string.format(). While the python package you have installed *should* be good, the fact that we are seeing this is saying that python isn't finding that method (which shouldn't be the case for 3.1)

Just to double check - could you run python --version? And also include any failure output?

Also, could you share the command lines that you are trying?

Thanks and here's hoping we can get this sorted.

Revision history for this message
Natacha Crooks (nacrooks) said :
#2

Thank you for the quick response, running ./dtr --suite=main works well thank you!

As for the dbqp, my computer seems to be running 2.5.2 (according to python --version) which explains the error I'm getting, even though all the packages for 3.1 have been installed. I shall do a clean install of Python which should hopefully solve the version problem.

The command I am running is (although I get the same error with all instances of ./dbqp) <code> ./dbqp --mode=randgen --randgen-path=/home/ncrooks/drizzle/randgen-2.2.0
</code>

The output is <code> 20110707-143918 INFO VARDIR: /home/ncrooks/drizzle/drizzle7-2011.06.20/tests/workdir/bot0/s0/var
20110707-143918 INFO STATUS: 1
20110707-143921 ===============================================================
<type 'exceptions.Exception'> 'str' object has no attribute 'format'
20110707-143921 INFO Stopping all running servers...
</code>

Thank you.

Revision history for this message
Patrick Crews (patrick-crews) said :
#3

Ah ok, this boils down to string.format() being in python 2.6 or greater (it was actually backported to 2.6 from 3.0 as it was so good) : )

Apologies for any inconvenience and thanks for pointing this out. I'll make it a point to document it under requirements. Once your python install is sorted, things should run well for you.

The only other thing is that you need dbd::drizzle installed to run the randgen (and other tools like crashme and sql-bench).

Hope you are up and running soon!
Patrick

Revision history for this message
Natacha Crooks (nacrooks) said :
#4

I apologise for contacting you once again. I am rather new to Debian and struggling (yet again) for testing.

You mentioned the dbd:drizzle module. I have been trying all day to install it .... but I seem unable to run make. The documentation states that you need to run this

perl Makefile.PL --cflags=-I/usr/local/drizzle/include/ --libs=-"L/usr/local/drizzle/lib -ldrizzle"

As my libraries are located in /usr/local/lib, and the drizzle headers in /usr/local/drizzle (based on the command whereis drizzle) , I am running:
 perl Makefile.PL --cflags=-I/usr/local/drizzle --libs=-"L/usr/local/drizzle/lib -ldrizzle"

(which seems to be successful)
This doesn't suffice as there is no drizzle.db in the perl directories, as confirmed when I run either the crashme module or the sqlbench module.

xxxxxxxxxxxxxxxx

20110708-180847 INFO Executing sqlbench: $DRIZZLE_TEST_DIR/sql-bench/run-all-tests --server=drizzle --dir=$DRIZZLE_TEST_WORKDIR --log --connect-options=port=$MASTER_MYPORT --create-options=ENGINE=innodb --user=root
<type 'exceptions.Exception'> [Errno 2] No such file or directory: "Perhaps the DBD::drizzle perl module hasn't been fully installed,"
20110708-180847 INFO Stopping all running servers..

xxxxxxxxxxxxxxxxxxxxxx

20110708-180937 main.crashme [ fail ] 100
20110708-180937 install_driver(drizzle) failed: Can't locate DBD/drizzle.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 30) line 3.
20110708-180937 Perhaps the DBD::drizzle perl module hasn't been fully installed,
20110708-180937 or perhaps the capitalisation of 'drizzle' isn't right.
20110708-180937 Available drivers: DBM, ExampleP, File, Gofer, Pg, Proxy, SQLite, Sponge, mysql.
20110708-180937 at /home/ncrooks/drizzle/drizzle7-2011.06.20/tests/sql-bench/server-cfg line 521
20110708-180937
20110708-180937 ERROR Failed test. Use --force to execute beyond the first test failure

xxxxxxxxxxxxxxxxxxxxxx

I hence tried to then make the file, which also does not work due to incorrect paths. (Using cpan to obtain the dbd also fails to make)

Revision history for this message
Patrick Crews (patrick-crews) said :
#5

No worries - did you also run
make
make install
After running perl Makefile.PL?

Any output from the make process you could share would be most helpful.

Revision history for this message
CaptTofu (capttofu) said :
#6

Natacha,

Did 'make test' run successfully with DBD::drizzle?

Regards,

Patrick

On Fri, Jul 8, 2011 at 1:16 PM, Natacha Crooks
<email address hidden> wrote:
> Question #164045 on Drizzle changed:
> https://answers.launchpad.net/drizzle/+question/164045
>
>    Status: Answered => Open
>
> Natacha Crooks is still having a problem:
> I apologise for contacting you once again. I am rather new to Debian and
> struggling (yet again) for testing.
>
> You mentioned the dbd:drizzle module. I have been trying all day to
> install it .... but I seem unable to run make. The documentation states
> that you need to run this
>
> perl Makefile.PL --cflags=-I/usr/local/drizzle/include/
> --libs=-"L/usr/local/drizzle/lib -ldrizzle"
>
> As my libraries are located in  /usr/local/lib, and the drizzle headers in /usr/local/drizzle (based on the command whereis drizzle) , I am running:
>  perl Makefile.PL --cflags=-I/usr/local/drizzle --libs=-"L/usr/local/drizzle/lib -ldrizzle"
>
> (which seems to be successful)
> This doesn't suffice as there is no drizzle.db in the perl directories, as confirmed when I run either the crashme module or the sqlbench module.
>
> xxxxxxxxxxxxxxxx
>
> 20110708-180847 INFO Executing sqlbench:  $DRIZZLE_TEST_DIR/sql-bench/run-all-tests --server=drizzle --dir=$DRIZZLE_TEST_WORKDIR --log --connect-options=port=$MASTER_MYPORT --create-options=ENGINE=innodb --user=root
> <type 'exceptions.Exception'> [Errno 2] No such file or directory: "Perhaps the DBD::drizzle perl module hasn't been fully installed,"
> 20110708-180847 INFO Stopping all running servers..
>
> xxxxxxxxxxxxxxxxxxxxxx
>
>
> 20110708-180937  main.crashme                               [ fail ]      100
> 20110708-180937  install_driver(drizzle) failed: Can't locate DBD/drizzle.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 30) line 3.
> 20110708-180937  Perhaps the DBD::drizzle perl module hasn't been fully installed,
> 20110708-180937  or perhaps the capitalisation of 'drizzle' isn't right.
> 20110708-180937  Available drivers: DBM, ExampleP, File, Gofer, Pg, Proxy, SQLite, Sponge, mysql.
> 20110708-180937  at /home/ncrooks/drizzle/drizzle7-2011.06.20/tests/sql-bench/server-cfg line 521
> 20110708-180937
> 20110708-180937 ERROR Failed test.  Use --force to execute beyond the first test failure
>
> xxxxxxxxxxxxxxxxxxxxxx
>
> I hence tried to then make the file, which also does not work due to
> incorrect paths. (Using cpan to obtain the dbd also fails to make)
>
> --
> You received this question notification because you are a member of
> Drizzle-developers, which is an answer contact for Drizzle.
>

Revision history for this message
Natacha Crooks (nacrooks) said :
#7

Here's the following commands I use and the output errors I get (I have since corrected the cflags flag to point to the correct location of libdrizzle which wasn't the location indicated when make-ing the main drizzle file - apologies for that)

perl Makefile.PL --cflags=-I/usr/local/include/libdrizzle-2.0 --libs=-"L/usr/local/lib -ldrizzle"

Output:
I will use the following settings for compiling and testing:

  cflags (User's choice) = -I/usr/local/include/libdrizzle-2.0
  libs (User's choice) = -L/usr/local/lib -ldrizzle
  nocatchstderr (default ) = 0
  nofoundrows (default ) = 0
  ssl (guessed ) = 0
  testdb (default ) = test

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Argument "6.55_02" isn't numeric in numeric ge (>=) at Makefile.PL line 167.
Checking if your kit is complete...
Looks good
Using DBI 1.612 (for perl 5.010001 on i686-linux-gnu-thread-multi) installed in /usr/lib/perl5/auto/DBI/
Writing Makefile for DBD::drizzle

And then when calling make

Output:
cp lib/DBD/drizzle/INSTALL.pod blib/lib/DBD/drizzle/INSTALL.pod
cp lib/DBD/drizzle.pm blib/lib/DBD/drizzle.pm
cp lib/DBD/drizzle/GetInfo.pm blib/lib/DBD/drizzle/GetInfo.pm
cp lib/Bundle/DBD/drizzle.pm blib/lib/Bundle/DBD/drizzle.pm
cc -c -I/usr/lib/perl5/auto/DBI -I/usr/local/include/libdrizzle-2.0 -DDBD_DRIZZLE_INSERT_ID_IS_GOOD -g -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.300\" -DXS_VERSION=\"0.300\" -fPIC "-I/usr/lib/perl/5.10/CORE" dbdimp.c
In file included from dbdimp.c:15:0:
dbdimp.h:106:16: error: field ‘_drizzle’ has incomplete type
dbdimp.c: In function ‘my_login’:
dbdimp.c:1132:6: error: invalid application of ‘sizeof’ to incomplete type ‘drizzle_con_st’
dbdimp.c:1132:6: error: invalid application of ‘sizeof’ to incomplete type ‘drizzle_con_st’
dbdimp.c:1132:6: error: invalid application of ‘sizeof’ to incomplete type ‘drizzle_con_st’
dbdimp.c: In function ‘drizzle_db_commit’:
dbdimp.c:1245:21: error: storage size of ‘res’ isn’t known
dbdimp.c: In function ‘drizzle_db_rollback’:
dbdimp.c:1265:21: error: storage size of ‘res’ isn’t known
dbdimp.c: In function ‘drizzle_db_STORE_attrib’:
dbdimp.c:1406:21: error: storage size of ‘res’ isn’t known
dbdimp.c: In function ‘drizzle_st_execute’:
dbdimp.c:2073:5: warning: conversion lacks type at end of format
dbdimp.c: In function ‘drizzle_st_fetch’:
dbdimp.c:2162:19: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
dbdimp.c:2164:19: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
dbdimp.c: In function ‘drizzle_st_FETCH_attrib’:
dbdimp.c:2684:11: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
dbdimp.c: In function ‘drizzle_db_reconnect’:
dbdimp.c:2852:18: error: storage size of ‘con’ isn’t known
make: *** [dbdimp.o] Error 1

Revision history for this message
Best CaptTofu (capttofu) said :
#8

Double-checking:

This is the latest dirzzle and the latest DBD::drizzle?

On Sat, Jul 9, 2011 at 2:11 PM, Natacha Crooks
<email address hidden> wrote:
> Question #164045 on Drizzle changed:
> https://answers.launchpad.net/drizzle/+question/164045
>
>    Status: Answered => Open
>
> Natacha Crooks is still having a problem:
>
> Here's the following commands I use and the output errors I get (I have
> since corrected the cflags flag to point to the correct location of
> libdrizzle which wasn't the location indicated when make-ing the main
> drizzle file - apologies for that)
>
> perl Makefile.PL --cflags=-I/usr/local/include/libdrizzle-2.0
> --libs=-"L/usr/local/lib -ldrizzle"
>
> Output:
> I will use the following settings for compiling and testing:
>
>  cflags        (User's choice) = -I/usr/local/include/libdrizzle-2.0
>  libs          (User's choice) = -L/usr/local/lib -ldrizzle
>  nocatchstderr (default      ) = 0
>  nofoundrows   (default      ) = 0
>  ssl           (guessed      ) = 0
>  testdb        (default      ) = test
>
> To change these settings, see 'perl Makefile.PL --help' and
> 'perldoc INSTALL'.
>
> Argument "6.55_02" isn't numeric in numeric ge (>=) at Makefile.PL line 167.
> Checking if your kit is complete...
> Looks good
> Using DBI 1.612 (for perl 5.010001 on i686-linux-gnu-thread-multi) installed in /usr/lib/perl5/auto/DBI/
> Writing Makefile for DBD::drizzle
>
> And then when calling make
>
> Output:
> cp lib/DBD/drizzle/INSTALL.pod blib/lib/DBD/drizzle/INSTALL.pod
> cp lib/DBD/drizzle.pm blib/lib/DBD/drizzle.pm
> cp lib/DBD/drizzle/GetInfo.pm blib/lib/DBD/drizzle/GetInfo.pm
> cp lib/Bundle/DBD/drizzle.pm blib/lib/Bundle/DBD/drizzle.pm
> cc -c  -I/usr/lib/perl5/auto/DBI -I/usr/local/include/libdrizzle-2.0 -DDBD_DRIZZLE_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.300\" -DXS_VERSION=\"0.300\" -fPIC "-I/usr/lib/perl/5.10/CORE"   dbdimp.c
> In file included from dbdimp.c:15:0:
> dbdimp.h:106:16: error: field ‘_drizzle’ has incomplete type
> dbdimp.c: In function ‘my_login’:
> dbdimp.c:1132:6: error: invalid application of ‘sizeof’ to incomplete type ‘drizzle_con_st’
> dbdimp.c:1132:6: error: invalid application of ‘sizeof’ to incomplete type ‘drizzle_con_st’
> dbdimp.c:1132:6: error: invalid application of ‘sizeof’ to incomplete type ‘drizzle_con_st’
> dbdimp.c: In function ‘drizzle_db_commit’:
> dbdimp.c:1245:21: error: storage size of ‘res’ isn’t known
> dbdimp.c: In function ‘drizzle_db_rollback’:
> dbdimp.c:1265:21: error: storage size of ‘res’ isn’t known
> dbdimp.c: In function ‘drizzle_db_STORE_attrib’:
> dbdimp.c:1406:21: error: storage size of ‘res’ isn’t known
> dbdimp.c: In function ‘drizzle_st_execute’:
> dbdimp.c:2073:5: warning: conversion lacks type at end of format
> dbdimp.c: In function ‘drizzle_st_fetch’:
> dbdimp.c:2162:19: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
> dbdimp.c:2164:19: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
> dbdimp.c: In function ‘drizzle_st_FETCH_attrib’:
> dbdimp.c:2684:11: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘uint64_t’
> dbdimp.c: In function ‘drizzle_db_reconnect’:
> dbdimp.c:2852:18: error: storage size of ‘con’ isn’t known
> make: *** [dbdimp.o] Error 1
>
> --
> You received this question notification because you are a member of
> Drizzle-developers, which is an answer contact for Drizzle.
>

Revision history for this message
Natacha Crooks (nacrooks) said :
#9

Thank you for the help. I solved my problem by using the 0.303 version of the DBD (by default the link on the website leads you to the 0.300 release, if not using bazaar) and by running libdrizzle1.0 rather than 2.0.

Thank you very much

Regards

Revision history for this message
Natacha Crooks (nacrooks) said :
#10

Thanks CaptTofu, that solved my question.

Revision history for this message
CaptTofu (capttofu) said :
#11

LinkedIn
------------

I'd like to add you to my professional network on LinkedIn.

- Patrick

Patrick Galbraith
Principal Engineer, Advanced Technology Group at Hewlett-Packard
Greater Boston Area

Confirm that you know Patrick Galbraith:
https://www.linkedin.com/e/tnav2-hy4qmsj7-5m/isd/5899238171253686272/PT2j5P-D/?hs=false&tok=1Nfufk7UQWI6k1

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/tnav2-hy4qmsj7-5m/uNgu-d76uHRstLIY0eDg8Z7TaOg88NOWSccwk2p53pb4tIIP0Yg9wY/goo/question164045%40answers%2Elaunchpad%2Enet/20061/I7547607016_1/?hs=false&tok=1ui05RbzQWI6k1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.