Forum OpenACS Q&A: Error: can't read "query" no such variable while....

I install an old ACS-3.4.x version of the old ArsDigita, running with
Oracle 8.1.7 and AOLServer 3.4.2 .When i try to access with the
navigator that's the error that the server catch:

Request Error

can't read "query": no such variable
    while executing
"ad_returnredirect "[ns_conn location][ns_conn url]$query""

                    AOLserver/3.4.2 on http://draco.salleURL.edu:15000

The tail -f don't report more information about it.


                          Thank's in advance:    Pol Vilarmau

I still have got the error reported in my last message. I think that maybe could be a bad configuration of the server. Please could someone tell me any idea? I'm so lose. The installation is new. Anyone knows were is the "ad_returnredirect" function defined?

Thanks in advance

Hi Pol,

Its at [oacs_root]/packages/acs-tcl/tcl/utilities-proc.tcl around 2,000 line marker.  You can use the api browser at http://[host]/api-doc.

It maybe that you are not able to connect to a database.... ooops sorry about that line above.  If you are using ACS 3.4.x it may reside at [acs_root]/tcl/utilities.tcl or something.  Try using grep in getting the code.

Well, with the grep command i could detect wich  *.tcl is reporting de bug.

it's in web/myserver/packages/acs-core/request-processor-procs.tcl

but i don't know what happens. That's a file of ACS and i never edit it.

