cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problems using cURLl to Form Post a file above 50K

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Tue, 5 Oct 2004 11:18:45 -0500

Is it just me, or does it look like the proxy has DNS issues?? It's
coming back with:

    The host name was not found during the DNS lookup.

and then succeeding on the second try. The way DNS works is, after
the request goes out, if you (or the proxy, in this case) give up
waiting for a reply, the request stays active. If a response
eventually comes through, it gets cached locally. So, on the second
try, you get the cached info real quick. It eventually expires,
though.

Can you try something like "nslookup <hostname>" right before trying
to make the connection with curl?? Doesn't really matter what you
do, as long as it gets the proxy to do a DNS lookup. If the curl
trace on the subsequent transfer *doesn't* include the "host name not
found", that'll at least define part of the problem.

You could even get the IP address for the target host and use that
directly, to bypass the DNS lookup during the transfer. Don't rely on
that long-term, though, in case the host moves, but it might generate
useful info while debugging.

Ralph Mitchell

On Tue, 5 Oct 2004 09:54:49 -0400, Meyer, Aaron <aaron.meyer_at_onstar.com> wrote:
> > On Tues, 5 Oct 2004, Stenberg Daniel wrote:
>
> > < HTTP/1.1 502 Bad Gateway
> > < Date: Mon, 04 Oct 2004 18:34:52 GMT
> > < Content-Length: 333
> > < Content-Type: text/html
> > < Server: NetCache appliance (NetApp/5.3.1R2)
> > <HTML>
> > <HEAD><TITLE>502 Bad Gateway</TITLE></HEAD>
> > <BODY>
>
> > This response is given by your proxy, right?
>
> >I think that one is to blame for this, but no, I cannot explain why you can
> do
> >the same operation manually. I suggest you use a network analyzer (like
> >ethereal) to figure out the differences and then attempt to make the curl
> >command line look more like the browser's request. Or if something looks
> like
> >a bug: post it here.
>
>
> Thank you for the reply. I will attempt to analyze the transaction.
>
> As an added bit of information, I have found that even on successful
> transactions using cURL, I still initially get an error message. However,
> my connection is not closed, and the file is then sent. Again, this only
> works for files smaller than 80K. A successful transaction looks like the
> following:
>
> C:\CURL>"C:\CURL\"curl -v --proxy 155.55.55.1:80 --proxy-user id:passwd -F
> "txtUserName=id2" -F "txtPassword=passwd2" -F txtDomain=xxx" -F
> "file1=Customer.txt" -F "fileType=CUSTOMER" https://staging/upload.asp
>
> * About to connect() to 155.55.55.1 port 80
> * Connected to 155.55.55.1 (155.55.55.1) port 80
> * Proxy auth using Basic with user 'id'
> > POST http://curl HTTP/1.1
> Proxy-Authorization: Basic bnp6YzZyOnQwdGFsYmF0Mg==
> User-Agent: curl/7.12.0 (i386-pc-win32) libcurl/7.12.0 OpenSSL/0.9.7d
> zlib/1.2.1
>
> Host: curl
> Pragma: no-cache
> Accept: */*
> Content-Length: 63766
> Expect: 100-continue
> Content-Type: multipart/form-data;
> boundary=----------------------------2efbe2fb
> f956
>
> < HTTP/1.1 502 Bad Gateway
> < Date: Tue, 05 Oct 2004 13:17:27 GMT
> < Content-Length: 333
> < Content-Type: text/html
> < Server: NetCache appliance (NetApp/5.3.1R2)
> <HTML>
> <HEAD><TITLE>502 Bad Gateway</TITLE></HEAD>
> <BODY>
> <H1>Bad Gateway</H1>
> <H4>
> The following error occurred:<P>
> The host name was not found during the DNS lookup. Contact your system
> administr
> ator if the problem is.not found by retrying the URL. (DNS_HOST_NOT_FOUND)
> </H4>
> <HR>
> Please contact the administrator.
> </BODY>
> </HTML>
> * Connection #0 to host curl left intact
> * About to connect() to 155.55.55.1 port 80
> * Connected to 155.55.55.1 (155.55.55.1) port 80
> * Establish HTTP proxy tunnel to staging:443
> * Proxy auth using Basic with user 'id'
> < HTTP/1.0 200 Connection established
> < Proxy-Agent: NetCache NetApp/5.3.1R2
> <
> * Proxy replied OK to CONNECT request
> * successfully set certificate verify locations:
> * CAfile: C:\CURL\curl-ca-bundle.crt
> CApath: none
> * SSL connection using RC4-MD5
> * Server certificate:
> * subject: /C=US/ST=California/L=Torrance/O=AHM Inc.
> /OU=eBusiness/OU=Terms of use at www.verisign.com/rpa (c)00/CN=staging.com
> * start date: 2004-07-07 00:00:00 GMT
> * expire date: 2005-07-07 23:59:59 GMT
> * common name: staging.com (matched)
> * issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign
> Interna
> tional Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY
> LTD.
> (c)97 VeriSign
> * SSL certificate verify ok.
> > POST /upload.asp HTTP/1.1
> User-Agent: curl/7.12.0 (i386-pc-win32) libcurl/7.12.0 OpenSSL/0.9.7d
> zlib/1.2.1
>
> Host: staging.com
> Pragma: no-cache
> Accept: */*
> Content-Length: 63766
> Expect: 100-continue
> Content-Type: multipart/form-data;
> boundary=----------------------------c0927ad4
> a422
>
> < HTTP/1.1 100 Continue
> < Server: Microsoft-IIS/5.0
> < Date: Tue, 05 Oct 2004 13:17:28 GMT
> < X-Powered-By: ASP.NET
> < Set-cookie: SaneID=166.66.66.1-3407141730923; path=/; expires=Tue,
> 05-Oct-09
> 13:17:28 GMT
> < HTTP/1.1 200 OK
> < Server: Microsoft-IIS/5.0
> < Date: Tue, 05 Oct 2004 13:17:28 GMT
> < X-Powered-By: ASP.NET
> < Set-cookie: SaneID=166.66.66.1-3407141730923; path=/; expires=Tue,
> 05-Oct-09
> 13:17:28 GMT
> < Content-Length: 2845
> < Content-Type: text/html
> < Cache-control: private
>
> <html>
> <head>
> <script language='javascript'>
> function validate() {...
>
> I would be surprised if this is a bug in cURL, it does seem to be the proxy
> that is giving me the problems. I was hoping this might look familiar to
> someone. I will attempt to use Ethereal.
>
> Aaron
>
>
Received on 2004-10-05