opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.63k stars 849 forks source link

[BUG] Error connecting to datasources using Sigv4 auth #7264

Open derek-ho opened 1 month ago

derek-ho commented 1 month ago

Describe the bug

When connecting to datasources using sigv4 auth method, there is an error thrown:

Could not load credentials from any providers

A workaround would be to stop OSD, export the credentials and restart OSD, then it works, but this is a bad experience. To Reproduce Error trace:

Error: connect EHOSTDOWN 169.254.169.254:80 - Local (192.168.4.121:59531)
    at internalConnect (node:net:1100:16)
    at defaultTriggerAsyncIdScope (node:internal/async_hooks:462:18)
    at node:net:1306:9
    at processTicksAndRejections (node:internal/process/task_queues:77:11) {
  message: 'Could not load credentials from any providers',
  errno: -64,
  code: 'CredentialsError',
  syscall: 'connect',
  address: '169.254.169.254',
  port: 80,
  time: 2024-07-16T04:00:08.798Z,
  originalError: {
    message: 'EC2 Metadata roleName request returned error',
    errno: -64,
    code: 'EHOSTDOWN',
    syscall: 'connect',
    address: '169.254.169.254',
    port: 80,
    time: 2024-07-16T04:00:08.797Z,
    originalError: {
      errno: -64,
      code: 'EHOSTDOWN',
      syscall: 'connect',
      address: '169.254.169.254',
      port: 80,
      message: 'connect EHOSTDOWN 169.254.169.254:80 - Local (192.168.4.121:59531)'
    }
  }
}

Expected behavior I can connect using sigv4 without stopping OSD and exporting credentials OpenSearch Version Please list the version of OpenSearch being used.

Dashboards Version Please list the version of OpenSearch Dashboards being used.

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

Additional context

Add any other context about the problem here.

derek-ho commented 1 month ago

Verified the same issue is present with connecting to an AOS domain

dblock commented 3 weeks ago

[Catch All Triage - 1, 2, 3]