aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

DataStore - subscriptionError Connection failed: #9770

Closed perryneal11 closed 2 years ago

perryneal11 commented 2 years ago

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

GraphQL API, DataStore

Amplify Categories

storage, api

Environment information

``` # Put output below this line System: OS: macOS 12.2.1 CPU: (8) arm64 Apple M1 Memory: 1.07 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.8.0 - ~/.nvm/versions/node/v17.8.0/bin/node npm: 8.5.5 - ~/.nvm/versions/node/v17.8.0/bin/npm Browsers: Chrome: 99.0.4844.84 Safari: 15.3 npmPackages: @aws-amplify/ui-react: ^2.10.4 => 2.10.4 @aws-amplify/ui-react-internal: undefined () @aws-amplify/ui-react-legacy: undefined () @emotion/react: ^11.8.2 => 11.8.2 @emotion/styled: ^11.8.1 => 11.8.1 @mui/icons-material: ^5.5.1 => 5.5.1 @mui/material: ^5.5.2 => 5.5.2 @testing-library/jest-dom: ^5.16.2 => 5.16.2 @testing-library/react: ^12.1.4 => 12.1.4 @testing-library/user-event: ^13.5.0 => 13.5.0 aws-amplify: ^4.3.17 => 4.3.17 react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-router-dom: ^6.2.2 => 6.2.2 react-scripts: ^5.0.0 => 5.0.0 react-tinder-card: ^1.4.5 => 1.4.5 web-vitals: ^2.1.4 => 2.1.4 npmGlobalPackages: @aws-amplify/cli: 7.6.26 corepack: 0.10.0 npm: 8.5.5 ```

Describe the bug

I am attempting to re use an existing amplify backend with auth and graphAPI that has worked on a react native project, and bring it into a react project.

I have been running in circles googling, posting everywhere for help, running amplify pull, deleting node modules and aws-export.js then re running npm -i and amplify initdeleting and re cloning the repo, running amplify update api, and I am out of things to try, and places to ask.

I receive the following errors in the console.

DataStore - subscriptionError Connection failed: com.amazonaws.deepdish.graphql.auth#UnauthorizedException

DataStore - User is unauthorized to query syncUsers with auth mode API_KEY. No data could be returned.

