Skip to content
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

Cannot Start Opensearch Dashboard #1954

Closed
anh2001ht opened this issue May 10, 2024 · 7 comments
Closed

Cannot Start Opensearch Dashboard #1954

anh2001ht opened this issue May 10, 2024 · 7 comments
Labels
bug Something isn't working untriaged

Comments

@anh2001ht
Copy link

anh2001ht commented May 10, 2024

Hello, I am using docker compose to run Opensearch, and use source code Opensearch-Dashboard then yarn start to run dashboard (to use plugin i18n). I have a problem that I can not access to dashboard Url (port 5601) because of this error :

image
Here is my docker-compose.yaml

version: '3'
services:
opensearch:
image: opensearchproject/opensearch:2.12.0
container_name: opensearch
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- compatibility.override_main_response_version=true
- "OPENSEARCH_SECURITY_ENABLED=true"
- "OPENSEARCH_SECURITY_AUDIT_ENABLED=true"
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=mypasswordStrong123!"
# - "DISABLE_INSTALL_DEMO_CONFIG=true"
# - "DISABLE_SECURITY_PLUGIN=true"
volumes:
- ./data:/usr/share/opensearch/data
- ./config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml
- ./certs/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
- ./certs/node1.pem:/usr/share/opensearch/config/node1.pem
- ./certs/node1-key.pem:/usr/share/opensearch/config/node1-key.pem
ports:
- 9200:9200
- 9600:9600
networks:
- opensearch-net
networks:
opensearch-net:
driver: bridge

file config opensearch.yml:
`
network.host: 0.0.0.0
plugins.security.ssl.transport.pemcert_filepath: node1.pem
plugins.security.ssl.transport.pemkey_filepath: node1-key.pem
plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
plugins.security.ssl.transport.enforce_hostname_verification: true
plugins.security.ssl.http.enabled: false
plugins.security.ssl.http.pemcert_filepath: node1.pem
plugins.security.ssl.http.pemkey_filepath: node1-key.pem
plugins.security.ssl.http.pemtrustedcas_filepath: root-ca.pem
plugins.security.allow_unsafe_democertificates: false
plugins.security.allow_default_init_securityindex: true
plugins.security.nodes_dn:
'CN=node1.dns.a-record,OU=UNIT,O=ORG,L=TORONTO,ST=ONTARIO,C=CA'

file config opensearch_dashboards.yml

server.host: "0.0.0.0"
opensearch.username: "admin"
opensearch.password: "admin"
opensearch.hosts: ["http://localhost:9200/"]
i18n.locale: "ja-JP"

Can someone help me please, I can run dashboard and opensearch with docker compose sucessfully but I run dashboard with yarn start and docker compose opensearch I can not work. this is the file docker compose that both opensearch and opensearch dashboard work :

version: '3'
services:
opensearch:
image: opensearchproject/opensearch:2.12.0
container_name: opensearch
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- compatibility.override_main_response_version=true
- "OPENSEARCH_SECURITY_ENABLED=true"
- "OPENSEARCH_SECURITY_AUDIT_ENABLED=true"
# - "DISABLE_SECURITY_PLUGIN=true"
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=mypasswordStrong123!"
volumes:
- ./data:/usr/share/opensearch/data
- ./config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml
- ./certs/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
- ./certs/node1.pem:/usr/share/opensearch/config/node1.pem
- ./certs/node1-key.pem:/usr/share/opensearch/config/node1-key.pem
- ./certs/admin.pem:/usr/share/opensearch/config/admin.pem
- ./certs/admin-key.pem:/usr/share/opensearch/config/admin-key.pem
- ./logs/log.log:/usr/share/opensearch/logs/opensearch.log
ports:
- 9200:9200
networks:
- opensearch-net
kibana:
image: opensearchproject/opensearch-dashboards:2.12.0
container_name: kibana
ports:
- 5601:5601
- 5603:5603
stdin_open: true
tty: true
expose:
- "5601"
- "5603"
environment:
- 'OPENSEARCH_HOSTS=["http://localhost:9200/"]'
- 'SERVER_HOST="0.0.0.0"'
- "OPENSEARCH_USERNAME=admin"
- "OPENSEARCH_PASSWORD=admin"
networks:
- opensearch-net
networks:
opensearch-net:
driver: bridge

@anh2001ht anh2001ht added bug Something isn't working untriaged labels May 10, 2024
@anh2001ht anh2001ht changed the title [BUG] Cannot Start Opensearch Dashboard Cannot Start Opensearch Dashboard May 10, 2024
@Hailong-am
Copy link
Contributor

@anh2001ht "OPENSEARCH_PASSWORD=admin" this password need to be same as - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=mypasswordStrong123!"

@anh2001ht
Copy link
Author

@anh2001ht "OPENSEARCH_PASSWORD=admin" this password need to be same as - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=mypasswordStrong123!"

Thanks for reply, when I change OPENSEARCH_PASSWORD into mypasswordStrong123! I got this error
server log [07:53:33.272] [error][data][opensearch] [ResponseError]: Response Error server log [07:53:33.287] [error][savedobjects-service] Unable to retrieve version information from OpenSearch nodes. log [07:53:34.098] [error][data][opensearch] [ResponseError]: Response Error server log [07:53:35.760] [error][data][opensearch] [ResponseError]: Response Error log [07:53:36.615] [error][data][opensearch] [ResponseError]: Response Error server log [07:53:38.252] [error][data][opensearch] [ResponseError]: Response Error

@anh2001ht
Copy link
Author

image
This is the screenshot when I curl to opensearch node: curl --insecure -u "admin:admin" -XGET https://localhost:9200/

@Hailong-am
Copy link
Contributor

Hailong-am commented May 13, 2024

image This is the screenshot when I curl to opensearch node: curl --insecure -u "admin:admin" -XGET https://localhost:9200/

I see, do you have security dashboard plugin under plugins directory? it's used for login since OpenSearch has security enabled.

alternatively, you could disable security of OpenSearch and using default config of opensearch_dashboard.yml file.

@anh2001ht
Copy link
Author

anh2001ht commented May 13, 2024

image This is the screenshot when I curl to opensearch node: curl --insecure -u "admin:admin" -XGET https://localhost:9200/

I see, do you have security dashboard plugin under plugins directory? it's used for login since OpenSearch has security enabled.

yes, I have install dashboard plugin already , this is the file opensearch_dashboard.yml after I build security plugin
`server.host: "0.0.0.0"

