Alaska Software Inc. - Problem with WAA error handling in Xbase++ 2.0
Username: Password:
AuthorTopic: Problem with WAA error handling in Xbase++ 2.0
Thomas BraunProblem with WAA error handling in Xbase++ 2.0
on Tue, 07 Oct 2014 16:43:07 +0200
Hi,

after switching to Xbase++ 2.0, the customized error handling in WAA does
no longer work as before.

Instead of the error page I keep getting an Apache error message:

*-------------------------------*
Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, thomas.braun@ellistours.com and
inform them of the time the error occurred, and anything you might have
done that may have caused the error.

More information about this error may be available in the server error log.
*-------------------------------*

The Apache error log tells me the following:

malformed header from script. Bad header=<html>: waa2gate.exe, referer:
http://localhost/cgi-bin/waa2gate.exe

If I remove the custom ::prgError() method, everything works, but then I
don't have any additonal function like sending email from the error
handler, extended logging etc...

According to the documentation, nothing essential seesm to have changed
regarding error handling.

I even stripped down my error handling method to the minimum and according
to the debugger, the return string just looks fine. 

This is my "mimimum" error handling routine, in reality it contains much
more, but even this version does not work:

Method Base:PrgError(oError, oContext)
LOCAL cTemplate := ""
   cTemplate := MEMOREAD("WAA1ERR.HTM")

   cTemplate := STRTRAN(cTemplate, "<%var=WAA_PACKAGE%>"       , ::GetVar("WAA_PACKAGE"))
   cTemplate := STRTRAN(cTemplate, "<%var=WAA_FORM%>"          , ::GetVar("WAA_FORM"))
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_DESCRIPTION%>" , ConvToANSICP(oError:description))
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_OPERATION%>"   , oError:operation)
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_GENCODE%>"     , STR(oError:gencode))
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_OSCODE%>"      , STR(oError:oscode) )

RETURN cTemplate

Is there any way to inspect what is actually returned to the gateway and
apache server?

regards
Thomas
Andreas HerdtRe: Problem with WAA error handling in Xbase++ 2.0
on Tue, 07 Oct 2014 22:06:28 +0200
Hi Thomas,

If you need to know what is happening on the protocol level then
the wireshark can help: https://www.wireshark.org/

Drawback is that the package sniffer does not work when the components
(gateway and server) communicate via the loopback device, they must run
on different machines.

I can not remember that anything was done with the buffer management
of the WAA (which seems to be affected). Any chance for a description on
how to reproduce this.

As this is a "Xbase++ 2.0 specific" issue, please reply to 
public.xbase++.support.de
or public.xbase++.support.en. These newsgroups just came to life.

With my best regards,

  Andreas Herdt
  Alaska Software

--------------------------------------------------------------------

Technical Support:      support@alaska-software.com

News Server:            news.alaska-software.com
Homepage:               http://www.alaska-software.com
WebKnowledgeBase:       http://www.alaska-software.com/kbase.shtm

Fax European Office:    +49 (0) 61 96 - 77 99 99 23
Fax US Office:          +1 (646) 218 1281
--------------------------------------------------------------------

"Thomas Braun" wrote in message 
news:2ti2efkrcl68.13gh3x9y7qtzz$.dlg@40tude.net...
> Hi,
>
> after switching to Xbase++ 2.0, the customized error handling in WAA does
> no longer work as before.
>
> Instead of the error page I keep getting an Apache error message:
>
> *-------------------------------*
> Internal Server Error
>
> The server encountered an internal error or misconfiguration and was 
> unable
> to complete your request.
>
> Please contact the server administrator, thomas.braun@ellistours.com and
> inform them of the time the error occurred, and anything you might have
> done that may have caused the error.
>
> More information about this error may be available in the server error 
> log.
> *-------------------------------*
>
> The Apache error log tells me the following:
>
> malformed header from script. Bad header=<html>: waa2gate.exe, referer:
> http://localhost/cgi-bin/waa2gate.exe
>
> If I remove the custom ::prgError() method, everything works, but then I
> don't have any additonal function like sending email from the error
> handler, extended logging etc...
>
> According to the documentation, nothing essential seesm to have changed
> regarding error handling.
>
> I even stripped down my error handling method to the minimum and according
> to the debugger, the return string just looks fine.
>
> This is my "mimimum" error handling routine, in reality it contains much
> more, but even this version does not work:
>
> Method Base:PrgError(oError, oContext)
> LOCAL cTemplate := ""
>   cTemplate := MEMOREAD("WAA1ERR.HTM")
>
>   cTemplate := STRTRAN(cTemplate, "<%var=WAA_PACKAGE%>"       , 
> ::GetVar("WAA_PACKAGE"))
>   cTemplate := STRTRAN(cTemplate, "<%var=WAA_FORM%>"          , 
> ::GetVar("WAA_FORM"))
>   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_DESCRIPTION%>" , 
> ConvToANSICP(oError:description))
>   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_OPERATION%>"   , 
> oError:operation)
>   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_GENCODE%>"     , 
> STR(oError:gencode))
>   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_OSCODE%>"      , 
> STR(oError:oscode) )
>
> RETURN cTemplate
>
> Is there any way to inspect what is actually returned to the gateway and
> apache server?
>
> regards
> Thomas
Brian WolfsohnRe: Problem with WAA error handling in Xbase++ 2.0
on Tue, 07 Oct 2014 23:01:00 +0200
Andreas Herdt wrote in news:3310d620$51900009$df14@news.alaska-
software.com:

