-
Notifications
You must be signed in to change notification settings - Fork 129
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
403 error with http-aws-es #45
Comments
Hi @khoa162, I was also getting a 403 error recently with this package, if you want to try this fork where I have changed out the signer quickly to see if that was the problem for you too it might be a quick fix and also help @TheDeveloper track down the source of the issue. Simply add the fork to your package.json as... Hope that helps |
Hi, I am also getting 403 error. "User: anonymous is not authorized to perform: es:ESHttpPost on resource: XXX". @spazworm I have tried your for but with no luck.
|
Hi @TheDeveloper , so the code looks like this
Still have the same 403 (Forbidden) User: anonymous is not authorized to perform: es:ESHttpPost on resource ZZZ. Any help would be appreciated ;) |
@Mozowski thanks. Is that IAM user definitely authorised for es actions? Can you also double check region is being set correctly? |
@TheDeveloper thanks for quick answer. I have checked credentials I am logging here
|
@TheDeveloper I have been able to move forward with debugging. It sounds like this is problem with AWS library. |
@Mozowski thanks for the extra info! That would be the problem. This module only works on Node because it uses AWS.NodeHttpClient, which isn't present on other platforms. Browser compatibility is possible though. When running on browser this module could use AWS SDK's XHRClient instead to make requests. |
Thanks @TheDeveloper !
I am not sure if the
|
@Mozowski unfortunately it's not quite a simple hot-swap, we would need to integrate the XHRClient |
Ok, thank you for support @TheDeveloper ! |
@Mozowski I've just pushed |
@TheDeveloper everything is working fine! Thank you for great support! |
-----------------------My Code--------------------------------
import es from 'elasticsearch';
import awsSdk from 'aws-sdk';
import httpAwsEs from 'http-aws-es';
import AWS from '../../config/aws';
const options = {
host: '....................',
connectionClass: httpAwsEs,
awsConfig: new awsSdk.Config({
credentials: new awsSdk.Credentials(AWS.accessKeyId, AWS.secretAccessKey),
region: AWS.region,
}),
httpOptions: {}
/amazonES: {
region: AWS.region,
accessKey: AWS.accessKeyId,
secretKey: AWS.secretAccessKey
}/
};
const EsClient = new es.Client(options);
-----------------------------------------------ERROR-------------------------------
Trace: { Authorization Exception :: {"path":"/","query":{},"statusCode":403,"response":""}
at respond (D:\Workspace\2017.........\server\node_modules\elasticsearch\src\lib\transport.js:307:15)
at checkRespForFailure (D:\Workspace\2017............\server\node_modules\elasticsearch\src\lib\transport.js:266:7)
at IncomingMessage.cleanUp (D:\Workspace\2017....................\server\node_modules\http-aws-es\connector.js:61:9)
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:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
status: 403,
displayName: 'AuthorizationException',
message: 'Authorization Exception',
path: '/',
query: {},
body: undefined,
statusCode: 403,
response: '',
toString: [Function],
toJSON: [Function] }
at D:/Workspace/2017/................./server/app/controllers/EsController.js:46:13
at respond (D:\Workspace\2017.................\server\node_modules\elasticsearch\src\lib\transport.js:326:9)
at checkRespForFailure (D:\Workspace\2017.................\server\node_modules\elasticsearch\src\lib\transport.js:266:7)
at IncomingMessage.cleanUp (D:\Workspace\2017.................\server\node_modules\http-aws-es\connector.js:61:9)
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:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
I am using http-aws-es and that is the error. It works well when I change the connectionClass from httpAwsEs to 'http'. Could y guys explain to me the reason why I fail to use http-aws-es in this case?
The text was updated successfully, but these errors were encountered: