Forum .LRN Q&A: problems with PG7.2.1 + AOL server3.4.2

I am having problems with dotlrn that I didn't have before and I wonder if it is because I have changed the DB or something else.
The ones that I immediately found are when creating departmnets and communities, similar errors:
Selection did not return a value, and no default was 
provided
    while executing
"db_string select_node_id {}"
    (procedure "get_type_node_id" line 2)
    invoked from within
"get_type_node_id $parent_type"
    (procedure "dotlrn_community::new_type" line 4)
    invoked from within
"dotlrn_community::new_type  -community_type_key 
"$department_key"  -parent_type "dotlrn_class_instance"  -
pretty_name $pretty_name  -description $desc..."
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $transaction_code "
    (procedure "db_transaction" line 1)
    invoked from within
"db_transaction {
            dotlrn_community::new_type  -community_type_key 
"$department_key"  -parent_type "dotlrn_class_instance"  -
pretty_name $pr..."
    (procedure "dotlrn_department::new" line 13)
    invoked from within
"dotlrn_department::new  -pretty_name $pretty_name  -
description $description  -external_url $external_url"
    invoked from within
"if {[form is_valid add_department]} {
    form get_values add_department  pretty_name description 
external_url referer
Anyone else had this problem?
Collapse
Posted by Jeff Davis on
Is this with a checkout of the dotlrn-1-0 branch from CVS?  I had this
problem (and I thought I fixed it) when the bootstrap failed because of
poor error handling in the acs-service-contract module.

I was able to bootstrap with a checkout of the dotlrn-1-0 and oacs-4-6
branches of the code.

Collapse
Posted by Rafael Calvo on
Jeff,

This is a checkout from the openforce CVS. I couldn't figure out
the one at openacs.org

vs -z3 -d :pserver:mailto:anonymous@openacs.org:/cvsroot checkout -r
oacs-4-6 acs-core

and

cvs -z3 -d :pserver:mailto:anonymous@dotlrn.openforce.net:/dotlrn-
cvsroot co dotlrn-core

Collapse
Posted by Rafael Calvo on
I now droped the DB, and started with freshcode
1. cvs -z3 -d :pserver:anonymous@openacs.org:/cvsroot checkout -r oacs-4-6 acs-core
2. cvs -z3 -d :pserver:anonymous@openacs.org:/cvsroot co - roacs-4-6 acs-datetime acs-developer-support acs-events acs- mail-lite attachments bulk-mail calendar faq file-storage forums general-comments news notifications ref-timezones user-preferences
and 3. cvs -d :pserver:anonymous@dotlrn.openforce.net:/dotlrn- cvsroot co -rdotlrn-1-0 dotlrn-core
and when I install dotlrn: I get
psql:security-create.sql:94: ERROR:  triggered data change 
violation on relation "acs_privilege_hierarchy_index"
psql:custom-permissions.sql:62: ERROR:  parser: parse error 
at or near "or"

    invoked from within
"db_source_sql_file -callback $callback $path/$file_path"
    (procedure "apm_package_install_data_model" line 32)
    invoked from within
"apm_package_install_data_model -callback $callback -
data_model_files $data_model_files $spec_file_path"
    (procedure "apm_package_install" line 19)
    invoked from within
"apm_package_install -install_path $install_path  -callback 
apm_ns_write_callback -load_data_model  -data_model_files 
$data_model_files $spec_file"
    ("foreach" body line 36)
    invoked from within
"foreach pkg_info $pkg_install_list {
    set spec_file [pkg_info_spec $pkg_info]
    if { [catch {
	array set version [apm_read_package_info_file $spe..."
    ("uplevel" body line 34)
    invoked from within
"uplevel {
    	  ad_page_contract {
Collapse
Posted by Jeff Davis on
Rafael, the message about "or" makes me think you don't really have 7.2.1 ("create or replace" should be valid syntax for 7.2.1).  Can you
do "select version();" from psql and confirm that it is really 7.2.1...

I committed a fix for the security create problem
"cvs update dotlrn/sql/postgresql/security-create.sql" to get it.

Collapse
Posted by Jeff Davis on
actually, I fixed a bug in the custom-permissions.sql as well so update that too.
Collapse
Posted by Rafael Calvo on
Jeff,
<br>
You are right. The directory is called postgres7-2-1 so I assumed.. but
<pre>
dotlrn-dev=# select version();

                            version
------------------------------------------------------------------
PostgreSQL 7.1.3 on sparc-sun-solaris2.8, compiled by GCC 2.95.3
(1 row)
</pre>

Thanks! I am going to kill myself, then the guy who installed postgres, then I will update it to 7.2 😊
<br>
cheers

Collapse
Posted by Don Baccus on
The "triggered data change violation" is another 7.1 giveaway (and one of the main reasons we decided to demand 7.2 for OpenACS 4.6 and dotLRN).

Just for future reference.

Collapse
Posted by Rafael Calvo on
thanks guys
I installed 7.2.2, updated the code from cvs and get several errors that I did not have before, for example the FAQ portlet:
*** portal::render_element show callback Error! ***

 Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  No such attribute or function 'disabled_p'

SQL: 
            select acs_objects.context_id as package_id,
                   acs_object__name(apm_package__parent_id(acs_objects.context_id)) as parent_name,
                   (select site_node__url(site_nodes.node_id)
                    from site_nodes
                    where site_nodes.object_id = acs_objects.context_id) as url,
                   faqs.faq_id,
                   faqs.faq_name
            from faqs,
                 acs_objects
            where faqs.faq_id = acs_objects.object_id
	    and faqs.disabled_p <> 't'
            and acs_objects.context_id in (0)
            order by lower(faq_name)
        

this doesn't seem like an instalation error, but since I get several such as when trying to join a community (dotlrn/register?community_id=5522&..)
Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  Attribute 'autosubscribe_p' not found

SQL: 
            select forum_id
            from forums_forums
            where package_id = '5678'
              and autosubscribe_p = 't'
        
    while executing
"ns_pg_bind select nsdb0 {
            select forum_id
            from forums_forums
            where package_id = :package_id
              and auto..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql"
    invoked from within
"db_exec select $db $full_statement_name $sql"
    invoked from within
"set selection [db_exec select $db $full_statement_name $sql]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
what else could I be doing wrong, or are these new bugs?
Collapse
Posted by Jeff Davis on
Rafael, you should be able to do this to fix the autosubscribe_p error:
alter table forums_forums add autosubscribe_p                 char(1)
                                     constraint forums_autosubscribe_p_ck
                                     check (autosubscribe_p in ('t','f'));
update forums_forums set autosubscribe_p = 'f' 
 where autosubscribe_p is null;
alter table forums_forums alter column autosubscribe_p  SET DEFAULT 'f';
(I added this to dotlrn-forums-create.sql as well).

I will check one the other error as well...

Collapse
Posted by Rafael Calvo on
Thanks Jeff, That "somewhat" worked. I now get in dotlrn/clubs/e-learning/forums/forum-view
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

SQL: 
      
	select site_node__url(node_id) 
          from site_nodes 
         where object_id = '0'
    
      
    while executing
"ns_pg_bind 0or1row nsdb0 {
      
	select site_node__url(node_id) 
          from site_nodes 
         where object_id = :package_id
    
      }"
    ("uplevel" body line 1)
    invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql"
    invoked from within
"db_exec 0or1row $db $full_name $sql"
    invoked from within
"set selection [db_exec 0or1row $db $full_name $sql]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle db {
	set selection [db_exec 0or1row $db $full_name $sql]
    }"
    (procedure "db_string" line 7)
    invoked from within
What have we changed that is bring all these new problems?