Forum OpenACS Q&A: dotLRN: error when adding a new class

When adding a new class in dotLRN, I got the following error message (on the "class-instance-new" page):

ora8.c:3546:ora_tcl_command: error in `OCIStmtExecute
()': ORA-00001: unique constraint (DOTLRN.CR_ITEMS_UNIQUE_NAME)
violated
ORA-06512: at "DOTLRN.CONTENT_ITEM", line 161
ORA-06512: at "DOTLRN.CONTENT_FOLDER", line 34
ORA-06512: at "DOTLRN.FILE_STORAGE", line 85
ORA-06512: at line 3

SQL: 
            begin
                :1 := file_storage.new_root_folder(
                    package_id => :package_id,
                    folder_name => :pretty_name,
                    description => :description
                );
            end;
        
    while executing
"ns_ora exec_plsql_bind nsdb0 {
            begin
                :1 := file_storage.new_root_folder(
                    package_id => :package_id,
  ..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $ulevel [list ns_ora $type $db $sql] $args"
    invoked from within
"db_exec exec_plsql_bind $db $full_statement_name $sql 2 1
"""
    invoked from within
"if { [regexp {:1} $test_sql] } {
            return [db_exec exec_plsql_bind $db $full_statement_name
$sql 2 1 ""]
        } else {
            return [db_exec dml $db $fu..."
    ("uplevel" body line 5)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle db {
        # Right now, use :1 as the output value if it occurs in the
statement,
        # or not otherwise.
        set test_sql [db_qd_replace_s..."
    (procedure "db_exec_plsql" line 11)
    invoked from within
"db_exec_plsql new_root_folder {}"
    (procedure "fs::new_root_folder" line 7)
    invoked from within
"fs::new_root_folder  -package_id $package_id  -pretty_name
"${community_name}'s Files"  -description
"${community_name}'s Files"  "
    (procedure "dotlrn_fs::add_applet_to_community" line 7)
    invoked from within
"dotlrn_fs::add_applet_to_community $community_id"
    (procedure
"AcsSc.dotlrn_applet.AddAppletToCommunity.dotlrn_fs" line 1)
    invoked from within
"AcsSc.dotlrn_applet.AddAppletToCommunity.dotlrn_fs 6496"
    ("uplevel" body line 1)
    invoked from within
"uplevel $func_and_args"
    (procedure "apply" line 3)
    invoked from within
"apply $proc_name $arguments"
    (procedure "acs_sc_call" line 6)
    invoked from within
"acs_sc_call dotlrn_applet $op $list_args $applet_key"
    (procedure "applet_call" line 2)
    invoked from within
"applet_call $applet_key AddAppletToCommunity [list
$community_id]"
    invoked from within
"set package_id [applet_call $applet_key AddAppletToCommunity
[list $community_id]]"
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $transaction_code "
    (procedure "db_transaction" line 1)
    invoked from within
"db_transaction {
            # Callback
            set package_id [applet_call $applet_key
AddAppletToCommunity [list $community_id]]

            se..."
    (procedure "dotlrn_community::add_applet_to_community"
line 2)
    invoked from within
"dotlrn_community::add_applet_to_community $community_id
$applet_key"
    ("foreach" body line 3)
    invoked from within
"foreach applet_key $default_applets_list {
                if {[dotlrn_applet::applet_exists_p -applet_key
$applet_key]} {
                    dotlrn_..."
    ("uplevel" body line 70)
    invoked from within
"uplevel 1 $transaction_code "
    (procedure "db_transaction" line 39)
    invoked from within
"db_transaction {
            set user_id [ad_conn user_id]
            set community_id [package_instantiate_object -extra_vars
$extra_vars $object_ty..."
    (procedure "dotlrn_community::new" line 25)
    invoked from within
"dotlrn_community::new  -description $description  -community_type
$class_key  -object_type [community_type]  -community_key
$community_key  -pretty_na..."
    invoked from within
"set community_id [dotlrn_community::new  -description
$description  -community_type $class_key  -object_type
[community_type]  -community_key $communi..."
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $transaction_code "
    (procedure "db_transaction" line 39)
    invoked from within
"db_transaction {
            # Create the community
            set community_id [dotlrn_community::new  -description
$description  -community_type $c..."
    (procedure "dotlrn_class::new_instance" line 16)
    invoked from within
"dotlrn_class::new_instance  -class_key $class_key  -term_id
$term  -pretty_name $pretty_name  -description $description 
-join_policy $join_policy  "
    invoked from within
"if {[form is_valid add_class_instance]} {
    form get_values add_class_instance  class_key term pretty_name
description join_policy add_instructor re..."
    ("uplevel" body line 50)
    invoked from within
"uplevel {
          #
#  Copyright (C) 2001, 2002 OpenForce, Inc.
#
#  This file is part of dotLRN.
#
#  dotLRN is free software; you can redistribute it..."
    (procedure
"code::tcl::/web/dotlrn/packages/dotlrn/www/admin/class-insta..."
line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is
up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is
up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 3)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
        $handler
      } ad_script_abort val {
        # do nothing
      }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
        rp_serve_abstract_file "$root/$path"
        set tcl_url2file([ad_conn url]) [ad_conn file]
        set tcl_url2path_info([ad_conn url]) [ad_conn
path_inf..."
Collapse
Posted by Yonatan Feldman on
you need to: "cvs update -r 1.1 file-storage/tcl/file-storage-init.tcl"

there is a conflict i haven't resolved since the merge of the openacs-4-5 beta branch. this will fix the problem until i figure out how to resolve this issue permanently.

Collapse
Posted by Yonatan Feldman on
sorry it took so long but i have finally resolved this conflict. if you update file-storage and dotlrn-fs to the head of their respective CVS trees everything should work just fine.