Amplify-js: [ERROR] 11:09.869 AWSPinpointProvider - record event failed. [CredentialsError: Missing credentials in config]

Created on 13 May 2019  路  21Comments  路  Source: aws-amplify/amplify-js

* Which Category is your question related to? *

* What AWS Services are you utilizing? *

* Provide additional details e.g. code snippets *

I am using the following code in my-react native APP

import Amplify, { Auth } from 'aws-amplify';
import AWSConfig from './aws-exports';
Amplify.configure(AWSConfig);

I keep seeing the following error in
[ERROR] 11:09.869 AWSPinpointProvider - record event failed. [CredentialsError: Missing credentials in config]

Can anyone help me out

Analytics pending-close-response-required question to-be-reproduced

Most helpful comment

I'm also receiving this error as well. It just started happening after trying to add amplify API, function, and storage. Is there something wrong on the AWS end as I rolled back my app to a 6 day old commit and still receiving the exact same errors?

I removed everything except Analytics and now can no longer record an event without the app blowing up. This also happened in a live beta of our app that worked fine a few days ago.

Attemtped to place record in a try catch and it still throws the error.

try { Analytics.record( 'App Started' ); } catch (e) { console.log(e); }

All 21 comments

@ajmeraaxesh can you paste your AWSConfig (commenting the endpoints) I thinkg you dont have enabled identityPools on your aws-exports file

'aws_app_analytics': 'enable',
'aws_cognito_identity_pool_id': 'us-west-2:c7e9a86c-8f70-4e02-a3eb-4677f978f28e',
'aws_cognito_region': 'us-west-2',
'aws_content_delivery': 'enable',
'aws_content_delivery_bucket': 'rntestamplify-hosting-mobilehub-1253144757',
'aws_content_delivery_bucket_region': 'us-west-2',
'aws_content_delivery_cloudfront': 'enable',
'aws_content_delivery_cloudfront_domain': 'd1jfp6jrd4sdc1.cloudfront.net',
'aws_mobile_analytics_app_id': '3cdbc8f9fad9476d8dcac7af002734ac',
'aws_mobile_analytics_app_region': 'us-east-1',
'aws_project_id': '586b89c0-7dcc-4218-8ef2-5c2410dc1541',
'aws_project_name': 'RNTestAmplify-2019-05-15-12-54-36',
'aws_project_region': 'us-west-2',
'aws_resource_name_prefix': 'rntestamplify-mobilehub-1253144757',
'aws_sign_in_enabled': 'enable',
'aws_user_pools': 'enable',
'aws_user_pools_id': 'us-west-2_mqzdVT1TY',
'aws_user_pools_mfa_type': 'ON',
'aws_user_pools_web_client_id': '4osvjueg0b9416787h34ggm93u',

I am also getting this when starting the app offline...

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

I'm also receiving this error as well. It just started happening after trying to add amplify API, function, and storage. Is there something wrong on the AWS end as I rolled back my app to a 6 day old commit and still receiving the exact same errors?

I removed everything except Analytics and now can no longer record an event without the app blowing up. This also happened in a live beta of our app that worked fine a few days ago.

Attemtped to place record in a try catch and it still throws the error.

try { Analytics.record( 'App Started' ); } catch (e) { console.log(e); }

Same Error here - created the analytics new with v 1.8.1, but same.

Get the same one just by adding analytics to my project then start my app while this one has no internet connection up.

Removing the node_modules from node_modules/@aws-amplify/analyticsnode_modules worked for me.

see https://github.com/aws-amplify/amplify-js/issues/3030#issuecomment-481374441

I am receiving this error, as well as the warning reference in this thread.

I removed node_modules from node_modules/@aws-amplify/analytics/node_modules but no success.

I added an IAM policy as is the recommendation here and attached it to admin, but still no success.

Here is my aws exports (I removed some of the details bc I think they may be sensitive but I am not sure):

"aws_project_region": "us-east-1",
"aws_cognito_identity_pool_id": ".......................",
"aws_cognito_region": "us-east-1",
"aws_user_pools_id": "......................",
"aws_user_pools_web_client_id": "..................",
"oauth": {},
"aws_mobile_analytics_app_id": "................",
"aws_mobile_analytics_app_region": "us-east-1",

I'm very new to AWS so not sure what details are needed there, or how to fix this. Any help is much appreciated.

Also not sure if this makes a difference, but I am working on a react native mobile app, testing on an android, and using OSX.

Thanks

------ EDIT --------

The issue only arises when the phone I am testing on is not connected to the internet. Any suggestions on how to fix it, or why being offline causes an issue will be much appreciated.

@njdullea
Same here, when the phone is offline.

@davidbiller I am going to use this library: https://github.com/react-native-community/react-native-netinfo to check if the device is offline and prevent calling any aws related code. We'll see how it works, best of luck.

Any solution for this issue?
Happens only when the device is offline and it doesn't crash the app in iOS but crashes in Android.

I was able to do a quick fix by editing the AWSPinpointProvider.js file in @aws-amplify/analytics/lib/providers by making the below change in the _pinpointPutEvents function

This

logger.error('record event failed. ', err);

to

logger.warn('record event failed. ', err);

And it prevented the app crash.
This is a bit ugly fix but got it stop crashing the android app on offline state for now!

In the last stable rls i get this error when the phone is online too.
And wihtout a custom event tracking code.
So i guess it is the session start track from amplify itself

My internet dropped out and this error threw for me after using the app. Internet is back now, every time I go to log in this error throws (perhaps around session start).

So this happened to me only in Android. I closed out of the simulator, closed the bundler, chose a different device in android studio, launched the bundler again, and it worked without the error.

Why this is closed?

"allowUnauthenticatedIdentities": false,
if i set this to "allowUnauthenticatedIdentities": true,
than it is working

I was able to do a quick fix by editing the AWSPinpointProvider.js file in @aws-amplify/analytics/lib/providers by making the below change in the _pinpointPutEvents function

This

logger.error('record event failed. ', err);

to

logger.warn('record event failed. ', err);

And it prevented the app crash.
This is a bit ugly fix but got it stop crashing the android app on offline state for now!

But this is not solution.Now warning comes in yellow :D

"allowUnauthenticatedIdentities": false,
if i set this to "allowUnauthenticatedIdentities": true,
than it is working

In which file you write this.

I am also facing this issue any update on this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

josoroma picture josoroma  路  3Comments

oste picture oste  路  3Comments

rygo6 picture rygo6  路  3Comments

ldgarcia picture ldgarcia  路  3Comments

callmekatootie picture callmekatootie  路  3Comments