Andreas,

Are these new groups just available to current subscribers as mentioned a 
few days ago in another Xbase++ newsgroup ?

If so, i think that's a bit shortsighted on alaska's part..

> As this is a "Xbase++ 2.0 specific" issue, please reply to 
> public.xbase++.support.de
> or public.xbase++.support.en. These newsgroups just came to life.
> 
> With my best regards,
>
Andreas HerdtRe: Problem with WAA error handling in Xbase++ 2.0
on Wed, 08 Oct 2014 11:22:59 +0200
Hello Mr Wolfsohn,

Please refer to the said newsgroup. There is a welcome message that provides
updated information.

  Andreas Herdt
  Alaska Software

--------------------------------------------------------------------

Technical Support:      support@alaska-software.com

News Server:            news.alaska-software.com
Homepage:               http://www.alaska-software.com
WebKnowledgeBase:       http://www.alaska-software.com/kbase.shtm

Fax European Office:    +49 (0) 61 96 - 77 99 99 23
Fax US Office:          +1 (646) 218 1281
--------------------------------------------------------------------

"Brian Wolfsohn" wrote in message 
news:XnsA3BFAD10786CEblwcuscom@87.106.143.233...
> Andreas Herdt wrote in news:3310d620$51900009$df14@news.alaska-
> software.com:
>
> Andreas,
>
> Are these new groups just available to current subscribers as mentioned a
> few days ago in another Xbase++ newsgroup ?
>
> If so, i think that's a bit shortsighted on alaska's part..
>
>> As this is a "Xbase++ 2.0 specific" issue, please reply to
>> public.xbase++.support.de
>> or public.xbase++.support.en. These newsgroups just came to life.
>>
>> With my best regards,
>>
>
Brian WolfsohnRe: Problem with WAA error handling in Xbase++ 2.0
on Wed, 08 Oct 2014 13:42:57 +0200
Andreas Herdt wrote in
news:137a0362$4b64078a$eb14@news.alaska-software.com: 

> Hello Mr Wolfsohn,
> 
> Please refer to the said newsgroup. There is a welcome message that
> provides updated information.
> 

thank you.. i did not see those new groups last night...
Thomas BraunRe: Problem with WAA error handling in Xbase++ 2.0
on Wed, 08 Oct 2014 09:39:28 +0200
xpost & fup2 public.xbase++.support.en

Hi Andreas,

> Drawback is that the package sniffer does not work when the components
> (gateway and server) communicate via the loopback device, they must run
> on different machines.

I know - currently I don't have the time to set this up.

> I can not remember that anything was done with the buffer management
> of the WAA (which seems to be affected).

Not sure if that is the case - but obviously something changed...

> Any chance for a description on how to reproduce this.

Basically create a package that uses a custom subclass of the html3 class,
add a ::prgError() method to that class which returns a simple HTML page.

I created the following small sample that just works perfectly fine with
1.82.294, but not with 2.x

HTML3 class:
------------

CLASS ErrorTest FROM HTML3

   EXPORTED:

   METHOD prgError

ENDCLASS

Method ErrorTest:PrgError(oError, oContext)
LOCAL cTemplate := ""
   cTemplate := MEMOREAD("WAA1ERR.HTM")

   cTemplate := STRTRAN(cTemplate, "<%var=WAA_PACKAGE%>"       , ::GetVar("WAA_PACKAGE"))
   cTemplate := STRTRAN(cTemplate, "<%var=WAA_FORM%>"          , ::GetVar("WAA_FORM"))
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_DESCRIPTION%>" , ConvToANSICP(oError:description))
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_OPERATION%>"   , oError:operation)
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_GENCODE%>"     , STR(oError:gencode))
   cTemplate := STRTRAN(cTemplate, "<%var=ERROR_OSCODE%>"      , STR(oError:oscode) )

RETURN cTemplate

Form function:
--------------

FUNCTION Test(oH)
LOCAL aVars, nI

   aVars := oH:GetAllVars()
   FOR nI := 1 TO LEN(aVars)
      IF VALTYPE(aVars[nI,2,1]) = "C"
         oH:Put(aVars[nI,1] +": " + aVars[nI,2,1] + "/" )
         aVars[nI,2,1] := ConvertCharset(aVars[nI,2,1])
         oH:Put( oH:GetVar(aVars[nI,1] ) + "<br>" )
      ENDIF
   NEXT

    Uncomment the following line to get an error:
    nI := "5" + ASC("5")

RETURN .T.


HTML Form:
----------

<HTML>
  <HEAD>
  <TITLE>Package test</TITLE>

  </HEAD>

  <BODY>
    <FORM ACTION="/cgi-bin/waa1gate.exe" METHOD=POST>
      HTML3 Class:&nbsp; 
      <input TYPE="text" NAME="WAA_HTML3CLASS" VALUE="errortest" SIZE="15" MAXLENGTH="25"><br>
      Package:&nbsp; 
      <input TYPE="text" NAME="WAA_PACKAGE" VALUE="testP" SIZE="15" MAXLENGTH="25"><br>
      Form:&nbsp;
      <input TYPE="text" NAME="WAA_FORM" VALUE="test" SIZE="15" MAXLENGTH="25"><br><br>
      <input type=submit value="Submit" >
    </form>
  </BODY>
</HTML>