错误:[Errno 32]当paypal调用python django应用程序时,管道损坏 [英] error: [Errno 32] Broken pipe when paypal calls back to python django app

查看:157
本文介绍了错误:[Errno 32]当paypal调用python django应用程序时,管道损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用svn和python 2.6中的最新版本的django。



但是,我发现每次当paypal的沙箱访问我的通知网址我有500 [Errno 32] Broken pipe我的django栈。



有没有人有这样的经验吗?



干杯,

 追溯最近的电话最后):
文件/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py,行281,运行
self.finish_response()
文件/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py,第321行,在finish_response
self.write(data)
文件 /usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py,第417行,写入
self._write(data)
文件/ usr / lib / python2.6 / socket.py,第318行,写入
self.flush()
文件/usr/lib/python2.6/socket.py,第297行,处于flush
self._sock.sendall(bu ffer(data,write_offset,buffer_size))
错误:[Errno 104]连接由对等体
重置----------------------- -----------------
在处理来自('216.113.191.33',21736)的请求期间发生异常
追溯(最近的最后一次呼叫):
文件/usr/lib/python2.6/SocketServer.py,第283行,_handle_request_noblock
self.process_request(request,client_address)
文件/usr/lib/python2.6 /SocketServer.py,第309行,在process_request
self.finish_request(request,client_address)
文件/usr/lib/python2.6/SocketServer.py,第322行,在finish_request
self.RequestHandlerClass(request,client_address,self)
文件/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py,第562行,__init__
BaseHTTPRequestHandler .__ init __(self,* args,** kwargs)
文件/usr/lib/python2.6/SocketServer.py,第618行,__init__
self.finish()
文件/usr/lib/python2.6/SocketServer.py,第661行,完成
self.wfile.flush()
文件/usr/lib/python2.6/socket.py,第297行,flush
self._sock.sendall(buffer( data,write_offset,buffer_size))
错误:[Errno 32] Broken pipe
--------------------------- -------------


解决方案

p>有两个问题。首先,一些PayPal API(特别是MassPay)非常差。



第二个更可能的问题是,您的服务器是单线程的,并且具有麻烦正确地提出了贝宝的例外。通过创建一个表单(通过POST)的html文件,可以嘲笑一个PayPal IPN,然后查看调试结果(或者更好的是使用PyDev中的调试器)来解决类似的问题。当然可以用卷曲做同样的事情。


Hi I am doing papal integration with my django app.

i am using latest version of django from svn and python 2.6.

However, i found every time when paypal's sandbox accessing my notify url i got 500 [Errno 32] Broken pipe my django stack.

Does anyone have similar experience with this ?

Cheers,

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 281, in run
    self.finish_response()
  File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 321, in finish_response
    self.write(data)
  File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 417, in write
    self._write(data)
  File "/usr/lib/python2.6/socket.py", line 318, in write
    self.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 104] Connection reset by peer
----------------------------------------
Exception happened during processing of request from ('216.113.191.33', 21736)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 283, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 309, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 562, in __init__
    BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.6/SocketServer.py", line 618, in __init__
    self.finish()
  File "/usr/lib/python2.6/SocketServer.py", line 661, in finish
    self.wfile.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe
----------------------------------------

解决方案

There are two problems. First, some of the paypal APIs (particularly MassPay) are terribly poor.

The second, and more likely, problem, is that your server is single-threaded and is having trouble properly raising an exception to paypal. I was able to resolve a similar problem by creating an html file with a form (via POST) that mocked a paypal IPN and then looking at the debug result (or better, using a debugger like the one in PyDev). You could do the same thing with curl of course.

这篇关于错误:[Errno 32]当paypal调用python django应用程序时,管道损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