cars10/elasticvue

[BUG] - Cannot connect to localhost opensearch no auth

Closed this issue · 4 comments

Description
Cannot connect to localhost docker-running opensearch (is it a problem it's opensearch and not elasticsearch?). With chrome and postman everything works with GET and POST requests though.

Steps To Reproduce
List the steps to reproduce your problem:
0. Run opensearch via docker-compose.

  1. Open elasticvue
  2. Click on Add elasticsearch cluster, enter: default cluster, http://localhost:9200
  3. Get following:
    403 Forbidden Can't connect to your cluster. Please make sure that Your cluster is reachable via http://localhost:9200/

Screenshots
image
image
image
image

Environment (please include the following information):

  • Elasticsearch version:
  • Operating system: Windows
  • Browser + version: Chrome 122.0.6261.131 (Official Build) (64-bit)
  • Elasticvue version: Elasticvue 1.0.4-stable
  • How are you running elasticvue?: browser extension

Additional context
Docker-compose file:

  elasticsearch:
      image: opensearchproject/opensearch:1.3.10
      ports:
        - "127.0.0.1:9200:9200"
        - "127.0.0.1:9300:9300"
      environment:
        network.host: 0.0.0.0
        discovery.type: single-node
        bootstrap.memory_lock: 'true'
        http.cors.enabled: 'true'
        http.cors.allow-origin: http://localhost:1358,http://127.0.0.1:1358  # to be able to use dejavu web browser
        http.cors.allow-headers: X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
        http.cors.allow-credentials: 'true'
        plugins.security.disabled: 'true'  # required for opensearch to turn off https
        ES_JAVA_OPTS: '-Xms512m -Xmx512m'
      ulimits:
        memlock:
          soft: -1
          hard: -1

Postman has no auth.

If there is some stupid mistake on my side, sorry in advance.

Try adding the extension url to the http.cors.allow-origin setting. You don't normally have to configure CORS when using the browser extensions, but when you DO set it anyway, you have to set it correctly. Elasticvue tells you exactly what you need to do while you try to connect, but basically just add the extension url (yes, the chrome-extension//werid-string) to your allow-origin, then it should work.

@cars10 thank you so much for helping even though it wasn't your problem!
Appreciate a lot. Removing cors for local testing helped!

Alright, glad that you could solve the problem :) You can also use elasticvue desktop to completely ignore CORS & SSL related issues.

Thanks so much again :3
Downloaded the desktop version too, seems really nice!