Forum OpenACS Q&A: file-storqage error during "Add File" on 5.1.5 installation

As I denoted, I was caught by an error
And here is the error message
I am afraid that this is redundant one.
But I cannot solicit my case from too much crowded Q&A repository.....
Hope to get somebody's help
By the way, with 5.1.5 release I suffers from many errors.
Why? in my first evaluation, 5.1.4 seems to be more stable..
+++++++++++++++++++
Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

SQL:
select content_type
from cr_content_mime_type_map
where mime_type = 'text/plain'

while executing
"ns_pg_bind 0or1row nsdb0 {
select content_type
from cr_content_mime_type_map
where mime_type = :mime_type
}"
("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_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 -dbn $dbn db {
set selection [db_exec 0or1row $db $full_name $sql]
}"
(procedure "db_string" line 8)
invoked from within
"db_string registered_type_for_mime_type "" -default """
(procedure "cr_registered_type_for_mime_type" line 2)
invoked from within
"cr_registered_type_for_mime_type $mime_type"
(procedure "fs::add_file" line 13)
invoked from within
"fs::add_file -name $upload_file -item_id $this_file_id -parent_id $folder_id -tmp_filename $tmpfile -creation_user $user_id -creation_ip [ad_conn..."
("foreach" body line 22)
invoked from within
"foreach upload_file $upload_files tmpfile $upload_tmpfiles {
set this_file_id $file_id
set this_title $title
# upload a new file
# if the user cho..."
("uplevel" body line 32)
invoked from within
"uplevel #$level $new_data"
("1" arm line 598)
invoked from within
"switch $errno {
0 {
# TCL_OK
}
1 {
# TCL_E..."
(procedure "ad_form" line 612)
invoked from within
"ad_form -extend -form {} -select_query_name {get_file} -new_data {


set unpack_p [template::util::is_true $unpack_p]
set unzip_binary [st..."
("uplevel" body line 86)
invoked from within
"uplevel {
ad_page_contract {
page to add a new file to the system

@author Kevin Scaldeferri (mailto:kevin@arsdigita.com)
@creation-date 6..."
(procedure "code::tcl::/web/unijun/packages/file-storage/www/file-add" 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 5)
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'm running 5.1.5 code. I was testing this package and I was able to upload a .doc file and a URL, however, I got an error uploading a .jpg and .icon image. It looks like we're choking at the same place.

SQL:
select content_type
from cr_content_mime_type_map
where mime_type = 'image/jpeg'

while executing
"ns_pg_bind 0or1row nsdb0 {
select content_type
from cr_content_mime_type_map
where mime_type = :mime_type
}"
("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 {

I did some greps in the file-storage package and I couldn't find any hints. Does anyone have an guess where this problem could be? Either the content repository area or:

acs-tcl/tcl/00-database-procs.tcl

What do you thinks?

I think this is where it's choking...I don't really have the sql chops to notice if anything is obviously wrong here -- Does anyone see something.

From:
openacs/packages/acs-content-repository/tcl/item-procs.xql

(I had ro remove some tags because the forum doesn't accept HTML...)
*SNIP*
fullquery name="item::content_methods_by_type.cmbt_get_content_mime_types">
*SNIP*
select mime_type from cr_content_mime_type_map
where content_type = :content_type
and lower(mime_type) like 'text/%'
*SNIP*

Or maybe the file needs what was taken out recently:

http://cvs.openacs.org/cvs/openacs-4/packages/acs-content-repository/tcl/item-procs.xql?r1=1.6&r2=1.6.2.1