Forum OpenACS Q&A: Error thrown by request processor

Does anyone know why every so often the edit-2.tcl page throws this error?

Nine times in ten the edit function works flawlessly, and then for some reason cannot read "field_name".

Regards
Richard

[13/May/2003:17:52:30][18402.49159][-conn3-] Notice: RP (1873.606 ms): error in rp_handler: serving POST /purchase/admin/products/edit-2
	ad_url "/purchase/admin/products/edit-2" maps to file "/web/server/packages/ecommerce/www/admin/products/edit-2.tcl"
errmsg is can't read "field_name": no such variable
[13/May/2003:17:52:30][18402.49159][-conn3-] Notice: Querying '
            select 1
            where 't' = acs_permission__permission_p('5892', '2604', 'admin');'
[13/May/2003:17:52:30][18402.49159][-conn3-] Notice: dbinit: sql(localhost::server): '
            select 1
            where 't' = acs_permission__permission_p('5892', '2604', 'admin')
        '
[13/May/2003:17:52:30][18402.49159][-conn3-] Error: POST http://63.246.3.10:8446/purchase/admin/products/edit-2?
referred by "https://63.246.3.10:8446/purchase/admin/products/edit?product%5fid=6563"
can't read "field_name": no such variable
    while executing
"doc_body_append "
	>tr>
	>td>
	$field_name
	>/td>
	>td>
	""
    invoked from within
"if { [info exists ec_custom_fields($field_identifier)] } {
	doc_body_append "
	>tr>
	>td>
	$field_name
	>/td>
	>td>
	"
	if { $column_type == "char(1)"..."
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    ("1" arm line 1)
    invoked from within
"switch $errno {
		0 {
		    # TCL_OK
		}
		1 {
		    # TCL_ERROR
		    global errorInfo errorCode
		    error $error $errorInfo $errorCode
		}
		2 {
	..."
    ("while" body line 20)
    invoked from within
"while { [db_getrow $db $selection] } {
	    incr counter
	    if { [info exists array_val] } {
		unset array_val
	    }
	    if { ![info exists column..."
    ("uplevel" body line 5)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle db {
	set selection [db_exec select $db $full_statement_name $sql]

	set counter 0
	while { [db_getrow $db $selection] } {
	    incr co..."
    (procedure "db_foreach" line 35)
    invoked from within
"db_foreach custom_fields_select {
  select field_identifier, field_name, column_type
  from ec_custom_product_fields
  where active_p = 't'
} {
    if..."
    ("uplevel" body line 510)
    invoked from within
"uplevel {
    	  # /www/[ec_url_concat [ec_url] /admin]/products/edit-2.tcl
ad_page_contract {

  Edit a product.

  @author Eve Andersson (eveander@a..."
    (procedure "code::tcl::/web/server/packages/ecommerce/www/ad..." 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 u
Collapse
Posted by Richard Hamilton on
Just a further update on this one. I have an idea that this may be connected with a failure in the custom fields bulk upload function. I uploaded 700+ rows which reported 'success' (though Jerry Asher's caution in the remarks was to treat that with suspicion). Everything seemed ok but it has since transpired that only the first 250 were uploaded, for the rest of the products in the system the custom fields remained null.

I suspect therefore that this error is thrown by the .tcl script that generates the confirm changes page when it tries to display the custom fields for the product whose record is in the process of being updated by edit-2.tcl. Where we have been uploading photos, these are correctly uploaded and placed in the file system, but the confirm page chokes.

I will be trying to tie down the reason for the part failed bulk upload this weekend, if anyone has any ideas meanwhile I'd love to hear them.

Regards
Richard