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: com.amazonaws.deepdish.graphql.auth#BadRequestException

See original GitHub issue

Describe the bug An error thrown from inside the amplify-js library during an AppSync GraphQL call.

To Reproduce Make thousands or millions (hard to say, exactly) of GraphQL calls to AppSync and hope one fails in this specific manner…

Expected behavior I expect errors which are practically impossible to debug or reproduce to not occur - or, I expect to get more useful error messaging which can help me determine why the error occurred.

Code Snippet The error occurred inside of packages/pubsub/src/Providers/AWSAppSyncRealTimeProvider.ts, inside the _initializeHandshake method:

if (NON_RETRYABLE_CODES.includes(errorCode)) {
	throw new NonRetryableError(errorType);
}
Environment
npx envinfo --system --binaries --browsers --npmPackages --npmGlobalPackages
  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
    Memory: 77.42 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.18.0/bin/npm
  Browsers:
    Chrome: 86.0.4240.111
    Firefox: 80.0.1
    Safari: 13.1
  npmPackages:
    @amaabca/react-components: ^15.0.0 => 15.0.0
    @amaabca/sensitive-param-filter: ^1.0.6 => 1.0.6
    @babel/cli: ^7.2.3 => 7.10.1
    @babel/plugin-transform-runtime: ^7.5.5 => 7.10.1
    @datadog/browser-rum: ^1.5.0 => 1.12.1
    @testing-library/cypress: ^6.0.0 => 6.0.0
    @testing-library/jest-dom: ^5.1.1 => 5.9.0
    @testing-library/react: ^9.4.0 => 9.5.0
    @testing-library/react-hooks: ^3.3.0 => 3.3.0
    @testing-library/user-event: ^10.3.1 => 10.4.1
    @types/jest: ^26.0.15 => 26.0.15
    @types/lodash.orderby: ^4.6.6 => 4.6.6
    @types/node: ^14.14.2 => 14.14.2
    @types/react: ^16.9.53 => 16.9.53
    @types/react-dom: ^16.9.8 => 16.9.8
    @types/react-router-dom: ^5.1.6 => 5.1.6
    @welldone-software/why-did-you-render: ^4.0.5 => 4.2.5
    apollo-link: ^1.2.11 => 1.2.14
    aws-amplify: ^3.0.18 => 3.0.18
    aws-amplify-react: ^3.1.2 => 3.1.9
    aws-appsync: ^3.0.2 => 3.0.3
    aws-sdk: ^2.374.0 => 2.690.0
    axios: ^0.18.0 => 0.18.1
    axios-mock-adapter: ^1.18.1 => 1.18.1
    babel-preset-react: ^6.24.1 => 6.24.1
    commander: ^4.1.0 => 4.1.1
    currency.js: ^1.2.1 => 1.2.2
    cypress: 4.10.0 => 4.10.0
    danger: ^10.4.1 => 10.4.1
    deep-equal: ^2.0.1 => 2.0.3
    deepcopy: ^2.0.0 => 2.0.0
    enzyme: ^3.9.0 => 3.11.0
    enzyme-adapter-react-16: ^1.11.2 => 1.15.2
    enzyme-to-json: ^3.3.5 => 3.5.0
    esm: ^3.2.25 => 3.2.25
    fuse.js: ^3.4.5 => 3.6.1
    glob: ^7.1.6 => 7.1.6
    graphql-tag: ^2.10.1 => 2.10.3
    husky: ^1.3.1 => 1.3.1
    idle-js: ^1.2.0 => 1.2.0
    inquirer: ^6.2.1 => 6.5.2
    isomorphic-fetch: ^3.0.0 => 3.0.0
    jest-styled-components: ^7.0.2 => 7.0.2
    jest-when: ^2.3.1 => 2.7.2
    lodash.orderby: ^4.6.0 => 4.6.0
    mock-fs: ^4.10.1 => 4.12.0
    mock-spawn: ^0.2.6 => 0.2.6
    mockdate: ^2.0.5 => 2.0.5
    moment: 2.25.3 => 2.25.3
    moment-timezone: 0.5.31 => 0.5.31
    node-notifier: ^7.0.2 => 7.0.2
    node-sass: ^4.12.0 => 4.14.1
    nvmrc-check: ^1.0.2 => 1.0.2
    play-sound: ^1.1.3 => 1.1.3
    prop-types: ^15.7.2 => 15.7.2
    query-string: ^6.4.0 => 6.12.1
    random-name: ^0.1.2 => 0.1.2
    react: ^16.12.0 => 16.13.1
    react-dom: ^16.12.0 => 16.13.1
    react-hotkeys: ^2.0.0 => 2.0.0
    react-joyride: ^2.2.1 => 2.2.1
    react-router-dom: ^5.0.0 => 5.2.0
    react-scripts: 3.3.0 => 3.3.0
    react-select: ^2.1.2 => 2.4.4
    react-testing-library: 6.1.2 => 6.1.2
    regenerator-runtime: ^0.13.2 => 0.13.5
    request-promise-native: ^1.0.8 => 1.0.8
    rollbar: ^2.11.0 => 2.16.2
    snazzy: ^8.0.0 => 8.0.0
    standard: ^12.0.1 => 12.0.1
    striptags: ^3.1.1 => 3.1.1
    styled-components: ^5.0.0 => 5.1.1
    typescript: ^4.0.3 => 4.0.3
    use-deep-compare-effect: ^1.3.1 => 1.3.1
    uuid: ^3.3.2 => 3.4.0
    whatwg-fetch: ^3.0.0 => 3.0.0
  npmGlobalPackages:
    aws-azure-login: 2.2.4
    aws-cdk: 1.53.0
    jwt-decode: 2.2.0
    npm: 6.14.8
    typescript: 4.0.2

** Additional Info ** The app was making two simultaneous calls to AppSync when this error was thrown - one of the calls succeeded normally (no logs on the second call, but I think it’s response caused this error). It is very unlikely this is due to an expired token, as:

  1. That should be a different type of error entirely, and
  2. Due to #6343, we have custom code in place to refresh tokens when they have less than 5 minutes to expire before making any GraphQL calls

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
vic-bltcommented, Jan 5, 2021

FWIW, I had the same issue due to the GraphQL API’s key being expired in AppSync.

0reactions
github-actions[bot]commented, Jul 23, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS AppSync - Unauthorized Exception - Stack Overflow
I used AppSync to create a DynamoDB table for my data, and set up authorization for use with Cognito User Pools, which I've...
Read more >
Resolve unauth errors for GraphQL requests in AWS AppSync
401 Unauthorized: The request is denied by either AWS AppSync or the authorization mode because the credentials are missing or invalid. 200 OK ......
Read more >
API (GraphQL) - Setup authorization rules - AWS Amplify Docs
Authorization is required for applications to interact with your GraphQL API. API Keys are best used for public APIs (or parts of your...
Read more >
使用Pytnon Websocket订阅AWS Appsync,IAM授权不工作
... elif(message_object['type'] == 'error'): print ('Error from AppSync: ' + ... ":"com.amazonaws.deepdish.graphql.auth#BadRequestException" ...
Read more >
Find Answers to AWS Questions about AWS Amplify Studio
Is there a way to use Amplify CLI/Studio to create a GraphQL/AppSync API ... to reset my auth settings, I cannot: ``` NoSuchEntity...
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