henszey / etcd-browser

A quick and easy way to view/edit basic keys in etcd.
http://henszey.github.io/etcd-browser/
MIT License
670 stars 231 forks source link

JSON parse error #13

Open ghost opened 9 years ago

ghost commented 9 years ago

After sending HTTP GET request to my local cluster on port 4001 (http://127.0.0.1:4001/v2/keys/), parsing successful response (200 OK) fails with SyntaxError JSON.parse: unexpected end of data at line 1 column 1 of the JSON data error.

Doing the exact same operation with curl http://127.0.0.1:4001/v2/keys/ returns valid JSON format: {"action":"get","node":{"dir":true}}

etcd-browser reports an error: Request failed - - http://127.0.0.1:4001/v2/keys/

etcd-browser version: latest master etcd version: coreos/etcd@f077092bc1baf7329dba096b9ac68dc478029998

What firefox outputs: http://a.pomf.se/rhijlp.png What wireshark captures: http://a.pomf.se/drsqsz.png

nov1n commented 8 years ago

Hey ghost, I had the same problem, try adding --net="host" and setting the environment variable ETCD_HOST=127.0.0.1 leading to the following docker command:

sudo docker run --rm --name etcd-browser --net="host" -p 0.0.0.0:8000:8000 --env ETCD_HOST=127.0.0.1 --env -t -i etcd-browser