node-elasticsearch-tutorial icon indicating copy to clipboard operation
node-elasticsearch-tutorial copied to clipboard

Error: AuthenticationException

Open sandymantri opened this issue 7 years ago • 1 comments

I have cloned this code on my local. Only instead of pointing to local elastic search, pointing to elasticsearch cloud. And trying to search all using following command:

$ node search_all.js

Getting Error:

retrieving all documents (displaying 20 at a time)... { Error: [security_exception] action [indices:data/read/search] requires authentication, with { header={ WWW-Authenticate="Basic realm="security" charset="UTF-8"" } } at respond (/home/hp/prita/node-elasticsearch/node_modules/elasticsearch/src/lib/transport.js:308:15) at checkRespForFailure (/home/hp/prita/node-elasticsearch/node_modules/elasticsearch/src/lib/transport.js:267:7) at HttpConnector. (/home/hp/prita/node-elasticsearch/node_modules/elasticsearch/src/lib/connectors/http.js:165:7) at IncomingMessage.wrapper (/home/hp/prita/node-elasticsearch/node_modules/lodash/lodash.js:4949:19) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) status: 401, displayName: 'AuthenticationException', message: '[security_exception] action [indices:data/read/search] requires authentication, with { header={ WWW-Authenticate="Basic realm=\"security\" charset=\"UTF-8\"" } }', path: '/library/_search', query: {}, body: { error: { root_cause: [Object], type: 'security_exception', reason: 'action [indices:data/read/search] requires authentication', header: [Object] }, status: 401 }, statusCode: 401, response: '{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:data/read/search] requires authentication","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"action [indices:data/read/search] requires authentication","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}', wwwAuthenticateDirective: 'Basic realm="security" charset="UTF-8"', toString: [Function], toJSON: [Function] }

sandymantri avatar Jul 05 '18 13:07 sandymantri

Hi, have you solved this problem? I have the same :(

falent avatar Jan 27 '19 19:01 falent