henszey / etcd-browser

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

Request failed - - http://192.168.134.129:4001/v2/keys/ #20

Open hsluoyz opened 8 years ago

hsluoyz commented 8 years ago

Hi.

I have an etcd 2.3.1 cluster with Kubernetes 1.2.4 on my Ubuntu 14.04 x64 VM.

Here's the status:

root@ubuntu:/kubernetes/cluster# etcdctl cluster-health
member ce2a822cea30bfca is healthy: got healthy result from http://192.168.134.129:4001
cluster is healthy

Then I browsed to http://henszey.github.io/etcd-browser/ in this VM's firefox, entered http://192.168.134.129:4001 and click Go!. It gave me:

Request failed - - http://192.168.134.129:4001/v2/keys/

But when I opened the http://192.168.134.129:4001/v2/keys/ address in another tab of my Firefox, it shows normally:

{"action":"get","node":{"dir":true,"nodes":[{"key":"/registry","dir":true,"modifiedIndex":3,"createdIndex":3},{"key":"/bbb","value":"test","modifiedIndex":70689,"createdIndex":70689},{"key":"/111","value":"333","modifiedIndex":35380,"createdIndex":35380},{"key":"/aaa","value":"111","modifiedIndex":50991,"createdIndex":50991},{"key":"/aab","dir":true,"modifiedIndex":35980,"createdIndex":35980},{"key":"/coreos.com","dir":true,"modifiedIndex":13,"createdIndex":13}]}}

So I wonder where it's wrong? Thanks!

wbwangk commented 8 years ago

i got same response.

xh4n3 commented 8 years ago

@hsluoyz @wbwangk Might be an issue with Access-Control-Allow-Origin See if this happens: image

There're many chrome extensions to solve this, such as ForceCORS image

I believe if you use Docker version of etcd browser, this won't happen.

jayunit100 commented 8 years ago

me to seeing something similar on my mac w/ request failed. needs more debug logs (connection refused? client error?). curl http://127.0.0.1:2379/v2/keys works for me, but the client running locally doesnt

hsluoyz commented 7 years ago

@henszey Anybody here still?

hsluoyz commented 7 years ago

etcd has released v3 for some time now, does this browser still work for etcd v3?

JohnHaan commented 7 years ago

I faced same issue even though I run through docker image.

I got below error when I see logs of the etcd-brower docker image.

root@ubuntu:~# docker logs -f etcd-browser proxy /api requests to etcd on 183.110.81.176:4001 etc-browser listening on port 8000

events.js:72 throw er; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:901:11) at Object.afterConnect [as oncomplete] (net.js:892:19)

freeart commented 7 years ago

Chrome doesn't allow to use cross-domain for localhost

lannyMa commented 6 years ago

+1

wadelee1986 commented 6 years ago

how to resolve this problem ?

qianlnk commented 6 years ago

thank you @xh4n3.

my env: docker-machine: 192.168.99.100 etcd0 192.168.99.101 etcd1 192.168.99.102 etcd2

and run etcd-browser:

docker run -d -it --name etcd-browser -p 12345:8000 --env ETCD_HOST=192.168.99.100 --env ETCD_PORT=4001 etcd-browser

I insalled ForceCORS and resolve this problem. here is my setting list:

setting for: http://192.168.99.100:4001/*

header name header value
Access-Control-Allow-Origin *
Access-Control-Allow-Methods *
harder-worker commented 2 years ago

To resolve this question (Request failed 404),you should edit server.js add to the values of ca_file、key_file、cert_file.such as var ca_file = process.env.ETCDCTL_CA_FILE || '/etc/kubernetes/pki/etcd/ca.crt'; var key_file = process.env.ETCDCTL_KEY_FILE || '/etc/kubernetes/pki/etcd/server.key'; var cert_file = process.env.ETCDCTL_CERT_FILE || '/etc/kubernetes/pki/etcd/server.crt';