Forum .LRN Q&A: bulk upload problem...

Collapse
Posted by manny quinto on
Tried to upload users using bulk upload using the latest dotLRN installer w/ postgresql 7.2.3 with the following users in csv file:

Wilhelmina,Bautista,mailto:wbautista@letran.edu,2050201,external,full,f
William,Baltazar,mailto:wbaltazar@letran.edu,22060321,external,full,f
Xutchil,Espiritu,mailto:xespiritu@letran.edu,97082601,external,full,f

the following errors appeared:

Request Error

bad completion code "can't read "row(email)": no such element in array": must be ok, error, return, break, continue, or an integer
    while executing
"return -code $error"
    (procedure "oacs_util::csv_foreach" line 43)
    invoked from within
"oacs_util::csv_foreach -file $file_location -array_name row {
        # We need to insert the ACS user
        set password [ad_generate_random_string..."
    ("uplevel" body line 4)
    invoked from within
"uplevel 1 $transaction_code "
    (procedure "db_transaction" line 1)
    invoked from within
"db_transaction {
    set fail_p 0

    oacs_util::csv_foreach -file $file_location -array_name row {
        # We need to insert the ACS user
        ..."
    ("uplevel" body line 45)
    invoked from within
"uplevel {
          #
#  Copyright (C) 2001, 2002 MIT
#
#  This file is part of dotLRN.
#
#  dotLRN is free software; you can redistribute it and/or modi..."
    (procedure "code::tcl::/var/lib/aolserver/servers/dotlrn/packages/dotlrn..." 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 "
    (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
2: Re: bulk upload problem... (response to 1)
Posted by Peter Marklund on
Manny,
I have reported this problem in the Bug Tracker and we will look at it on thursday which has become our bug fixing day. See

https://openacs.org/bugtracker/openacs/com/dotlrn/bug?bug%5fnumber=356

Collapse
3: Re: bulk upload problem... (response to 1)
Posted by Don Baccus on
I just tried with with my copy freshly checked out from CVS from the dotlrn-1-0 tag, and it works fine.

That was a typo that slipped in a week or so ago and was fixed by me a day or so later.

Peter, what copy of dotLRN does your installer use?

Can you test this against the latest dotlrn-1-0 CVS version of this file (dotlrn/www/admin/users-bulk-upload-2.tcl) and, if it works, close your ticket?

And if it doesn't let me know?  Because it works here, works at Sloan, and if isn't working for you it's a bit of a mystery.

Collapse
4: Re: bulk upload problem... (response to 1)
Posted by Radamanthus Batnag on
Peter, Don,

Sorry for bothering you.
It was a stupid mistake on our part.

We forgot to read the instruction:

The first line of the file must be the header line:
first_names,last_name,email,id,type,access_level,guest

The upload ran fine after we added the header line.

Curiously, one-line upload files without the header line worked, too.

Collapse
5: Re: bulk upload problem... (response to 1)
Posted by Stan Kaufman on
Bulk user upload will generate this error if you put in a bogus csv file. For instance, if you include an incorrect type ("staff" not "admin") in this file:

first_names,last_name,email,id,type,access_level,guest
Fat,Bastard,fb@fb.com,fb-1010,staff,full,t
Mortimer,Snerd,ms@ms.com,ms-1111,staff,full,t

you get this error in the transaction abort routine:

invalid database id:  "nsdb0"
    while executing
"ns_db dml $dbh "abort transaction""
    (procedure "db_transaction" line 115)
    invoked from within
"db_transaction {

    oacs_util::csv_foreach -file $file_location -array_name row {

        # First make sure the required data is there

        if ..."
    ("uplevel" body line 46)
    invoked from within
"uplevel {
    	  #
#  Copyright (C) 2001, 2002 MIT
#
#  This file is part of dotLRN.
#
#  dotLRN is free software; you can redistribute it and/or modi..."
    (procedure "code::tcl::/var/web/dotLRN-dev/packages/dotlrn/www/admin/use..." 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] } {

etc.etc.etc

This is on a fresh install this morning (cvs tags oacs-4-6-1-b2 and dotlrn-1-0). Seems to me that users who make a mistake in the format of their csv user list files should get a useful error and not a bomb.

Collapse
6: Re: bulk upload problem... (response to 1)
Posted by Don Baccus on
The bomb was due to an attempt to fix another problem in the database API, had nothing to do with bulk upload of users.

I fixed it a week or so ago, if you grab acs-tcl/tcl/00-database-procs.tcl from the oacs-4-6 branch in CVS you shouldn't see this problem.

Or you can wait until 4.6.2 is tarballed for beta - we're trying to do a code freeze for this version Saturday PM so you shouldn't have to wait long.