http-prompt icon indicating copy to clipboard operation
http-prompt copied to clipboard

Remote end closed connection without response

Open afm-sayem opened this issue 9 years ago • 1 comments

http-prompt stopped working for a particular webapp after some refactoring. I can curl or use http(httpie) to get data from the same endpoint, but http-prompt fails with:

Version: 0.4.2
http://localhost:3000> cd api/movies
http://localhost:3000/api/movies> get
HTTPie 0.9.4
Requests 2.10.0
Pygments 2.1.3
Python 3.5.1+ (default, Mar 30 2016, 22:46:26) 
[GCC 5.3.1 20160330]
/home/kishan/.virtualenvs/elasticsearch/bin/python3
Linux 4.4.0-31-generic

<Environment {
    "colors": 256,
    "config": {
        "__meta__": {
            "about": "HTTPie configuration file",
            "help": "https://github.com/jkbrzt/httpie#config",
            "httpie": "0.9.4"
        },
        "default_options": "[]"
    },
    "config_dir": "/home/kishan/.httpie",
    "is_windows": false,
    "stderr": "<_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>",
    "stderr_isatty": true,
    "stdin": "<_io.TextIOWrapper name='<stdin>' mode='r' encoding='UTF-8'>",
    "stdin_encoding": "UTF-8",
    "stdin_isatty": true,
    "stdout": "<_io.BytesIO object at 0x7f15209f3fc0>",
    "stdout_encoding": "utf8",
    "stdout_isatty": true
}>

>>> requests.request(**{
    "allow_redirects": false,
    "auth": "None",
    "cert": "None",
    "data": "{\"type\": \"1\"}",
    "files": {},
    "headers": {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "User-Agent": "HTTPie/0.9.4",
        "where[name": "search]==Aparajito"
    },
    "method": "get",
    "params": {},
    "proxies": {},
    "stream": true,
    "timeout": 30,
    "url": "http://localhost:3000/api/movies",
    "verify": true
})


http: error: ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)) while doing GET request to URL: http://localhost:3000/api/movies
ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

Parse tree:
<Node called "immutation" matching "get">  <-- *** We were here. ***
    <Node called "action" matching "get">
        <RegexNode called "_" matching "">
        <Node called "method" matching "get">
            <RegexNode matching "get">
        <RegexNode called "_" matching "">
        <Node matching "">
        <Node matching "">

This is only happening for a particular node web server. For my other applications, it's working as expected. The reason I'm confused why this is happening is because using httpie with http :3000/api/movies returns the results without any error.

Also notice there's a phantom request body containing {type: 1} which was not sent but yet somehow appeared to the request.

afm-sayem avatar Jul 19 '16 10:07 afm-sayem

Thank you for reporting the bug. Can you provide the sample source code of the node server that can reproduce the bug?

{type: 1} probably comes from the previous session that was saved on your disk. See "Persistent Context" section in README.

eliangcs avatar Jul 19 '16 12:07 eliangcs