某些计算机上的XML-RPC ResponseError失败,而不是其他计算机

时间:2014-04-02 09:03:46

标签: python apache mod-wsgi xmlrpclib moinmoin

我有一个非常简单的python脚本,通过XMLRPC(v2)连接到MoinMoin wiki并提取一些数据。这一切都始于一个简单的身份验证:

self._server = xmlrpclib.ServerProxy(self.url)
self.token = self._server.getAuthToken(self.user, self.password)

相同的脚本适用于某些计算机,而其他计算机则失败。 下面是错误转储,底部是Apache日志。

它可以在这台机器上运行:

Python 2.7.3 (default, Feb 27 2014, 19:58:35) 
[GCC 4.6.3] on linux2

但它在这台机器上失败了(注意相同的python版本):

Python 2.7.3 (default, Sep 26 2013, 20:08:41) 
[GCC 4.6.3] on linux2
[...]
    self.token = self._server.getAuthToken(self.user, self.password)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 791, in close
    raise ResponseError()
xmlrpclib.ResponseError: ResponseError()

这台机器也出现故障(同样的错误,显然有不同的行号):

Python 2.6.5 (r265:79063, Sep 26 2013, 18:48:04) 
[GCC 4.4.3] on linux2
[...]
   self.token = self._server.getAuthToken(self.user, self.password)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib/python2.6/xmlrpclib.py", line 836, in close
    raise ResponseError()
xmlrpclib.ResponseError: ResponseError()

MoinMoin服务器详细信息:

Python Version
    2.7.3 (default, Feb 27 2014, 20:09:21) [GCC 4.6.3]
MoinMoin Version
    Release 1.9.7 [Revision release]

这里是apache日志(稍后捕获,因此它可能没有关联;我没有尝试过与时间的互相关):

[Wed Apr 02 00:20:15 2014] [error] 2014-04-02 00:20:15,212 INFO MoinMoin.config.multiconfig:127 using wiki config: /opt/moin/share/moin/wikiconfig.pyc
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Maximum requests reached 'moin'.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Shutdown requested 'moin'.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Stopping process 'moin'.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Destroying interpreters.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Destroy interpreter 'foo.bar.baz|'.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Cleanup interpreter ''.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Terminating Python.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=4909): Python has shutdown.
[Wed Apr 02 00:23:35 2014] [info] mod_wsgi (pid=10496): Attach interpreter ''.

有任何线索吗?我真的很惊讶。

1 个答案:

答案 0 :(得分:0)

通过查找基于IP或主机名的访问控制限制,在服务器配置文件中使用关键字搜索进行故障排除:

  • Apache:Allow fromDeny from

  • nginx:allowdeny

  • Lighttpd:$HTTP["host"]$HTTP["remoteip"]

<强>参考