opensearch.hosts: ["https://localhost:9200"]

opensearch.ssl.verificationMode: none

opensearch.username: "admin"

opensearch.password: "admin"

i18n.locale: "ja-JP"

opensearch.requestHeadersWhitelist: [ authorization,securitytenant ]

opensearch_security.multitenancy.enabled: true

opensearch_security.multitenancy.tenants.preferred: ["Private", "Global"]

opensearch_security.readonly_mode.roles: ["kibana_read_only"]

opensearch_security.cookie.secure: false
`

@anh2001ht
Copy link
Author

anh2001ht commented May 13, 2024

`StatusCodeError: Authorization Exception

at respond (/home/ntq/DemoPlugin/OpenSearch-Dashboards/node_modules/elasticsearch/src/lib/transport.js:349:15)

at checkRespForFailure (/home/ntq/DemoPlugin/OpenSearch-

Dashboards/node_modules/elasticsearch/src/lib/transport.js:306:7)

at HttpConnector. (/home/ntq/DemoPlugin/OpenSearch-

Dashboards/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)

at IncomingMessage.wrapper (/home/ntq/DemoPlugin/OpenSearch-Dashboards/node_modules/lodash/lodash.js:4991:19)

at IncomingMessage.emit (events.js:412:35)

at IncomingMessage.emit (domain.js:475:12)

at endReadableNT (internal/streams/readable.js:1333:12)

at processTicksAndRejections (internal/process/task_queues.js:82:21) {

status: 403,

displayName: ‘AuthorizationException’,

path: ‘/_plugins/_security/tenantinfo’,

query: {},

body: undefined,

statusCode: 403,

response: ‘’,

toString: [Function (anonymous)],

toJSON: [Function (anonymous)]

}`

I got the new error 403 after I apply security plugin

@kavilla
Copy link
Member

kavilla commented May 14, 2024

@opensearch-project/admin can you re-route this to security dashboards plugin repo?

@kavilla kavilla removed the untriaged label May 14, 2024
@gaiksaya gaiksaya transferred this issue from opensearch-project/OpenSearch-Dashboards May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

3 participants