Skip to content

security_exception #2683

Open
Open
@Saliheen

Description

@Saliheen

Why i am getting this

security_exception
        Root causes:
                security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
    at SniffingTransport._request (D:\learning\firebaseexpressstarter\node_modules\@elastic\transport\lib\Transport.js:543:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\learning\firebaseexpressstarter\node_modules\@elastic\transport\lib\Transport.js:641:32
    at async SniffingTransport.request (D:\learning\firebaseexpressstarter\node_modules\@elastic\transport\lib\Transport.js:637:20)
    at async Client.BulkApi [as bulk] (D:\learning\firebaseexpressstarter\node_modules\@elastic\elasticsearch\lib\api\api\bulk.js:58:12)
    at async indexDataElasticSearch (file:///D:/learning/firebaseexpressstarter/utils/indexDataElasticSearch.js:78:26) {
  options: { redaction: { type: 'replace', additionalKeys: [] } },
  meta: {
    body: { error: [Object], status: 401 },
    statusCode: 401,
    headers: {
      'content-length': '777',
      'content-type': 'application/vnd.elasticsearch+json;compatible-with=8',
      'www-authenticate': [Array],
      'x-cloud-request-id': 'IYeewPlHS0SBCvkXMNmfog',
      'x-found-handling-cluster': 'a604f1cd4006442fbd81403d6b5376a8.es',
      'x-found-handling-instance': 'es-es-index-79bc4f6b8-svnq4',
      date: 'Wed, 26 Mar 2025 23:59:06 GMT',
      connection: 'close'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    },
    warnings: null
  }
}
[nodemon] restarting due to changes...
[nodemon] starting `node server.js index.js`
Server is running on http://localhost:9000
QUEUE ADDED
Getting data from Listings
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 500, collectionName: 'Listings' }
{ count: 19, collectionName: 'Listings' }
{ count: 0, collectionName: 'Listings' }
indexDataElasticSearch===> ResponseError: security_exception
        Root causes:
                security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
    at SniffingTransport._request (D:\learning\firebaseexpressstarter\node_modules\@elastic\transport\lib\Transport.js:543:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async D:\learning\firebaseexpressstarter\node_modules\@elastic\transport\lib\Transport.js:641:32
    at async SniffingTransport.request (D:\learning\firebaseexpressstarter\node_modules\@elastic\transport\lib\Transport.js:637:20)
    at async Client.BulkApi [as bulk] (D:\learning\firebaseexpressstarter\node_modules\@elastic\elasticsearch\lib\api\api\bulk.js:58:12)
    at async indexDataElasticSearch (file:///D:/learning/firebaseexpressstarter/utils/indexDataElasticSearch.js:78:26) {
  options: { redaction: { type: 'replace', additionalKeys: [] } },
  meta: {
    body: { error: [Object], status: 401 },
    statusCode: 401,
    headers: {
      'content-length': '777',
      'content-type': 'application/vnd.elasticsearch+json;compatible-with=8',
      'www-authenticate': [Array],
      'x-cloud-request-id': 'DsKa5fxfS7qDNwxL0xWYKw',
      'x-found-handling-cluster': 'eb8839ad0cf940978154624b3cb66359',
      'x-found-handling-instance': 'instance-0000000001',
      date: 'Thu, 27 Mar 2025 00:04:53 GMT',
      connection: 'close'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    },
    warnings: null
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions