Skip to content
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

AWSPinpointProvider error when executing GraphQL operations on project without Analytics category #3489

Closed
mdwt opened this issue Jun 19, 2019 · 11 comments
Labels
Analytics Related to analytics GraphQL Related to GraphQL API issues to-be-reproduced Used in order for Amplify to reproduce said issue

Comments

@mdwt
Copy link

mdwt commented Jun 19, 2019

There seems to be changes introduced in aws-amplify that causes AWS PinPoint code to execute when doing GraphQL operations even though Analytics is not added to the Amplify project.

The error happens when executing GraphQL operations server side (TypeScript)

Error: No credentials, applicationId or region

    at AWSPinpointProvider.<anonymous> (C:\Users\meiri\dev\betterbook\betterbook-backend\node_modules\@aws-amplify\analytics\src\Providers\AWSPinpointProvider.ts:159:36)
    at step (C:\Users\meiri\dev\betterbook\betterbook-backend\node_modules\@aws-amplify\analytics\lib\Providers\AWSPinpointProvider.js:40:23)
    at Object.next (C:\Users\meiri\dev\betterbook\betterbook-backend\node_modules\@aws-amplify\analytics\lib\Providers\AWSPinpointProvider.js:21:53)
    at fulfilled (C:\Users\meiri\dev\betterbook\betterbook-backend\node_modules\@aws-amplify\analytics\lib\Providers\AWSPinpointProvider.js:12:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)

This started happening after upgrading my project to the latest versions, although I'm not sure which package causes the issue. (This also relates to #3486 that happens after the version upgrade, I added the workaround polyfill as suggested there and now this happens.

Environment:

node 10.16.0
amplify 1.7.4

"dependencies": {
    "@aws/dynamodb-batch-iterator": "^0.7.1",
    "@sentry/browser": "^5.4.0",
    "@sentry/node": "4.4.2",
    "@types/aws-lambda": "^8.10.27",
    "@types/babel__traverse": "^7.0.7",
    "@types/yargs": "^13.0.0",
    "amazon-cognito-auth-js": "^1.3.2",
    "amazon-cognito-identity-js": "^3.0.12",
    "apollo-cache-inmemory": "^1.6.2",
    "aws-amplify": "^1.1.29",
    "aws-appsync": "^1.8.0",
    "aws-lambda-multipart-parser": "^0.1.3",
    "aws-sdk": "^2.474.0",
    "aws4": "^1.8.0",
    "axios": "^0.18.1",
    "axios-es6": "^0.11.1",
    "bcrypt-nodejs": "^0.0.3",
    "blueimp-md5": "^2.10.0",
    "body-parser": "^1.19.0",
    "cryptr": "^4.0.2",
    "errorhandler": "^1.5.1",
    "es6-promise": "^4.2.8",
    "form-data": "^2.3.2",
    "google-libphonenumber": "^3.2.2",
    "graphql-tag": "^2.10.1",
    "handlebars": "^4.1.2",
    "isomorphic-fetch": "^2.2.1",
    "jsonwebtoken": "^8.5.1",
    "jwk-to-pem": "^2.0.1",
    "lodash": "^4.17.11",
    "node-cmd": "^3.0.0",
    "node-fetch": "^2.6.0",
    "node-jose": "^1.1.3",
    "qs": "^6.7.0",
    "request": "^2.88.0",
    "tabletop": "^1.5.2",
    "uuid": "^3.3.2",
    "ws": "^7.0.0"
  },
@victordelval
Copy link

Me too, for GraphQL api with JavaScript...

@sammartinez sammartinez added Analytics Related to analytics GraphQL Related to GraphQL API issues to-be-reproduced Used in order for Amplify to reproduce said issue labels Jun 19, 2019
@Tony-Guerrero
Copy link

Me too, for REST with JavaScript, after upgrading to amplify ver 1.7.4

@aehmt
Copy link

aehmt commented Jun 19, 2019

  Amplify.configure({
    Auth: {
      region: config.region,
      userPoolId: config.userPoolId,
      userPoolWebClientId: config.userPoolWebClientId,
      authenticationFlowType: 'USER_PASSWORD_AUTH'
    },
    Analytics: {
      disabled: true
    }
  })

Fixes the issue.

@darnmark64
Copy link

Me too, for REST with JavaScript, after upgrading to amplify ver 1.7.4

I'm seeing the same thing after upgrading. Our application doesn't use Analytics. My Amplify configure command is using the aws-exports.js file so the @aehmt fix doesn't fit my case.

@ghost
Copy link

ghost commented Jun 21, 2019

When using AWS Amplify CLI (or MobileHub), the configuration is contained in the auto-generated aws-exports.js.

Seeing these PinPoint issues re-appearing from time to time, maybe Amplify-CLI could add the Analytics: { disabled: true } iff the CLI has not added the Analytics service.

In the meantime,

import awsExports from './aws-exports';
Amplify.configure({
   ...awsExports,
   Analytics: { 
       disabled: true
   }
});

@beeera
Copy link

beeera commented Jul 3, 2019

Adding @leantide fix did the trick for me.

@licalac
Copy link

licalac commented Jul 11, 2019

Thanks @leantide also fix the issue for me

@heythisischris
Copy link

Thanks @leantide!

@jordanranz
Copy link
Contributor

This error message should no longer fire after this PR was merged: #3614

I am going to close this issue per the fix above. Please open a new issue if there are any related problems.

@sanyashvets
Copy link

#3484 (comment) worked for me

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Analytics Related to analytics GraphQL Related to GraphQL API issues to-be-reproduced Used in order for Amplify to reproduce said issue
Projects
None yet
Development

No branches or pull requests