Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip search pam returns xmlrpc.client.Fault: #5435

Closed
madonius opened this issue May 24, 2018 · 5 comments
Closed

pip search pam returns xmlrpc.client.Fault: #5435

madonius opened this issue May 24, 2018 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation C: search 'pip search' kind: crash For situations where pip crashes resolution: no action When the resolution is to not do anything type: support User Support

Comments

@madonius
Copy link

Environment

  • pip version: 10.0.1
  • Python version: 2.7.15, 3.6.5rc1
  • OS: Debian Testing

Description

> $ pip search pam                                                                                                            
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/search.py", line 48, in run
    pypi_hits = self.search(query, options)
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/search.py", line 65, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/usr/local/lib/python3.6/dist-packages/pip/_internal/download.py", line 792, in request
    return self.parse_response(response.raw)
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1342, in parse_response
    return u.close()
  File "/usr/lib/python3.6/xmlrpc/client.py", line 656, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32500: 'application error'>
> $ pip search abc                                                                                                            
micropython-abc (0.0.1)  - Dummy abc module for MicroPython
ABC (0.0.0)              - UNKNOWN
recursive-abc (0.1.0)    - A package to simplify the creation and manipulation of recursive data structures.
django-abc (1.0.0)       - extension to django inheritance for automatically casting base to appropriate subclass
ycytest (1.3.0)          - abc
cosmoabc (1.0.9)         - Python ABC sampler
pabc (0.1.1)             - Massively parallel ABC for Python
payce (0.1.1)            - Massively parallel ABC for Python
draco (0.1.1)            - Massively parallel ABC for Python
dramatic (0.1.1)         - Massively parallel ABC for Python
dirac (0.1.1)            - Massively parallel ABC for Python
elfi (0.7.1)             - Modular ABC inference framework for python
pyabc (0.8.19)           - Distributed, likelihood-free ABC-SMC inference
visage (0.3.0)           - Loosely coupled, ABC based, Python Interface Registry
abcplus (0.1.0)          - An amplified version of abc for Abstract Base Classes plus more
astroabc (1.4.2)         - A Python implementation of an Approximate Bayesian Computation Sequential Monte Carlo (ABC SMC)
                           sampler for parameter estimation.
abcpy (0.5.0)            - A framework for approximate Bayesian computation (ABC) that speeds up inference by parallelizing
                           computation on single computers or whole clusters.

Same behaviour can be observed with pip3

Expected behavior

To get a list of packages containing pam in their name or description.
Similar to the PyPi search

How to Reproduce

  1. Get package from the OS or the get-pip.py script
  2. Then run 'pip search pam`
  3. An error occurs.

Output

Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.
@toke
Copy link

toke commented May 24, 2018

It looks like the data returned from the xmlrpc server is malformed or it's a pypi issue.

try:
    import xmlrpclib
except ImportError:
    import xmlrpc.client as xmlrpclib
import pprint
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
client.search({'name': 'pam'})

Will also raise an exception.

And that's the debug output:
(Constucted with client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi', None, None, True))

send: b'POST /pypi HTTP/1.1\r\nHost: pypi.python.org\r\nAccept-Encoding: gzip\r\nContent-Type: text/xml\r\nUser-Agent: Python-xmlrpc/3.6\r\nContent-Length: 224\r\n\r\n'
send: b"<?xml version='1.0'?>\n<methodCall>\n<methodName>search</methodName>\n<params>\n<param>\n<value><struct>\n<member>\n<name>name</name>\n<value><string>pam</string></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n"
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Encoding header: Content-Security-Policy header: Content-Type header: ETag header: Referrer-Policy header: Server header: Content-Length header: Accept-Ranges header: Date header: Connection header: X-Served-By header: X-Cache header: X-Cache-Hits header: X-Timer header: Vary header: Strict-Transport-Security header: X-Frame-Options header: X-XSS-Protection header: X-Content-Type-Options header: X-Permitted-Cross-Domain-Policies body: b"<?xml version='1.0'?>\n<methodResponse>\n<fault>\n<value><struct>\n<member>\n<name>faultCode</name>\n<value><int>-32500</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>application error</string></value>\n</member>\n</struct></value>\n</fault>\n</methodResponse>\n"

@pradyunsg
Copy link
Member

If you think it's a PyPI issue, feel free to file an issue at pypa/warehouse. :)

@jhermann
Copy link

The pam package has an empty (null) summary (cf. http --pretty all --follow -v GET https://pypi.org/pypi/pam/json | less -R), which is uncommon and might cause this. And it is definitely server-side, the Fault response is in answer to the XMLRPC request.

In the PyPI server logs, there'll be a line with xml-rpc exception "…", showing the real (internal) exception causing the fault response (the "application" in the error is referring to the XMLRPC server implementation).

@pradyunsg pradyunsg added C: search 'pip search' type: support User Support kind: crash For situations where pip crashes resolution: no action When the resolution is to not do anything labels May 24, 2018
@pradyunsg
Copy link
Member

Thanks for looking into this @jhermann! I've filed pypi/warehouse#4074 for this.

I'll close this issue. :)

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: search 'pip search' kind: crash For situations where pip crashes resolution: no action When the resolution is to not do anything type: support User Support
Projects
None yet
Development

No branches or pull requests

4 participants