Forum OpenACS Development: Error in package installer?

Collapse
Posted by Bart Teeuwisse on

The following error occurs when starting the package installer. I reported it in the SDM as bug #1058. Has anyone seen this too? A previous version did work OK for me. Any insights?


invalid node ID 
    while executing
"ns_xml node getcontent [lindex [ns_xml node children $node] 0"
    (procedure "apm_tag_value" line 8)
    invoked from within
"apm_tag_value -default "$properties(package-name)s" $package
pretty-plural"
    (procedure "apm_read_package_info_file" line 56)
    invoked from within
"apm_read_package_info_file $spec_file"
    ("foreach" body line 2)
    invoked from within
"foreach spec_file $all_spec_files {
	array set version [apm_read_package_info_file $spec_file]
	set version_name $version(name)
	set package_name $ver..."
    invoked from within
"if { [empty_string_p $spec_files] } {
    set install_path "[acs_root_dir]/packages"
    set all_spec_files [apm_scan_packages $install_path]
    # We..."
    ("uplevel" body line 22)
    invoked from within
"uplevel {
    	  ad_page_contract {

    Select, dependency check, install and enable packages.

    @author Bryan Quinn (bquinn@arsdigita.com)
    @c..."
    (procedure
"code::tcl::/web/openacs-4/packages/acs-admin/www/apm/package..." 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 3)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 31)
    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
Posted by Jeff Davis on
I got the same error when I tried to load a package with an empty
pretty-plural in the info file (events I think).  Not sure where the bug is...
I just filled the data in and it all worked.
Collapse
Posted by Dave Bauer on
I believe the bug is here:

 if { ![empty_string_p $node] } {

	# return [dom::node cget [dom::node cget $node -firstChild] -nodeValue]

	return [ns_xml node getcontent [lindex [ns_xml node children $node] 0]]

The code that converts to ns_xml exactly mirrors the TclDOM code. The behaviour of ns_xml is not exactly like a DOM implementation. ns_xml node getcontent will get whatever is inside the current tag pair. I think this will fix it:

return [ns_xml node getcontent $node]

getcontent automatically goes to the next node (the text node). I ran into this porting XML-RPC for Tcl to use ns_xml.
This bug bit me twice today.  If the patch is this easy, maybe it should be committed?  Or else the package creation should throw an informative error on creating a package with a blank plural?