question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when upgrading to 3.0.11 version with AWSAppSyncRealTimeProvider and cognito identity pool

See original GitHub issue

Describe the bug Hi guys, We updated aws-amplify lib from 2.2.7 to 3.0.11 and since, we cannot make any graphql request (from datastore or graphql api). Here is the error we are receiving now: [WARN] 57:00.206 AWSAppSyncRealTimeProvider - ensure credentials error No Cognito Identity pool provided for unauthenticated access. Uncaught (in promise) Error: No credentials at AWSAppSyncRealTimeProvider.<anonymous> (AWSAppSyncRealTimeProvider.js:1248) at step (AWSAppSyncRealTimeProvider.js:169) at Object.next (AWSAppSyncRealTimeProvider.js:99) at fulfilled (AWSAppSyncRealTimeProvider.js:53)

We didn’t change any config when going to newer version. User can still login and we are receiving accessToken and idToken. When we are rolling back to older version, everything is working again. Does anyone has a clue on where to check or what could be wrong?

(We are not using AWS.config or AWS.credentials in the frontend app at all).

To Reproduce Here is our auth config on entities:

type House
  @model
  @auth(
    rules: [
      { allow: groups, groupsField: "clientId" }
      { allow: private, provider: iam, operations: [read, create, update] }
    ]
  ) {
  id: ID!
  name: String!
...
  clientId: ID!
}

Problems occurs when we have signed in the user. On all grapqh request we have this error (from DataStore or from GraphQL API methods). Our amplify init:

Amplify.configure(awsExports)

Our login method:

Auth.signIn(email, password)

The user is well logged in, we are receiving him via Hub with all good params and his accessToken/idToken are ok.

Expected behavior To be able to update to newer version

What is Configured? If applicable, please provide what is configured for Amplify CLI:

  • Which resources do you have configured?
    • If applicable, please provide your aws-exports file:
     "aws_project_region": "eu-west-1",
     "aws_cognito_identity_pool_id": "eu-west-1:xxx",
     "aws_cognito_region": "eu-west-1",
     "aws_user_pools_id": "eu-west-1_xxx",
     "aws_user_pools_web_client_id": "xxxx",
     "oauth": {
         "domain": "xxxx-dev.auth.eu-west-1.amazoncognito.com",
         "scope": [
             "phone",
             "email",
             "openid",
             "profile",
             "aws.cognito.signin.user.admin"
         ],
         "redirectSignIn": "https://fddsfdfdf.com/",
         "redirectSignOut": "https://ddfdfdf.com/",
         "responseType": "code"
     },
     "federationTarget": "COGNITO_USER_AND_IDENTITY_POOLS",
     "aws_content_delivery_bucket": "xxxx-hostingbucket-dev",
     "aws_content_delivery_bucket_region": "eu-west-1",
     "aws_content_delivery_url": "https://xxxxx.cloudfront.net",
     "aws_user_files_s3_bucket": "xxxxx-dev",
     "aws_user_files_s3_bucket_region": "eu-west-1",
     "aws_appsync_graphqlEndpoint": "https://xxxxx.appsync-api.eu-west-1.amazonaws.com/graphql",
     "aws_appsync_region": "eu-west-1",
     "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS" };

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
SebSchwartzcommented, May 22, 2020

@manueliglesias It’s ok with the delete of node_modules and lockfiles 😉

Thanks for help

1reaction
TheMoumscommented, Mar 5, 2021

Make sure that you have one and only one version of each amplify service in your yarn.lock or package-lock.json. Having multiple versions of the same service is what caused the problem in my project. This can happen if

  • You are using the aws-amplify package and aws-amplify/datastore, aws-amplify/api,… packages. Use the aws-amplify package OR the specific ones but never mix them.

  • You are working in a monorepo project where you have different versions of amplify services for different purposes (mobile, web, …) but in the same lockfile. In that case, you must make sure that there are no version discrepancies between your packages and keep only one version.

Once you are sure that you have one and only one version of each amplify service in your lockfile, just do as above -> delete your node_modules and reinstall them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using identity pools (federated identities) - Amazon Cognito
Every identity in your identity pool is either authenticated or unauthenticated. Authenticated identities belong to users who are authenticated by a public ...
Read more >
AWS Cognito Invalid identity pool configuration - Stack Overflow
The most common reason for this error is your roles aren't set up to trust your identity pool. You should confirm that the...
Read more >
amazon-cognito-identity-js | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
amazon_cognito_identity_dart_2 | Dart Package - Pub.dev
Unofficial Amazon Cognito Identity Provider Dart SDK, to add user sign-up / sign-in to your mobile and web apps with AWS Cloud Services....
Read more >
Amazon.AspNetCore.Identity.Cognito 3.0.0 - NuGet
Amazon.AspNetCore.Identity.Cognito 3.0.0 · README · Frameworks · Dependencies · Used By · Versions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found