Here is the code with the problem:

            if { [ad_parameter ForceHostP "" 1] } {

                rp_debug "Checking the host header"

                set host_header [ns_set iget [ns_conn headers] "Host"]

                regexp {^([^:]*)} $host_header "" host_without_port

                regexp {^https?://([^:]+)} [ns_conn location] "" desired_host_without_port

                if { ![empty_string_p $host_header] &&
                        ![string equal $host_without_port $desired_host_without_port] } {

                    rp_debug "Host header is set to "$host_header"; forcing to "[ns_conn location]""

                    if { [ns_getform] != "" } {
                        set query "?[export_entire_form_as_url_vars]"
                    }

ad_returnredirect "[ns_conn location][ns_conn url]$query"
return "filter_return"

                }

            }

I think that the problem is that [ns_getform] don't return nothing and then... query doesn't exist.

Any new idea?

Thanks again!

It's probably a dead end wading through code to find the source of that error - it's most likely a configuration issue rather than a problem with the ACS 3.4 source code.

Make sure you have no errors in your AOLserver error log.

I notice you're using AOLserver 3.4.2. The recommended version is 3.3+ad13 (available on this site). You could try that and see if the problem disappears. If not, post the contents on your AOLserver config file, it could be something simple in that.

Hi again! Well, here is my ACS ini file. I'm sure that we are near the solution! :)

Thank's to all!

#
# AOLServer ACS Virtual Server Configuration File Template
#
# $Id: template-ini.ini,v 1.4 2001/06/19 18:22:20 bruno Exp $

ns_section ns/db/drivers

ns_param ora8 ora8.so

ns_section ns/db/pool/main

ns_param MaxIdle 1000000000

ns_param MaxOpen 1000000000

ns_param Driver ora8

ns_param Connections 4

ns_param DataSource {}

ns_param User polv

ns_param Password polvpw

ns_param Verbose On

ns_param ExtendedTableInfo On

ns_section ns/db/pool/subquery

ns_param MaxIdle 1000000000

ns_param MaxOpen 1000000000

ns_param Driver ora8

ns_param Connections 4

ns_param DataSource {}

ns_param User polv

ns_param Password polvpw

ns_param Verbose On

ns_param ExtendedTableInfo On

ns_section ns/db/pool/log

ns_param MaxIdle 1000000000

ns_param MaxOpen 1000000000

ns_param Driver ora8

ns_param Connections 3

ns_param DataSource {}

ns_param User polv

ns_param Password polvpw

ns_param Verbose On

ns_param ExtendedTableInfo On

ns_section ns/db/pools

ns_param main main

ns_param subquery subquery

ns_param log log

ns_section ns/parameters

# This used to handled with a file under acs/parameters, but

# parameters are now stored in the database.

ns_param User nsadmin

ns_param Group web

ns_param ServerLog /usr/local/aolserver/log/polv-error.log

ns_param Home /usr/local/aolserver

ns_param StackSize 500000

ns_param MaxKeepAlive 5

ns_section ns/threads

# use more than 1 processor (Solaris)

ns_param SystemScope on

ns_section ns/server/polv

ns_param PageRoot /web/polv/www

ns_param DirectoryFile {index.tcl,index.adp,index.html,index.htm }

ns_param Webmaster mailto:ca06334@salleURL.edu

ns_param NoticeBgColor {"#ffffff"}

ns_param EnableTclPages On

ns_param NotFoundResponse /global/file-not-found.html

ns_param ServerBusyResponse /global/busy.html

ns_param ServerInternalErrorResponse /global/error.html

ns_param MaxThreads 20

ns_param MaxBusyThreads 15

ns_param MaxWait 2

ns_section ns/server/polv/db

ns_param Pools main,subquery,log

ns_param DefaultPool main

ns_section ns/server/polv/adp

ns_param Map /*.adp

ns_param DefaultParser fancy

ns_section ns/server/polv/module/nslog

ns_param EnableHostnameLookup Off

ns_param File /usr/local/aolserver/log/polv.log

ns_param LogCombined On

ns_param LogRefer Off

ns_param LogUserAgent Off

ns_param MaxBackup 7

ns_param RollDay *

ns_param RollFmt %Y-%m-%d-%H:%M

ns_param RollHour 0

ns_param RollOnSignal On

ns_param RollLog On

ns_section ns/server/polv/module/nsperm

ns_param model Small

ns_param enablehostnamelookup Off

ns_section ns/server/polv/module/nssock

ns_param timeout 120

ns_param Address 172.16.6.22

ns_param Hostname draco.salleURL.edu

ns_param Port 15000

# [ns/server/polv/module/nsssl]

# Address=172.16.6.22_ssl

# Hostname=draco.salleURL.edu

# CertFile=AOL_HOME/servers/polv/cert.pem

# KeyFile=AOL_HOME/servers/polv/key.pem

# Port=15000_ssl

ns_section ns/server/polv/modules

ns_param nsperm nsperm.so

ns_param nssock nssock.so

ns_param nslog nslog.so

ns_param nssha1 nssha1.so

ns_param nscache nscache.so

ns_param nsrewrite nsrewrite.so

# nsssl=nsssle.so

ns_section ns/server/polv/MimeTypes

ns_param Default text/plain

ns_param NoExtension text/plain

ns_param .pcd image/x-photo-cd

ns_param .prc application/x-pilot

ns_section ns/server/polv/tcl

ns_param Library /web/polv/tcl

set servername            "polv"

set serverdesc            "Pol Vilarmau TFC Server"

ns_section "ns/server/polv/acs/redirect"

ns_param Pattern "/pvt/address-book|/address-book"

ns_section "ns/servers"
ns_param $servername $serverdesc

Pol, that looks fine assuming Oracle is installed on the same machine as your AOLserver.
What happens when you type the following from your unix prompt?
sqlplus polv/polvpw
followed by
select sysdate from dual;
Are there any errors in your AOLserver error log?
Hi Brian!
I execute the query and there's no erros in the AOLserver log file and
the query returns the actual date.

Maybe the only solution is install the recomended version of AOLserver?

Oh yes, one more thing to check is that in the ad.ini file (in the parameters directory) you have replaced all references to yourservername to polv.

Change lines like this
[ns/server/yourservername/acs]
to
[ns/server/polv/acs]

I'm not sure what the difference between AOLserver 3.3+ad13 and 3.42 is. Maybe someone else could answer that?

Hi again! Well, i check de polv.ini file and all the references was changed to polv.
Well Brian, then... you recomend me to change the version of my aolserver?

Thanks!