Here is the problematic code where I am attempting to create a User in the data base if one is not found (There won't be, I have deleted everything everywhere as much as I could even going into dynamo db erasing everything trying to start over.). Please note here there are auth users, and users in the database where I have created a model of a user. The auth portion seems to work fine. I can log in and get the user. Anything with Datastore does not seem to work.


 useEffect(() => {
    const getCurrentUser = async () => {
      const who = await Auth.currentAuthenticatedUser();

      const dbUsers = await DataStore.query(User, (u) =>
        u.awsID("eq", who.attributes.sub)
      );

      if (dbUsers.length < 1) {
        const authUser = await Auth.currentAuthenticatedUser();
        const newUser = new User({
          Netflix: false,
          Prime: false,
          awsID: authUser.attributes.sub,
          username: authUser.attributes.email,
        });
        await DataStore.save(newUser)
          .then(function () {
            console.log("New user created");
            return setUser(newUser);
          })
          .catch((err) => {
            console.log(err);
          });
      } else {
        console.log("hit");
        const dbUser = dbUsers[0];
        setUser(dbUser);
      }
    };
    getCurrentUser();
  }, []);

  useEffect(() => {
    console.log(user)
  }, [user]);`

Whenever I run amplify pull, my api key get overwritten to some old no longer existent api key. If I manually copy and paste my api key from what is shown in the amplify console UI, I can actually get rid of these errors!. However, when I do so, the issue transforms, and while I can get data back through queries, and create data through add and update, the data is old data that i deleted a long time ago, and I have no idea where this is held or how it exists.****. Additionally, these changes in data are not reflected in amplify anywhere. I know this is a feature, I think, where amplify looks for data locally before going to the cloud. In this specific case, it is not useful and confusing.

I am very confused on what I am doing wrong, and while I don't expect this to be a bug exactly, I am out of places to ask. I have made posts on stack overflow, reddit, the discord channel, and am considering hiring a freelancer to hep me figure this out.

Expected behavior

Datastore.query should allow me to query and write data to the database where I can view the changed data in the amplify console UI and not have local data separate of what's in the cloud, and amplify pull should not replace my api key with some api key that doe not exist.

Reproduction steps

  1. I clone my repo https://github.com/perryneal11/WatchMatchWeb
  2. I clone my environment from amplify
  3. I run npm start
  4. errors in the console so I copy api key from the UI and paste over mysterious key in my aws-exports.js file
  5. datastore no longer gives error but has it's own local data that is very stale.

Code Snippet

// Put your code below this line.

Log output

``` // Put your logs below this line [DEBUG] 23:05.355 AuthClass - getting current authenticated user ConsoleLogger.ts:115 [DEBUG] 23:05.361 AuthClass - get current authenticated userpool user ConsoleLogger.ts:115 [DEBUG] 23:05.362 DataStore - Starting DataStore ConsoleLogger.ts:115 [DEBUG] 23:05.362 DataStore - Starting Storage ConsoleLogger.ts:125 [DEBUG] 23:05.634 DataStore - GraphQL endpoint available https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql ConsoleLogger.ts:115 [DEBUG] 23:05.725 AuthClass - getting current credentials ConsoleLogger.ts:115 [DEBUG] 23:05.725 Credentials - getting credentials ConsoleLogger.ts:115 [DEBUG] 23:05.725 Credentials - picking up credentials ConsoleLogger.ts:115 [DEBUG] 23:05.725 Credentials - getting new cred promise ConsoleLogger.ts:115 [DEBUG] 23:05.725 Credentials - checking if credentials exists and not expired ConsoleLogger.ts:115 [DEBUG] 23:05.725 Credentials - need to get a new credential or refresh the existing one ConsoleLogger.ts:115 [DEBUG] 23:05.725 Credentials - no credentials for expiration check ConsoleLogger.ts:115 [DEBUG] 23:05.725 AuthClass - Getting current user credentials ConsoleLogger.ts:115 [DEBUG] 23:05.726 AuthClass - Getting current session ConsoleLogger.ts:125 [DEBUG] 23:05.726 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 23:05.727 AuthClass - Getting the session from this user: CognitoUser {username: '133c5a2a-46ae-4337-a0bd-e42baf19405a', pool: CognitoUserPool, Session: null, client: Client, signInUserSession: CognitoUserSession, …} ConsoleLogger.ts:125 [DEBUG] 23:05.727 AuthClass - Succeed to get the user session CognitoUserSession {idToken: CognitoIdToken, refreshToken: CognitoRefreshToken, accessToken: CognitoAccessToken, clockDrift: 0} ConsoleLogger.ts:125 [DEBUG] 23:05.727 AuthClass - getting session success CognitoUserSession {idToken: CognitoIdToken, refreshToken: CognitoRefreshToken, accessToken: CognitoAccessToken, clockDrift: 0} ConsoleLogger.ts:115 [DEBUG] 23:05.727 Credentials - set credentials from session ConsoleLogger.ts:125 [DEBUG] 23:06.89 Credentials - Load credentials successfully {accessKeyId: 'ASIASFLNZS3EMF3S5DMD', secretAccessKey: 'MlxpS+va/Gd4KoA/mTJCgEwS7CzGdlDc+d5ng4VG', sessionToken: 'IQoJb3JpZ2luX2VjEOf//////////wEaCXVzLWVhc3QtMSJGME…8L98tlMsrc8zylWKK2grZkPXJhzDj7WaB2K6wRf4J/wxWDyrz', expiration: Mon Apr 04 2022 19:23:06 GMT-0400 (Eastern Daylight Time), identityId: 'us-east-1:d628e01c-e764-4bf4-8609-5678e80b96c8'} ConsoleLogger.ts:115 [DEBUG] 23:06.89 AuthClass - Getting current session ConsoleLogger.ts:125 [DEBUG] 23:06.90 AuthClass - Getting the session from this user: CognitoUser {username: '133c5a2a-46ae-4337-a0bd-e42baf19405a', pool: CognitoUserPool, Session: null, client: Client, signInUserSession: CognitoUserSession, …} ConsoleLogger.ts:125 [DEBUG] 23:06.90 AuthClass - Succeed to get the user session CognitoUserSession {idToken: CognitoIdToken, refreshToken: CognitoRefreshToken, accessToken: CognitoAccessToken, clockDrift: 0} ConsoleLogger.ts:115 [DEBUG] 23:06.91 AuthClass - getting current authenticated user ConsoleLogger.ts:115 [DEBUG] 23:06.91 AuthClass - get current authenticated userpool user ConsoleLogger.ts:115 [DEBUG] 23:06.95 DataStore - Attempting Create subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 23:06.97 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-4okjaeglize3lf6e36jl5csnby', query: 'subscription operation {\n onCreateFriendship {\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 23:06.98 DataStore - Attempting Update subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 23:06.98 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-4okjaeglize3lf6e36jl5csnby', query: 'subscription operation {\n onUpdateFriendship {\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 23:06.99 DataStore - Attempting Delete subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 23:06.99 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-4okjaeglize3lf6e36jl5csnby', query: 'subscription operation {\n onDeleteFriendship {\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 23:06.99 DataStore - Attempting Create subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 23:06.99 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-4okjaeglize3lf6e36jl5csnby', query: 'subscription operation {\n onCreateUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 23:06.99 DataStore - Attempting Update subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 23:06.100 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-4okjaeglize3lf6e36jl5csnby', query: 'subscription operation {\n onUpdateUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 23:06.100 DataStore - Attempting Delete subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 23:06.100 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-4okjaeglize3lf6e36jl5csnby', query: 'subscription operation {\n onDeleteUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 23:06.101 AWSAppSyncRealTimeProvider - Initializaling retryable Handshake ConsoleLogger.ts:115 [DEBUG] 23:06.101 Util - bound attempt #1 with this vars: [{"awsRealTimeUrl":"wss://auic44h4w5cbpda55xqsiysjcu.appsync-realtime-api.us-east-1.amazonaws.com/graphql?header=eyJob3N0IjoiYXVpYzQ0aDR3NWNicGRhNTV4cXNpeXNqY3UuYXBwc3luYy1hcGkudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20iLCJ4LWFtei1kYXRlIjoiMjAyMjA0MDRUMjIyMzA2WiIsIngtYXBpLWtleSI6ImRhMi00b2tqYWVnbGl6ZTNsZjZlMzZqbDVjc25ieSJ9&payload=e30="}] ConsoleLogger.ts:115 [DEBUG] 23:06.102 AWSAppSyncRealTimeProvider - Initializing handshake wss://auic44h4w5cbpda55xqsiysjcu.appsync-realtime-api.us-east-1.amazonaws.com/graphql?header=eyJob3N0IjoiYXVpYzQ0aDR3NWNicGRhNTV4cXNpeXNqY3UuYXBwc3luYy1hcGkudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20iLCJ4LWFtei1kYXRlIjoiMjAyMjA0MDRUMjIyMzA2WiIsIngtYXBpLWtleSI6ImRhMi00b2tqYWVnbGl6ZTNsZjZlMzZqbDVjc25ieSJ9&payload=e30= ConsoleLogger.ts:115 [DEBUG] 23:06.104 DataStore - Attempting sync with authMode: API_KEY ConsoleLogger.ts:115 [DEBUG] 23:06.104 Util - attempt #1 with this vars: ["query operation($limit: Int, $nextToken: String, $lastSync: AWSTimestamp, $filter: ModelFriendshipFilterInput){\n\t\tsyncFriendships(limit: $limit, nextToken: $nextToken, lastSync: $lastSync, filter: $filter){\n\t\t\titems {\n\t\t\t\t\t\t\tid\nrequestAccepted\ncreatedAt\nupdatedAt\nfriendshipReceiverId\nfriendshipSenderId\n_version\n_lastChangedAt\n_deleted\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextToken\n\t\t\t\t\t\tstartedAt\n\t\t}\n\t}",{"limit":1000,"nextToken":null,"lastSync":0,"filter":null}] ConsoleLogger.ts:115 [DEBUG] 23:06.104 DataStore - Attempting sync with authMode: API_KEY ConsoleLogger.ts:115 [DEBUG] 23:06.104 Util - attempt #1 with this vars: ["query operation($limit: Int, $nextToken: String, $lastSync: AWSTimestamp, $filter: ModelUserFilterInput){\n\t\tsyncUsers(limit: $limit, nextToken: $nextToken, lastSync: $lastSync, filter: $filter){\n\t\t\titems {\n\t\t\t\t\t\t\tid\nNetflix\nPrime\napprovedContentIMDBID\nunapprovedContentIMDBID\nfriends\nusername\nawsID\ncreatedAt\nupdatedAt\n_version\n_lastChangedAt\n_deleted\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextToken\n\t\t\t\t\t\tstartedAt\n\t\t}\n\t}",{"limit":1000,"nextToken":null,"lastSync":0,"filter":null}] ConsoleLogger.ts:125 [DEBUG] 23:06.106 RestClient - POST https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql ConsoleLogger.ts:125 [DEBUG] 23:06.108 RestClient - POST https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql ConsoleLogger.ts:115 [DEBUG] 23:06.309 AWSAppSyncRealTimeProvider - subscription message from AWS AppSyncRealTime: {"payload":{"errors":[{"errorType":"com.amazonaws.deepdish.graphql.auth#UnauthorizedException","message":"You are not authorized to make this call.","errorCode":400}]},"type":"connection_error"} ConsoleLogger.ts:125 [DEBUG] 23:06.309 Util - error on bound Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (Retry.ts:7:1) at AWSAppSyncRealTimeProvider. (AWSAppSyncRealTimeProvider.ts:766:1) at step (AWSAppSyncProvider.ts:21:1) at Object.throw (AWSAppSyncProvider.ts:21:1) at rejected (AWSAppSyncProvider.ts:21:1) ConsoleLogger.ts:125 [DEBUG] 23:06.309 Util - bound non retryable error Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (Retry.ts:7:1) at AWSAppSyncRealTimeProvider. (AWSAppSyncRealTimeProvider.ts:766:1) at step (AWSAppSyncProvider.ts:21:1) at Object.throw (AWSAppSyncProvider.ts:21:1) at rejected (AWSAppSyncProvider.ts:21:1) ConsoleLogger.ts:118 [DEBUG] 23:06.310 AWSAppSyncRealTimeProvider {err: Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (http…} ConsoleLogger.ts:115 [DEBUG] 23:06.310 DataStore - Create subscription failed with authMode: API_KEY ConsoleLogger.ts:118 [DEBUG] 23:06.310 AWSAppSyncRealTimeProvider {err: Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (http…} ConsoleLogger.ts:115 [DEBUG] 23:06.311 DataStore - Update subscription failed with authMode: API_KEY ConsoleLogger.ts:118 [DEBUG] 23:06.311 AWSAppSyncRealTimeProvider {err: Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (http…} ConsoleLogger.ts:115 [DEBUG] 23:06.311 DataStore - Delete subscription failed with authMode: API_KEY ConsoleLogger.ts:118 [DEBUG] 23:06.311 AWSAppSyncRealTimeProvider {err: Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (http…} ConsoleLogger.ts:115 [DEBUG] 23:06.311 DataStore - Create subscription failed with authMode: API_KEY ConsoleLogger.ts:118 [DEBUG] 23:06.312 AWSAppSyncRealTimeProvider {err: Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (http…} ConsoleLogger.ts:115 [DEBUG] 23:06.312 DataStore - Update subscription failed with authMode: API_KEY ConsoleLogger.ts:118 [DEBUG] 23:06.312 AWSAppSyncRealTimeProvider {err: Error: com.amazonaws.deepdish.graphql.auth#UnauthorizedException at new NonRetryableError (http…} ConsoleLogger.ts:115 [DEBUG] 23:06.312 DataStore - Delete subscription failed with authMode: API_KEY 3ConsoleLogger.ts:115 [DEBUG] 23:06.313 AWSAppSyncRealTimeProvider - Error while unsubscribing undefined 3ConsoleLogger.ts:115 [DEBUG] 23:06.314 AWSAppSyncRealTimeProvider - Error while unsubscribing undefined ConsoleLogger.ts:118 [DEBUG] 23:06.330 RestClient Error: Request failed with status code 401 at createError (createError.js:16:1) at settle (settle.js:17:1) at XMLHttpRequest.onloadend (xhr.js:54:1) ConsoleLogger.ts:125 [DEBUG] 23:06.330 Util - error on Error: Request failed with status code 401 at new NonRetryableError (Retry.ts:7:1) at SyncProcessor. (sync.ts:216:1) at step (subscription.ts:591:1) at Object.throw (subscription.ts:591:1) at rejected (subscription.ts:591:1) ConsoleLogger.ts:125 [DEBUG] 23:06.330 Util - non retryable error Error: Request failed with status code 401 at new NonRetryableError (Retry.ts:7:1) at SyncProcessor. (sync.ts:216:1) at step (subscription.ts:591:1) at Object.throw (subscription.ts:591:1) at rejected (subscription.ts:591:1) ConsoleLogger.ts:125 [DEBUG] 23:06.331 DataStore - Sync failed with authMode: API_KEY Error: Request failed with status code 401 at new NonRetryableError (Retry.ts:7:1) at SyncProcessor. (sync.ts:216:1) at step (subscription.ts:591:1) at Object.throw (subscription.ts:591:1) at rejected (subscription.ts:591:1) ConsoleLogger.ts:118 [DEBUG] 23:06.345 RestClient Error: Request failed with status code 401 at createError (createError.js:16:1) at settle (settle.js:17:1) at XMLHttpRequest.onloadend (xhr.js:54:1) ConsoleLogger.ts:125 [DEBUG] 23:06.345 Util - error on Error: Request failed with status code 401 at new NonRetryableError (Retry.ts:7:1) at SyncProcessor. (sync.ts:216:1) at step (subscription.ts:591:1) at Object.throw (subscription.ts:591:1) at rejected (subscription.ts:591:1) ConsoleLogger.ts:125 [DEBUG] 23:06.345 Util - non retryable error Error: Request failed with status code 401 at new NonRetryableError (Retry.ts:7:1) at SyncProcessor. (sync.ts:216:1) at step (subscription.ts:591:1) at Object.throw (subscription.ts:591:1) at rejected (subscription.ts:591:1) ConsoleLogger.ts:125 [DEBUG] 23:06.345 DataStore - Sync failed with authMode: API_KEY Error: Request failed with status code 401 at new NonRetryableError (Retry.ts:7:1) at SyncProcessor. (sync.ts:216:1) at step (subscription.ts:591:1) at Object.throw (subscription.ts:591:1) at rejected (subscription.ts:591:1) ConsoleLogger.ts:115 [DEBUG] 23:06.378 DataStore - Next fullSync in 86399.968 seconds. (Tue Apr 05 2022 18:23:06 GMT-0400 (Eastern Daylight Time)) ConsoleLogger.ts:115 [DEBUG] 23:06.502 AWSAppSyncRealTimeProvider - WebSocket closed ```

aws-exports.js

/ eslint-disable / // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = { "aws_project_region": "us-east-1", "aws_cognito_identity_pool_id": "us-east-1:e57ed0ce-f903-40c0-9c0b-2c03697d8b26", "aws_cognito_region": "us-east-1", "aws_user_pools_id": "us-east-1_Sk5xe58Ic", "aws_user_pools_web_client_id": "7abv1gbaai78gv0n63ovu8p0jo", "oauth": {}, "aws_cognito_username_attributes": [ "EMAIL" ], "aws_cognito_social_providers": [], "aws_cognito_signup_attributes": [ "EMAIL" ], "aws_cognito_mfa_configuration": "OFF", "aws_cognito_mfa_types": [ "SMS" ], "aws_cognito_password_protection_settings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [] }, "aws_cognito_verification_mechanisms": [ "EMAIL" ], "aws_appsync_graphqlEndpoint": "https://auic44h4w5cbpda55xqsiysjcu.appsync-api.us-east-1.amazonaws.com/graphql", "aws_appsync_region": "us-east-1", "aws_appsync_authenticationType": "API_KEY", "aws_appsync_apiKey": "da2-4okjaeglize3lf6e36jl5csnby" };

export default awsmobile;

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

vyomr13 commented 2 years ago

Hi,

If you want to clear the data which has been there locally you can clear your IndexedDB by running Datastore.clear and also make sure they are not present in DynamoDB. We are still looking into API Key issue which is more related to CLI than JS.

perryneal11 commented 2 years ago

I am on day 7 of simply trying to read or write data to amplify. Is there a way to completely remove amplify from my project and re add it to hopefully fix this? Ignoring the strangeness of the api key changing itself, how do I just get into s working state of reading and writing data?

perryneal11 commented 2 years ago

This was resolved by pushing createapi: 0 as instructed here https://docs.amplify.aws/cli-legacy/graphql-transformer/config-params/#:~:text=copy-,CreateAPIKey,-CreateAPIKey

github-actions[bot] commented 1 year ago

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 amplify-help forum.