-
Notifications
You must be signed in to change notification settings - Fork 123
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
Chrome extension doesn't work against local unauthenticated instance #18
Comments
Looking in the Chrome console I see that:
|
Hey @tjrobinson It looks like CORS error, your allow origin should be like this http.cors.allow-origin: "*" Steps:
http.cors.allow-origin: "*"
http.cors.enabled: true
http.cors.allow-headers : "X-Requested-With, X-Auth-Token, Content-Type, Content-Length, Authorization"
http.cors.allow-methods: "OPTIONS, HEAD, GET, POST, PUT, DELETE"
http.cors.allow-credentials: true
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://localhost:9200/_search', true);
xhr.withCredentials = true;
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Authorization', 'Basic ' + btoa('test:test'));
xhr.send('{"query":{"match_all":{}}}'); If it's response status is 200 then try with mirage, mirage should work after that. If you are facing any error in request post the error log over here or checkout CORS issue for elasticsearch |
I just confirmed, mirage chrome extension is working fine with local connection. Es config should be: http.cors.enabled: true
http.cors.allow-origin: "/.*/"
http.cors.allow-credentials: true
http.cors.allow-headers: "Authorization, X-Requested-With, Content-Type, Content-Length" and still if you see the issue, please provide detail of es version. |
This is little bit confusing, I cannot see any error message in console log. Still you are getting error on UI this is strange. Can you just try disconnecting and connecting? and can you also try on gh-pages? appbaseio.github.io/mirage |
I've sorted it. I was connecting to the index via the alias not the actual index name. It works if I use the index name. Not sure if that's a bug or just me doing it wrong? GET /_cat/aliases?v
|
I see the same issue (and solution) with the gh-pages version and the plugin too. |
@tjrobinson yes, so mirage is not creating anything for you. it is just an query explorer. you can create indexes and view data using dejavu. |
The index and the alias exist already. I was expecting to be able to use either the alias or the index name when querying. |
Okay, I will check it out if we can support alias also for connection. |
Great, thanks. Nice tools by the way, good work. |
Anyone else stuck on this, I had to add the options to the elastic config, restart, and then use |
I've installed the latest Chrome extension from the Chrome store.
When I connect to
http://127.0.0.1:9200
orhttp://localhost:9200
it fails with:I've added this to my elasticsearch.yml file and restarted before doing the above:
The text was updated successfully, but these errors were encountered: