473,411 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Need help

I am working with a 3rd party credit card company that is using Python
version 2.2.2. They are using the httplib module to post data to my
server which is a dedicated server with no firewall or any
rate-limiting or DDoS prevention.

Every time they try, the first 2 posts are successful and it always
throws this error on the third attempt. It is reproducable every time
they run the program.

Jul 18 '05 #1
11 1609
( http://www.catb.org/~esr/faqs/smart-...tml#bespecific )

"brian" <br********@hotmail.com> wrote:
I am working with a 3rd party credit card company that is using Python
version 2.2.2. They are using the httplib module to post data to my
server which is a dedicated server with no firewall or any
rate-limiting or DDoS prevention.

Every time they try, the first 2 posts are successful and it always
throws this error on the third attempt.


what error? if you/they get a traceback, please post the traceback. if
"throw an error" means something else, please explain.

</F>

Jul 18 '05 #2
They tell me the error is Recv Timed Out.

Jul 18 '05 #3
brian wrote:
They tell me the error is Recv Timed Out.


It would probably go much faster if "they" were the
ones asking the questions and describing their
situation.

Otherwise it sounds like a case of the blind leading the blind.
You don't know the specifics of their situation, and
troubleshooting is hard enough without trying to do it
through a middleman...

(However, it can be done... it's just damn hard. If
you/they for some reason don't want to hire somebody
to investigate and resolve the problem, I guess you'll
need patience and imagination. Here's a first step:
how far apart are these requests? If they're very
close together, what happens if they insert, say, a
few seconds delay between each one?)

-Peter
Jul 18 '05 #4
Am Dienstag, 1. März 2005 21:53 schrieb brian:
They tell me the error is Recv Timed Out.


This sounds like a socket level (TCP/IP stack) error, which might be causedby
a malfunctioning gateway or network device (likely), an error in the
operating system or network device driver they use (unlikely), or a
combination of several malfunctions.

But, this certainly isn't an error that's Python related (IMHO), so you better
tell them to check their hardware...

--
--- Heiko.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBCJNkvf0bpgh6uVAMRAvBwAJ9cHXfAtaJUY+eIuJgAGg YOowvT+wCfSmW5
/hPhZQpCNeA9VEW4DV04fB0=
=a8EP
-----END PGP SIGNATURE-----

Jul 18 '05 #5
I totally agree....but that being said...I want to make sure its not
something on my server causing the problem. Im on a windows 2003
server.

Let me also throw this into the mix....before we went down the HTTP
post route we first tried to post data directly into MSSQL, but we were
getting connection errors. Im inquiring with "them" if they also used
Python to do this, Im assuming the answer is yes.

Jul 18 '05 #6
brian wrote:
I totally agree....but that being said...I want to make sure its not
something on my server causing the problem. Im on a windows 2003
server.
Python runs fine on a Windows 2003 server. Maybe they can
package up a stripped version of the code that still reproduces
the problem and you can just run it locally.

Alternatively, find a utility that can send "canned" HTTP
requests and use it to duplicate the effect of what they're
doing.

The key to troubleshooting any problem of this sort (complex,
networks, etc) is to partition. Come up with tests which
prove that the problem is on one side or the other, often
by eliminating the other side as a potential cause. You
can run stuff on your server, proving that it's not the
cause. You can do things like insert delays as I suggested
before (which will often make the problem go away, generally
leading quickly to a proof of exactly which component the
problem is in).

Also, you haven't mentioned that you've checked the logs
on your server and seen any evidence that the third request
was received. Nor that you've attempted to monitor the traffic
on the network using a utility that can show you exactly
what traffic went which way and when.
Let me also throw this into the mix....before we went down the HTTP
post route we first tried to post data directly into MSSQL, but we were
getting connection errors. Im inquiring with "them" if they also used
Python to do this, Im assuming the answer is yes.


There are so many things likely to be different in that situation
that I'm not sure you'll learn anything, unless exactly the
same error was produced, and probably not even then.

Keep in mind that there are people who do this sort of
troubleshooting work for money. Often they're well worth
it because they'll save you far more time and aggravation
than it will cost you to hire them...

-and-some-like-to-give-it-away-too-ly y'rs,
Peter
Jul 18 '05 #7
When you say tools, can you give me one in particular that I can
install on my server to do what you were mentioning?

Jul 18 '05 #8
brian wrote:
When you say tools, can you give me one in particular that I can
install on my server to do what you were mentioning?

Good grief, man, are we to believe you are charging people money for
running this web server? Do you even know where IIS keeps its logs?

I take it you know what code on your server they are posting to? Have
you tried doing three manual posts in quick succession? From a local
browser? From a remote browser? Is anyone else using the same code
successfully? etc., etc., ...

In terms of capturing network traffic, take a look at www.ethereal.com -
it's a very good tool for capturing netwokr traffic, and will definitely
show you what's getting through to your server and what isn't. Open
source, multi-platform, just the ticket for problems like this.

regards
Steve
--
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005 http://www.pycon.org/
Steve Holden http://www.holdenweb.com/
Jul 18 '05 #9
Got code from the 3rd party, maybe someone can see something wrong with
it:

def sendDataHTTP( url, postData ):
# url format: http://www.blah.com/notrealurl

# postData is either a dictionary or list of dictionaries
# that contain the data that you want to post.

responseList = []
urlList = urlparse.urlparse( url )
host = urlList[1]
scriptPath = urlList[2]
if not type( postData ) == list: postData = [ postData ]
headers = { "Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain" }
conn = httplib.HTTPConnection( host )

for thisDict in postData:
params = urllib.urlencode( thisDict )
conn.request("POST", scriptPath, params, headers )
response = conn.getresponse()
responseList.append( (response.status,response.reason) )
conn.close()
return responseList

Jul 18 '05 #10
I doubt it's a hardware issue... If these people have any knowledge of
computers, they would try connecting to other places to see if it gives
them the same error. It sounds obvious, but have them ping your DNS
alias as well as your IP address.

If they can't get anywhere else, then it's a local hardware issue to
them. If they can, run a traceroute program from them to you (or
vica-verca if you can) to see where the connection is halting. It may
be a hardware issue local to you. Do you have other clients with the
same problem? Can you ping them from your server? These are all
questions you should be using to troubleshoot.

If you can ping to/from client/server then this certainly isn't a
network hardware issue. And if it was connecting, but blocking a
specific port then your ICMP response would say that rather than "timed
out." My suggestion to you is get an answer to these questions and
post back here. You should have done this before ever even thinking
about looking at the source code. If you did, you should have posted
the results.

It sounds to me like they just don't have the correct hostname (or
their DNS service is down). Again, this could be seen from answering
the above questions.

G/L

Jay

Jul 18 '05 #11
ga********@gmail.com wrote:
It sounds to me like they just don't have the correct hostname (or
their DNS service is down). Again, this could be seen from answering
the above questions.


Hmm.... what can be seen from reading Brian's message is that
it clearly cannot be a simple matter of incorrect hostname,
or an inability to connect at all. He said they can connect
twice before they get the error.

And unfortunately there are many places where ICMP packets,
including "echo" and "echo response", have been disabled for
security reasons. The inability to ping does not necessarily
mean anything about the ability to establish TCP sessions.

In the end, however, it does seem unlikely that this has
much to do with Python...

-Peter
Jul 18 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
5
by: John Flynn | last post by:
hi all i'm going to be quick i have an assignment due which i have no idea how to do. i work full time so i dont have the time to learn it and its due date has crept up on me .. As follows:...
0
by: xunling | last post by:
i have a question about answering ..... this topic is "need help" what do i have to write at te topic line, !after i have klicked the "answer message" button ive tried many possibilities,...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.