Forum .LRN Q&A: Importing Courses from OWC
Now processing imsmanifest.xml file...Granting permissions Test Manifest...
Adding Test Manifest...
Adding Manifest Metadata...
Adding Organization {Computation Structures}...
And after that it gives the following error:
Error: Ns_PgExec: result status: 7 message: ERROR: duplicate key value violates unique constraint "cr_items_unique_name"
CONTEXT: SQL statement "insert into cr_items ( item_id, name, content_type, parent_id, storage_type ) values ( $1 , $2 , $3 , $4 , $5 )"
PL/pgSQL function "content_item__new" line 105 at SQL statement
[17/Mar/2010:13:11:43][12970.3056380784][-conn:mdotlrn::6] Error: POST http://localhost:8000/dotlrn/classes/itdevelopment/itdevelopment.packaging/packaging/lorsm/admin/course-add-3?
referred by "http://localhost:8000/dotlrn/classes/itdevelopment/itdevelopment.packaging/packaging/lorsm/admin/course-add-2";
Database operation "0or1row" failed
(exception NSDB, "Query was not a statement returning rows.")
while executing
"ns_pg_bind 0or1row nsdb0 {
select content_item__new(:name,:parent_id,:item_id,:locale,:creation_date,:creation_user,:context_id,:creation_ip,:item_s..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."
invoked from within
"db_exec 0or1row $db $full_statement_name $sql"
invoked from within
"if {[regexp -nocase -- {^\s*select} $test_sql match]} {
# ns_log Debug "PLPGSQL: bypassed anon function"
set selection..."
("uplevel" body line 6)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
# plsql calls that are simple selects bypass the plpgsql
# mechanism for creating anonymous fun..."
(procedure "db_exec_plsql" line 57)
invoked from within
"db_exec_plsql exec_func_plsql {}"
(procedure "package_exec_plsql" line 31)
invoked from within
"package_exec_plsql -var_list $var_list content_item new"
invoked from within
"set item_id [package_exec_plsql -var_list $var_list content_item new]"
("uplevel" body line 3)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 39)
invoked from within
"db_transaction {
db_dml lock_objects "LOCK TABLE acs_objects IN SHARE ROW EXCLUSIVE MODE"
set item_id [package_exec_plsql -var_list $var_list cont..."
(procedure "content::item::new" line 25)
invoked from within
"content::item::new -name $name -item_id $item_id -content_type $content_type -parent_id $parent_id -creation_date [dt_sysdate] -creation_user $user_i..."
(procedure "lors::imscp::item_add" line 33)
invoked from within
"lors::imscp::item_add -org_id $p_org_id -parent_item $p_parent_item -identifier $p_identifier -identifierref $p_identifierref -isvisible $p_isvis..."
(procedure "lors::imscp::addItems" line 29)
invoked from within
"lors::imscp::addItems -itm_folder_id $new_items_parent_id -org_id $org_id $list_items 0 $tmp_dir"
("foreach" body line 28)
invoked from within
"foreach organization [$organizations child all organization] {
set org_identifier [lors::imsmd::getResource -node $organization -att ..."
invoked from within
"if {[file exists $fs_dir]} {
set all_files [list]
# now that exists, let's create it on the CR
# gets rid of the path and lea..."
("uplevel" body line 14)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 39)
invoked from within
"db_transaction {
## adds folder to the CR
set parent_id $folder_id
set fs_dir $tmp_dir
# checks for write permission on the parent f..."
("uplevel" body line 63)
invoked from within
"uplevel {
ad_page_contract {
Upload an IMS Content Package 3
Scope:
Add files to the CR
Process imsmanifest.xml
Determine..."
(procedure "code::tcl::/var/lib/aolserver/mdotlrn/packages/lorsm/www/adm..." 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 2)
invoked from within
"adp_prepare"
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 6)
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..."
I don't understand why it should be a constraint violation.. is something wrong with the package or something else??
Thanks in advanced..
Rafael
I have this this behavior before where the manifest.xml has relative file paths with ../.. etc style references which don't resolve when imported into LORS.
If not, at least somewhere in the manifest more than one resource has the same url reference so its trying to create two items with the same cr_items.name.