Skip to content

Using --auth when specifying --url causes authentication exception #68

@sherwin684

Description

@sherwin684

Using the --auth argument to specify the user credentials when a custom elasticsearch url is already defined using the argument --url, an AuthenticationException arises.

Expected Behaviour

Makelogs should start generating events

Actual Behaviour

Makelogs throws an AuthenticationException.

$ makelogs --url https://localhost:9200  --auth user:password
unknown ping error StatusCodeError: Authentication Exception
    at respond (/usr/local/lib/node_modules/@elastic/makelogs/node_modules/elasticsearch/src/lib/transport.js:349:15)
    at checkRespForFailure (/usr/local/lib/node_modules/@elastic/makelogs/node_modules/elasticsearch/src/lib/transport.js:306:7)
    at HttpConnector.<anonymous> (/usr/local/lib/node_modules/@elastic/makelogs/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
    at IncomingMessage.wrapper (/usr/local/lib/node_modules/@elastic/makelogs/node_modules/lodash/lodash.js:4991:19)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  status: 401,
  displayName: 'AuthenticationException',
  path: '/',
  query: {},
  body: false,
  statusCode: 401,
  response: '',
  wwwAuthenticateDirective: 'Basic realm="security" charset="UTF-8", Bearer realm="security", ApiKey',
  toString: [Function (anonymous)],
  toJSON: [Function (anonymous)]
}

Workaround

Including the user credentials directly in the --url argument works fine in this case.

$ makelogs --url https://user:password@host:port

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions