Title: OpenCA 0.9 RC2 - CA Init and postgres problem

Hi,

I would just like to report a problem with the CA database initialiation of the postgres database (ver 7.2.1).

When I try to initialize the database I get the following message (with the DEBUG turned ON):

Entering sub initDB MODE: NONE
force: 0
table: LOG
dsn: dbi:Pg:dbname=openca;host=localhost;port=5432 the folloing debugging-output is for DB2
ld_library_path:
path: /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
libpath
classpath
Entering sub operateTable
build the create statements
table: log
create:create table log (action_number int8 primary key not null, datatype text, moduletype text, module text, log_submit_date text, log_do_date text, mykey text, submit_date text, format text, data text, cert_key int8, role text, dn text, cn text, email text, ra text, rao text, last_update text, next_update text, status text, reason text, public_key text, notafter int8, req_key int8)

build the statement finally
statement: select * from log
run the statement
### new function call ###
Entering sub doQuery
query: select * from log
prepare statement
statement nr.: 1
execute statement
execute failed
### leaving function doQuery unsuccessfully ###
query failed return undef (EXCEPT OF NEGATOR)
try to create table
Entering sub operateTable
build the create statements
table: log
create:create table log (action_number int8 primary key not null, datatype text, moduletype text, module text, log_submit_date text, log_do_date text, mykey text, submit_date text, format text, data text, cert_key int8, role text, dn text, cn text, email text, ra text, rao text, last_update text, next_update text, status text, reason text, public_key text, notafter int8, req_key int8)

build the statement finally
statement: create table log (action_number int8 primary key not null, datatype text, moduletype text, module text, log_submit_date text, log_do_date text, mykey text, submit_date text, format text, data text, cert_key int8, role text, dn text, cn text, email text, ra text, rao text, last_update text, next_update text, status text, reason text, public_key text, notafter int8, req_key int8)

run the statement
### new function call ###
Entering sub doQuery
query: create table log (action_number int8 primary key not null, datatype text, moduletype text, module text, log_submit_date text, log_do_date text, mykey text, submit_date text, format text, data text, cert_key int8, role text, dn text, cn text, email text, ra text, rao text, last_update text, next_update text, status text, reason text, public_key text, notafter int8, req_key int8)

prepare statement
statement nr.: 2
execute statement
execute succeeded
### leaving function doQuery successfully ###
query succeeded return 1 (EXCEPT OF NEGATOR)
table created
sequence generator initialized
table: CRL
dsn: dbi:Pg:dbname=openca;host=localhost;port=5432 the folloing debugging-output is for DB2
ld_library_path:
path: /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
libpath
classpath
Entering sub operateTable
build the create statements
table: crl
create:create table crl (crl_key text PRIMARY KEY NOT NULL, status text, format text, data text, last_update text, next_update text)

build the statement finally
statement: select * from crl
run the statement
### new function call ###
Entering sub doQuery
query: select * from crl
prepare statement
statement nr.: 3
execute statement
execute succeeded
### leaving function doQuery successfully ###
query succeeded return 1 (EXCEPT OF NEGATOR)

-------------------------------------------------
Error 690
Configuration Error.
Error while initializing the CA Database..
-------------------------------------------------
OpenCA::DBI automatic commit by destructor DESTROY
call finish on all statement handles to avoid warnings by DBI



Also the HTTPD log has the following entry:

DBD::Pg::st execute failed: ERROR:  Relation "log" does not exist at /usr/lib/perl5/site_perl/5.6.1/OpenCA/DBI.pm line 3077, <FD> line 36.

NOTICE:  current transaction is aborted, queries ignored until end of transaction block
NOTICE:  current transaction is aborted, queries ignored until end of transaction block
Error Trapped: <BR>Error while initializing the CA Database. at /usr/local/openca/OpenCA/lib/functions/misc-utils.lib line 20, <FD> line 36.

Compilation failed in require at /var/www/cgi-ca/ca line 194, <FD> line 36.


The postgres LOG has the following:

DEBUG:  InitPostgres
DEBUG:  StartTransactionCommand
DEBUG:  query: select getdatabaseencoding()
DEBUG:  ProcessQuery
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: begin
DEBUG:  ProcessUtility: begin
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: select * from log
ERROR:  Relation "log" does not exist
DEBUG:  AbortCurrentTransaction
DEBUG:  StartTransactionCommand
DEBUG:  query: create table log (action_number int8 primary key not null, datatype text, moduletype text, module text, log_submit_date text, log_do_date text, mykey text, submit_date text, format text, data text, cert_key int8, role text, dn text, cn text, email text, ra text, rao text, last_update text, next_update text, status text, reason text, public_key text, notafter int8, req_key int8)

NOTICE:  current transaction is aborted, queries ignored until end of transaction block
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: select * from crl
NOTICE:  current transaction is aborted, queries ignored until end of transaction block
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: rollback
DEBUG:  ProcessUtility: rollback
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: begin
DEBUG:  ProcessUtility: begin
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: commit
DEBUG:  ProcessUtility: commit
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: begin
DEBUG:  ProcessUtility: begin
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: rollback
DEBUG:  ProcessUtility: rollback
DEBUG:  CommitTransactionCommand
DEBUG:  proc_exit(0)
DEBUG:  shmem_exit(0)
DEBUG:  exit(0)
DEBUG:  reaping dead processes
DEBUG:  child process (pid 18477) exited with exit code 0


I also looked into the DBI.pm code and if I comment out the section of code (lines 908-920) that checks for the existance of tables in the database everything works fine - assuming the database is empty.

So is this a bug or am I doing something wrong ?







Dejan Kulpinski
Sierra Systems
604-688-1371

Reply via email to