2

我有一个非常简单的 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 ''.

有什么线索吗?我真的大吃一惊。

4

1 回答 1

0

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

  • 阿帕奇:Allow fromDeny from

  • nginx:allowdeny

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

参考

于 2016-11-18T18:08:32.810 回答