Forum .LRN Q&A: Re: Re: Bulk User Account problem
We're on Postgresql. I've had a look at the users-bulk-upload-2.tcl and can see what's going on there. I'm not sure where to find the user creation routines but I'm sure I can follow it through.
I'll have another look when I get a minute and if I still can't figure it out then I'll let you know.
Thanks for the help,
set user_id [db_nextval acs_object_id_seq]
-user_id $user_id \
-username "$row(username)" \
-email $row(email) \
-first_names $row(first_names) \
-last_name $row(last_name) \
I have seen in some bug fixes that it should actually be changed to this instead...
set user_id [ad_user_new $row(email) $row(first_names) $row(last_name) $password "" "" "" "t" "approved"]
Anyone know anything about this and how it should read?
What I would check though is to write out all variables like user_id, $row(username) and so on into your logfile using ns_log Notice to make sure your CSV file is correct and all data is present. Furthermore make sure that you CSV file does not contain extra "," where they don't belong.
I have tried it with the following CSV files:
I have searched through them with a toothpick and couldn't find anything wrong with any of them. I may be really stupid and have missed something REALLY obvious out of this file...
I'll try the ns_log now and see what I can get. I hope I can get this fixed because we've got 20,000 accounts to create in the next month!
Furthermore make absolutely sure that there is no blank line or anything like this in your CSV file at the end.
And last but not least, think about getting rid of the db_transaction and just log (instead of stop) on error, so you know which users failed to get inserted.