amplify-js: Pinpoint Analytics Exceeded maximum endpoint per user count 10
Do you want to request a feature or report a bug? seems like a misconfiguration issue?
What is the current behavior?
Amplify analytics configuration
Analytics: {
appId: '***',
region: 'us-east-1',
// endpointId: '***'
}
When I had endpointId as a constant, I could only see one endpoint at Pinpoint. Thus, I got advice in gitter that I should let Amplify set the endpointId. Thus, I did that and I see this Exceeded maximum endpoint per user count 10 error for some users:
400 Bad Request with pinpoint saying that
{"RequestID":"*","Message":"Exceeded maximum endpoint per user count 10"
What is the expected behavior?
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions? 0.4.3
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.
yes
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 40 (10 by maintainers)
same here with
"aws-amplify": "^3.3.2"We still get this issue with @aws-amplify/analytics 4.0.2 @aws-amplify/auth 3.4.14.
It is a really severe one! Many Browsers are configured to clear all caches after a certain period of time. We would really like to use Amplify in production as well. When will this bug be resolved? 🤔
Hey Guys, thanks for reporting. I have sent a pr as @bneigher suggested to fix this issue. Thanks!
@powerful23 I’m pretty sure I see the problem…
Looks like in the code it is checking for the
err.messageto be:Exceeded maximum endpoint per user count 10But that is actually not the value, note the actualerr.messageisExceeded maximum endpoint per user count: 10with a colon.Thus the routine
this._removeUnusedEndpointsis never firing.https://github.com/aws-amplify/amplify-js/blob/master/packages/analytics/src/Providers/AWSPinpointProvider.ts#L353
Perhaps make that check not care about anything after count, as that is technically a magic number and may change on aws side in the future… suggestion:
Do I get a cookie?
I am getting this error with aws-amplify 3.3.10.
@mwarger if you are using Cognito Identity Pool Service to get the AWS Credentials, then you will have two roles, one for unauth identity and on for auth identity, you need to add this policy to these two roles.
Hi,
Any update on this ??
Can we trust using this library or AWS for production critical apps??
@powerful23
At least any update on this will really help.
@bbernays hi we’ve escalated this issue to the service team. Waiting for their response.
The issue happens if your localStorage are cleaned too many times or you don’t have localStorage so that the Amplify will generate a new endpointId every time.
Same for me with
aws-amplify@3.3.17. Actually, there is another issue still open around the same problem: https://github.com/aws-amplify/amplify-js/issues/7251@bneigher
Nice catch. That took care of the issue immediately.
I would email you a cookie if I could. ❤️
Sorry for the late response. I will work on a fix in the next few days. The root cause of the issue is that the endpoint id is cached in the local but might be expired/removed for some reason and thus a new one will be generated which will increase the number of endpoints per user. I am going to call this api: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Pinpoint.html#getUserEndpoints-property to get those endpoints from the specified user id and see if we can unlink some unused ones.
@Jun711 the endpoint stands for the browser in the device so I don’t think the endpoint . When using amplify, it will automatically generate an Id and store it in your browser’s localStorage. It will update the endpoint details like the browser version etc. If you don’t want Amplify to assign the endpoint, you can configure it by yourself: https://aws-amplify.github.io/amplify-js/media/analytics_guide#manual-setup