[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Error SetError() #66: Got more error log info now



This sounds a lot like WebSense minus the redirections.
It took the network here about 3 days to get all of the partitions from going into WebSense.
They took 3 or 4 tries before they finally got it.
As soon as it stopped going through WebSense, everything worked the way it should (HTTPApi).
It's too bad you can't get the file in the /tmp directory of the IFS 
(I think you could if you took out the unlink and provided your own name) to show them it's still going through iPrism.

Craig
 

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Adam West
Sent: Tuesday, July 08, 2008 3:13 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Error SetError() #66: Got more error log info now

Scott, the Network Admin cannot make it happen. He understands generally what the problem is, said he took the I out of the Prism loop so to speak, but there are no tangible differences at all.
 
Perhaps someone on the list also has Prism installed. It is indeed a internet filter where the admin can list those sites that are off limites to employees, possibly categories of sites as well.
 
 At the moment I have to contend with the fact that I cannot do what I was assigned. to automate the gathering of foreign currency rates to the I on a daily basis.
 
This leaves me to think of other ways to do this, using FTP.

--- On Tue, 7/8/08, Scott Klement <klemscot@xxxxxxxxxxxx> wrote:

From: Scott Klement <klemscot@xxxxxxxxxxxx>
Subject: Re: Error SetError() #66: Got more error log info now
To: "HTTPAPI and FTPAPI Projects" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tuesday, July 8, 2008, 5:02 PM

Adam,

You appear to have a network appliance called 'iPrism' installed, and it is blocking your ability to access anything outside of your network.

iPrism is sending a "normal response" (i.e. HTTP code 200, which means
"success") in response to your request, but it's sending you an HTML 
document.   Since this document is HTML (and not XML) it's not going to 
be a valid XML document, thus HTTPAPI is giving you a parse error.

The solution will be to configure HTTPAPI to use your proxy so you can bypass the iPrism device -- but I have no way of knowing what the settings to do that would be, since I'm not familiar with the device or how your network is configured.

Since the iPrism device is returning a 200 response, I assume that the HTML file that HTTPAPI is downloading would have more information. 
However, for some reason, this document is cut off in your log file. 
Either you are using http_url_get_xml() (instead of http_url_get, which is what Craig showed me) or you've doctored your log file to remove the 
remainder of the response.   Try reading that response to learn more 
about it.

Hopefully you have a network admin on site who understands what's needed to bypass the iPrism device.  Most likely, it's going to involve calling
http_setProxy() to tell HTTPAPI to use a proxy to access the web.



Adam West wrote:
>    Scott, I re-ran this program using the version prior to some of the
>    changes you had made to Craig's code ( the field rate for example
you
>    made numeric, etc.)
> 
>    now we get a more robust error log.
> 
> 
>    New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
>    ProtLoc=0
>    http_url_get():
>    entered
>    http_persist_open():
>    entered
>    http_long_ParseURL():
>    entered
>    DNS resolver retrans:
>    2
>    DNS resolver retry  :
>    2
>    DNS resolver options:
>    x'00000136'
>    DNS default domain:
>    DNSNAME
>    DNS server found:
>    192.nnn.n.n
>    DNS server found:
>    192.nnn.n.n
>    DNS server found:
>    198.n.n.n
>    DNS server found: 198.n.n.n
>    http_persist_get(): entered
>    http_long_ParseURL(): entered
>    do_get(): entered
>    GET /usd/feed HTTP/1.1
>    Host: xurrency.com
>    User-Agent: http-api/1.23
> 
> 
>    recvresp(): entered
>    HTTP/1.0 200 OK
>    Date: Wed, 6 May 1970 20:19:59 GMT
>    X-Date: Tue, 08 Jul 2008 15:49:46 GMT
>    Server: iPrism-httpd/v4 (Unix) ssl_enabled ossl
>    Expires: 0
> 
>    Expires: 0
>    Cache-Control: max-age=0, must-revalidate
>    Pragma: no-cache
>    Content-Type: text/html
> 
>    SetError() #13: HTTP/1.0 200
>    OK
>    recvdoc parms: identity
>    0
>    header_load_cookies()
>    entered
>    recvdoc():
>    entered
>    SetError()
>    #0:
>     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2
Final//EN\" > <HTML>
>    <HEAD>  <META
>    http_close():
>    entered
>    SetError() #66: XML parse failed at line 1, col 54: illegal
>    character(s) in public id
>    --- On Mon, 7/7/08, Scott Klement <klemscot@xxxxxxxxxxxx> wrote:
> 
>      From: Scott Klement <klemscot@xxxxxxxxxxxx>
>      Subject: Re: Error SetError() #66:
>      To: "HTTPAPI and FTPAPI Projects"
<ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
>      Date: Monday, July 7, 2008, 9:22 PM Hi Adam,
> 
> Unfortunately, you haven't provided enough detail for me to help you. 
I 
> assume that you are still using Craig Jabobsen's code, correct?  If
so, 
> there's one point at which he uses HTTPAPI to download a file by
calling 
> the http_url_get() API.  The code looks like this (I've removed the 
> comments so we can focus on the code):
> 
> --
> 
> Url = 'http://xurrency.com/usd/feed';
> FileName = Http_TempFile() + '.xml';
> 
> RetCode = Http_Url_Get(Url : FileName ); If RetCode <> 1;
>   UnLink(FileName);
> EndIf;
> 
> If Http_Parse_XML_Stmf( FileName
>                          : HTTP_XML_CALC
>                          : *Null
>                          : %PAddr(Incoming)
>                          : *Null )
>   < 0;
> EndIf;
> 
> --
> 
> The problem with this code is that it does not do proper error handling. 
>   If an error occurs during http_url_get(), it erases the temp file, 
> but does not stop the program!  It continues to call the
HTTP_Parse_XML_Stmf().
> 
> The problem with that idea is that http_parse_xml_stmf() will wipe out 
> the debug file that was created by http_url_get() -- so you don't have

> any diagnostics.
> 
> So, after http_url_get() fails, it deletes the XML file, then deletes 
> the debug file, so you're really left with no information about the 
> problem.  This is the code that's teh culprit:
> 
> If RetCode <> 1;
>   UnLink(FileName);
> EndIf;
> 
> The easiest fix is to change the above code to look like the following:
> 
> If RetCode <> 1;
>   UnLink(FileName);
>   http_crash();
> EndIf;
> 
> The http_crash() API will abort the program with an *ESCAPE message 
> when it fails.  You can use the data in that escape message, in 
> addition to the data in the /tmp/httpapi_debug.txt file to determine 
> what the problem is.
> 
> Try making that change and see if there's more info in the 
> /tmp/httpapi_debug.txt file...?
> 
> 
> Adam West wrote:
>>    I have these 2 coded:
>>
>>    H Option(*SrcStmt:*NoDebugIO) Debug(*Yes)
>>
>>    // debug (ifs subdir tmp/httpapi_debug.txt if on)
>>    Http_Debug(*On);
>>
>>
>>    I do not know how to find this questionable character.I am not
getting
>>    any other document or line in the IFD tmp file.
>>
>>
>>    THe code has this in it but it is not getting generated
>>
>>
>>    // create a tempory file in subdirectory tmp in the ifs
>>     FileName = Http_TempFile() + '.xml';
>>
>>
>>
>>
>>    -----Original Message-----
>>    From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>>    [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike
Krebs
>>    Sent: Monday, July 07, 2008 4:34 PM
>>    To: 'HTTPAPI and FTPAPI Projects'
>>    Subject: RE: Error SetError() #66:
>>
>>
>>    What is the character at position 54 of the xml?
>>
>>
>>    Did you turn on debug? You should get much more that one entry if
you
>>    turn
>>
>>    on debug.
>>
>>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------


      

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.  Unless expressly stated in this e-mail, nothing in this message or any attachment should be construed as a digital or electronic signature.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------