cloudhead / http-console

simple, intuitive HTTP REPL — Speak HTTP like a local.
Apache License 2.0
1.35k stars 65 forks source link

Error with connection; "Stream already opened" #20

Closed arunjitsingh closed 13 years ago

arunjitsingh commented 13 years ago

Just started with it (npm installer), but got this error (also with source version from github):

[ arunjitsingh ] ~ ◊:  54$ http-console 127.0.0.1:5984
> http-console 0.5.1
> Welcome, enter \help if you're lost.
> Connecting to 127.0.0.1 on port 5984.

http://127.0.0.1:5984/> GET /
Error: Stream already opened
    at Client.connect (net.js:630:22)
    at Client._ensureConnection (http.js:1040:10)
    at Client.request (http.js:1055:8)
    at [object Object].request (/Users/arunjitsingh/.node_libraries/.npm/http-console/0.5.1/package/lib/http-console.js:110:31)
    at [object Object].exec (/Users/arunjitsingh/.node_libraries/.npm/http-console/0.5.1/package/lib/http-console.js:191:22)
    at Interface. (/Users/arunjitsingh/.node_libraries/.npm/http-console/0.5.1/package/lib/http-console.js:60:18)
    at Interface.emit (events.js:31:17)
    at Interface._onLine (readline.js:123:10)
    at Interface._ttyWrite (readline.js:335:12)
    at Interface.write (readline.js:173:30)
http://127.0.0.1:5984/> Error: assertion error
    at node.js:35:19
    at IOWatcher.onWritable [as callback] (net.js:164:18)
http://127.0.0.1:5984/> Error: assertion error

That last repeats in an endless loop..

(Using the bleeding-edge version of node: v0.3.4-pre)

Same thing happens with PUT, POST and DELETE requests

cURL'ing works:

[ arunjitsingh ] ~ ◊:  58$ curl http://127.0.0.1:5984
{"couchdb":"Welcome","version":"1.0.1"}

Thoughts/ideas?

allait commented 13 years ago

I get the same error on every request, no matter what I do. Mac OS X 10.6.4, node 0.2.6 installed with homebrew, npm 0.2.14-6, http-console 5.1.

UPDATE: newest node(0.3.5-pre) doesn't solve the issue. http-console@0.2.5, however, works on both 0.2.6 and 0.3.5 and seems to be the last version that does.

paulredmond commented 13 years ago

I am getting this issue too with node version 0.2.6 and http-console version 0.5.1

Installed node and npm with brew.

resistorsoftware commented 13 years ago

I have an Ubuntu Lucid machine tricked out with node 0.2.6 and http-console 0.5.1 and I get the same issue. curl shows my website responds fine, but trying http-console requests blow out with the Stream already opened??? Have not run into this on my other machines... some kind of evil confluence of two releases not meshing nicely?

allait commented 13 years ago

This stopped happening for me after an update to node 0.4 and http-console 0.6. Everything seems to work fine right now.

resistorsoftware commented 13 years ago

@allait I am curious. All I see is node 2.6 stable. There is an "unstable" branch at 0.3.8 but nothing indicates a 0.4 as you suggest. Can you let me know what node you are running and from where?

Thanks

allait commented 13 years ago

https://github.com/ry/node HEAD is 0.4 right now. I suppose it's nearly the same as 0.3.8, it's just that I'm using homebrew and it means only two options to install node.js: stable 0.2.6 or repository HEAD.

arunjitsingh commented 13 years ago

@allait updating to node-v0.4.0-pre and http-console v0.6 works. It's fun to use. So far GET, PUT, POST and DELETE work against CouchDB

resistorsoftware commented 13 years ago

Hi all,

I just installed node 0.4 HEAD to ~/local and then npm install http-console and sure enough, it all worked fine. Thanks for the update.