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

Failed to Sync with Amplify Content #2137

Closed
3 of 13 tasks
Intelbis opened this issue Sep 20, 2022 · 15 comments
Closed
3 of 13 tasks

Failed to Sync with Amplify Content #2137

Intelbis opened this issue Sep 20, 2022 · 15 comments
Labels
datastore Issues related to the DataStore Category pending-response Issue is pending response from the issue requestor pending-triage This issue is in the backlog of issues to triage

Comments

@Intelbis
Copy link

Intelbis commented Sep 20, 2022

Screen Shot 2022-09-21 at 6 25 53 pm
Screen Shot 2022-09-21 at 6 22 05 pm

Description

I have successfully initiated amplify Auth ui and crud operations following the Amplify doc for Todo form.

Todo form saves inside the app locally and there are no errors in runtime but it ends with "Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY" "Setting currentState to LOCAL_ONLY" "Stopped subscription processor." "No more active subscriptions. Closing web socket."

And the data is not synced to the cloud and it says Failed to sync

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Storage

Steps to Reproduce

Sample App:

import 'dart:async';

import 'package:amplify_api/amplify_api.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_datastore/amplify_datastore.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';
import 'package:ilabs_removal_app/screens/TodosPage.dart';

import 'amplifyconfiguration.dart';
import 'models/Enquiry.dart';
import 'models/ModelProvider.dart';
import 'models/Todo.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {


  @override
  void initState() {


    super.initState();
    _configureAmplify();
  }



  @override
  Widget build(BuildContext context) {
    return Authenticator(
      child: MaterialApp(
        builder: Authenticator.builder(),
        home: const EnquriesPage(),
      ),
    );
  }
}


void _configureAmplify() async {




  final datastorePlugin = AmplifyDataStore(modelProvider: ModelProvider.instance);
  // Add the following line and update your function call with `addPlugins`
  final api = AmplifyAPI();
  await Amplify.addPlugins([datastorePlugin, api ]);
  await Amplify.addPlugin(AmplifyAuthCognito());

  try {
    await Amplify.configure(amplifyconfig);
  } on AmplifyAlreadyConfiguredException {
    print('Tried to reconfigure Amplify; this can occur when your app restarts on Android.');
  }
}



class EnquriesPage extends StatefulWidget {
  const EnquriesPage({Key? key}) : super(key: key);

  @override
  State<EnquriesPage> createState() => _EnquriesPageState();
}


class _EnquriesPageState extends State<EnquriesPage> {

  // subscription of Todo QuerySnapshots - to be initialized at runtime
  late StreamSubscription<QuerySnapshot<Enquiry>> _subscription;

  // loading ui state - initially set to a loading state
  bool _isLoading = true;

  // list of Todos - initially empty
  List<Enquiry> _enquiries = [];

  // amplify plugins
  // final _dataStorePlugin =
  // AmplifyDataStore(modelProvider: ModelProvider.instance);
  // final _dataStorePlugin = AmplifyDataStore(modelProvider: ModelProvider.instance);

  // final AmplifyAPI _apiPlugin = AmplifyAPI();
  // final AmplifyAuthCognito _authPlugin = AmplifyAuthCognito();


  @override
  void initState() {

    // kick off app initialization
    _initializeApp();


    // to be filled in a later step
    super.initState();
  }

  @override
  void dispose() {
    // to be filled in a later step
    super.dispose();
  }

  Future<void> _initializeApp() async {

    // configure Amplify
    // await _configureAmplify();

    // Query and Observe updates to Todo models. DataStore.observeQuery() will
    // emit an initial QuerySnapshot with a list of Todo models in the local store,
    // and will emit subsequent snapshots as updates are made
    //
    // each time a snapshot is received, the following will happen:
    // _isLoading is set to false if it is not already false
    // _todos is set to the value in the latest snapshot
    _subscription = Amplify.DataStore.observeQuery(Enquiry.classType)
        .listen((QuerySnapshot<Enquiry> snapshot) {
      setState(() {
        if (_isLoading) _isLoading = false;
        _enquiries = snapshot.items;
      });
    });
  }
  //
  // Future<void> _configureAmplify() async {
  //
  //   try {
  //
  //
  //     // add Amplify plugins
  //     // await Amplify.addPlugins([_dataStorePlugin, _apiPlugin]);
  //
  //     // configure Amplify
  //     //
  //     // note that Amplify cannot be configured more than once!
  //     // await Amplify.configure(amplifyconfig);
  //   } catch (e) {
  //
  //     // error handling can be improved for sure!
  //     // but this will be sufficient for the purposes of this tutorial
  //     print('An error occurred while configuring Amplify: $e');
  //   }
  //
  //   // to be filled in a later step
  // }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.redAccent,
        title: const Text('Enquiries'),
      ),

      body: _isLoading
          ? Center(child: CircularProgressIndicator())
          : EnquiriesList(enquiries: _enquiries),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => const AddEnquiryForm()),
          );
        },
        tooltip: 'Add To do',
        label: Row(
          children: const [Icon(Icons.add), Text('Enquire')],




        ),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
    );
  }
}

class EnquiriesList extends StatelessWidget {
  const EnquiriesList({
    required this.enquiries,
    Key? key,
  }) : super(key: key);

  final List<Enquiry> enquiries;

  @override
  Widget build(BuildContext context) {
    return enquiries.isNotEmpty
        ? ListView(
        padding: const EdgeInsets.all(8),
        children: enquiries.map((enquiry) => EnquiryItem(enquiry: enquiry)).toList())
        : const Center(
      child: Text('Tap button below to add a todo!'),
    );
  }
}

class EnquiryItem extends StatelessWidget {
  const EnquiryItem({
    required this.enquiry,
    Key? key,
  }) : super(key: key);

  final double iconSize = 24.0;
  final Enquiry enquiry;

  void _deleteEnquiry(BuildContext context) async {

    try {
      // to delete data from DataStore, we pass the model instance to
      // Amplify.DataStore.delete()
      await Amplify.DataStore.delete(enquiry);
    } catch (e) {
      print('An error occurred while deleting Todo: $e');
    }
    // to be filled in a later step
  }

  Future<void> _toggleIsComplete() async {


    // copy the Todo we wish to update, but with updated properties
    final updatedEnquiry = enquiry.copyWith(isComplete: !enquiry.isComplete);
    try {

      // to update data in DataStore, we again pass an instance of a model to
      // Amplify.DataStore.save()
      await Amplify.DataStore.save(updatedEnquiry);
    } catch (e) {
      print('An error occurred while saving Todo: $e');
    }
    // to be filled in a later step
  }

  @override
  Widget build(BuildContext context) {
    return Card(
      child: InkWell(
        onTap: () {
          _toggleIsComplete();
        },
        onLongPress: () {
          _deleteEnquiry(context);
        },
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(children: [
            Expanded(
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    enquiry.name,
                    style: const TextStyle(
                        fontSize: 20, fontWeight: FontWeight.bold),
                  ),

                  Text(
                    enquiry.noBedrooms,
                    style: const TextStyle(
                        fontSize: 20, fontWeight: FontWeight.bold),
                  ),

                  Text(enquiry.description ?? 'No description'),
                ],
              ),
            ),
            Icon(
                enquiry.isComplete
                    ? Icons.check_box
                    : Icons.check_box_outline_blank,
                size: iconSize),
          ]),
        ),
      ),
    );
  }
}

class AddEnquiryForm extends StatefulWidget {
  const AddEnquiryForm({Key? key}) : super(key: key);

  @override
  State<AddEnquiryForm> createState() => _AddEnquiryFormState();
}

class _AddEnquiryFormState extends State<AddEnquiryForm> {
  final _nameController = TextEditingController();
  final _descriptionController = TextEditingController();
  final _noBedroomsController = TextEditingController();

  Future<void> _saveEnquiry() async {

    // get the current text field contents
    final name = _nameController.text;
    final description = _descriptionController.text;
    final noBedrooms = _noBedroomsController.text;

    // create a new Todo from the form values
    // `isComplete` is also required, but should start false in a new Todo
    final newEnquiry = Enquiry(
      name: name,
      description: description.isNotEmpty ? description : null,
      isComplete: false,
      noBedrooms: noBedrooms,


    );

    try {
      // to write data to DataStore, we simply pass an instance of a model to
      // Amplify.DataStore.save()
      await Amplify.DataStore.save(newEnquiry);

      // after creating a new Todo, close the form
      Navigator.of(context).pop();
    } catch (e) {
      print('An error occurred while saving Todo: $e');
    }






  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Send Enquiry'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              TextFormField(
                controller: _nameController,
                decoration:
                const InputDecoration(filled: true, labelText: 'Name'),
              ),
              TextFormField(
                controller: _descriptionController,
                decoration: const InputDecoration(
                    filled: true, labelText: 'Description'),
              ),

              TextFormField(
                controller: _noBedroomsController,
                decoration: const InputDecoration(
                    filled: true, labelText: 'Description'),
              ),
              ElevatedButton(
                onPressed: _saveEnquiry,
                child: const Text('Save'),
              )
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Android Device/Emulator API Level

API 32+

Environment

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-arm, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 14.0)
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods.
      To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.71.2)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.
seankeish@Seans-MBP Removalist-Platform % $ sudo gem install cocoapods

zsh: command not found: $

Dependencies

name: ilabs_removal_app
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.15.0 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter

  amplify_flutter: ^0.6.0
  amplify_datastore: ^0.6.0
  amplify_api: ^0.6.0
  amplify_auth_cognito: ^0.6.0
  amplify_authenticator: ^0.2.0



  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  convert: ^3.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Device

Macbook

OS

15.1

Deployment Method

Amplify CLI

CLI Version

9.1.0

Additional Context

App Log:

.kt:519)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
[        ] W/amplify:aws-datastore( 7311): 	at java.lang.Thread.run(Thread.java:1012)
[        ] E/amplify:flutter:datastore( 7311): DataStoreException{message=Initial cloud sync failed for Enquiry., cause=DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Check your internet connection.}
[   +2 ms] E/amplify:aws-datastore( 7311): Failure encountered while attempting to start API sync.
[        ] E/amplify:aws-datastore( 7311): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
[        ] E/amplify:aws-datastore( 7311): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
[        ] E/amplify:aws-datastore( 7311): match your scenario, and file an issue with the details of the bug if there isn't.}
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:322)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda5.subscribe(Unknown Source:2)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
[        ] E/amplify:aws-datastore( 7311): 	at java.lang.Thread.run(Thread.java:1012)
[        ] E/amplify:aws-datastore( 7311): Caused by: java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:318)
[        ] E/amplify:aws-datastore( 7311): 	... 18 more
[        ] E/amplify:aws-datastore( 7311): Caused by: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0(AppSyncClient.java:116)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda4.accept(Unknown Source:6)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:151)
[        ] E/amplify:aws-datastore( 7311): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[        ] E/amplify:aws-datastore( 7311): 	... 3 more
[        ] W/amplify:aws-datastore( 7311): API sync failed - transitioning to LOCAL_ONLY.
[        ] W/amplify:aws-datastore( 7311): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
[        ] W/amplify:aws-datastore( 7311): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
[        ] W/amplify:aws-datastore( 7311): match your scenario, and file an issue with the details of the bug if there isn't.}
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:322)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda5.subscribe(Unknown Source:2)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
[        ] W/amplify:aws-datastore( 7311): 	at java.lang.Thread.run(Thread.java:1012)
[        ] W/amplify:aws-datastore( 7311): Caused by: java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:318)
[        ] W/amplify:aws-datastore( 7311): 	... 18 more
[        ] W/amplify:aws-datastore( 7311): Caused by: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0(AppSyncClient.java:116)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda4.accept(Unknown Source:6)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:151)
[        ] W/amplify:aws-datastore( 7311): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[        ] W/amplify:aws-datastore( 7311): 	... 3 more
[        ] I/amplify:aws-datastore( 7311): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
[        ] I/amplify:aws-datastore( 7311): Setting currentState to LOCAL_ONLY
[        ] I/amplify:aws-datastore( 7311): Stopping subscription processor.
[   +8 ms] I/amplify:aws-datastore( 7311): Stopped subscription processor.
[ +155 ms] I/amplify:aws-api( 7311): No more active subscriptions. Closing web socket.
[+365996 ms] D/EGL_emulation( 7311): app_time_stats: avg=183532.19ms min=17.13ms max=367047.25ms count=2
[+1269 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F....ID 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[ +383 ms] W/OnBackInvokedCallback( 7311): OnBackInvokedCallback is not enabled for the application.
[        ] W/OnBackInvokedCallback( 7311): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
[ +171 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[ +442 ms] D/EGL_emulation( 7311): app_time_stats: avg=1138.29ms min=116.07ms max=2160.51ms count=2
[ +500 ms] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[   +5 ms] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[        ] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[  +67 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +19 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[  +37 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[ +277 ms] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[        ] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[   +3 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[  +54 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[  +11 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +9 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[  +61 ms] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[   +3 ms] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[   +2 ms] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[ +105 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[ +363 ms] D/EGL_emulation( 7311): app_time_stats: avg=1521.02ms min=1521.02ms max=1521.02ms count=1
[  +66 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +3 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[   +4 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +2 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[   +4 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +1 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +52 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +1 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[   +3 ms] I/TextInputPlugin( 7311): Composing region changed by the framework. Restarting the input method.
[   +5 ms] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[   +1 ms] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[   +2 ms] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[        ] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[  +39 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +27 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +2 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[   +3 ms] I/TextInputPlugin( 7311): Composing region changed by the framework. Restarting the input method.
[  +22 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +22 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[        ] D/InsetsController( 7311): show(ime(), fromIme=true)
[   +3 ms] I/TextInputPlugin( 7311): Composing region changed by the framework. Restarting the input method.
[        ] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[        ] W/RemoteInputConnectionImpl( 7311): getTextBeforeCursor on inactive InputConnection
[        ] W/RemoteInputConnectionImpl( 7311): getSurroundingText on inactive InputConnection
[  +29 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +33 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +2 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +10 ms] I/TextInputPlugin( 7311): Composing region changed by the framework. Restarting the input method.
[  +54 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +5 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[   +1 ms] D/InputMethodManager( 7311): showSoftInput() view=io.flutter.embedding.android.FlutterView{c4eddd5 VFE...... .F...... 0,0-1080,2154 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[ +149 ms] I/amplify:aws-datastore( 7311): Orchestrator lock acquired.
[  +13 ms] I/amplify:aws-datastore( 7311): Orchestrator transitioning from LOCAL_ONLY to SYNC_VIA_API
[        ] I/amplify:aws-datastore( 7311): Setting currentState to SYNC_VIA_API
[        ] I/amplify:aws-datastore( 7311): Starting API synchronization mode.
[   +2 ms] I/amplify:aws-datastore( 7311): Starting processing subscription events.
[   +4 ms] I/amplify:aws-datastore( 7311): Orchestrator lock released.
[  +93 ms] I/amplify:flutter:datastore( 7311): Saved item: SerializedModel{id='22036d18-dbbe-4a77-89be-6ef754c3ed02', serializedData={createdAt=null, noBedrooms=terterter, name=, description=null, id=22036d18-dbbe-4a77-89be-6ef754c3ed02, isComplete=false, updatedAt=null}, modelName=Enquiry}
[  +52 ms] W/System.err( 7311): SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[   +1 ms] W/System.err( 7311): SLF4J: Defaulting to no-operation (NOP) logger implementation
[        ] W/System.err( 7311): SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[  +51 ms] I/amplify:aws-datastore( 7311): Successfully enqueued PendingMutation{mutatedItem=SerializedModel{id='22036d18-dbbe-4a77-89be-6ef754c3ed02', serializedData={createdAt=null, noBedrooms=terterter, name=, description=null, id=22036d18-dbbe-4a77-89be-6ef754c3ed02, isComplete=false, updatedAt=null}, modelName=Enquiry}, mutationType=CREATE, mutationId=2c761391-38e7-11ed-89f2-b181ba0da032, predicate=MatchAllQueryPredicate}
[  +38 ms] D/TrafficStats( 7311): tagSocket(129) with statsTag=0xffffffff, statsUid=-1
[ +211 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +18 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[  +15 ms] D/InsetsController( 7311): show(ime(), fromIme=true)
[   +7 ms] D/EGL_emulation( 7311): app_time_stats: avg=119.12ms min=21.77ms max=425.70ms count=9
[  +46 ms] D/EGL_emulation( 7311): app_time_stats: avg=17834.10ms min=0.70ms max=371184.69ms count=21
[ +514 ms] W/abs_removal_app( 7311): Long monitor contention with owner pool-4-thread-4 (7468) at void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.api.aws.AuthorizationType, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action)(SubscriptionEndpoint.java:187) waiters=0 in void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.api.aws.AuthorizationType, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action) for 903ms
[ +145 ms] W/abs_removal_app( 7311): Long monitor contention with owner pool-4-thread-4 (7468) at void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.api.aws.AuthorizationType, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action)(SubscriptionEndpoint.java:187) waiters=1 in void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.api.aws.AuthorizationType, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action) for 1.047s
[ +132 ms] I/amplify:aws-datastore( 7311): Started subscription processor for models: [Enquiry] of types [ON_CREATE, ON_UPDATE, ON_DELETE].
[  +85 ms] D/TrafficStats( 7311): tagSocket(127) with statsTag=0xffffffff, statsUid=-1
[ +454 ms] W/amplify:aws-datastore( 7311): Initial cloud sync failed for Enquiry.
[        ] W/amplify:aws-datastore( 7311): DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0(AppSyncClient.java:116)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda4.accept(Unknown Source:6)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:151)
[        ] W/amplify:aws-datastore( 7311): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
[        ] W/amplify:aws-datastore( 7311): 	at java.lang.Thread.run(Thread.java:1012)
[        ] E/amplify:flutter:datastore( 7311): DataStoreException{message=Initial cloud sync failed for Enquiry., cause=DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Check your internet connection.}
[   +1 ms] E/amplify:aws-datastore( 7311): Failure encountered while attempting to start API sync.
[        ] E/amplify:aws-datastore( 7311): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
[        ] E/amplify:aws-datastore( 7311): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
[        ] E/amplify:aws-datastore( 7311): match your scenario, and file an issue with the details of the bug if there isn't.}
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:322)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda5.subscribe(Unknown Source:2)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
[        ] E/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
[        ] E/amplify:aws-datastore( 7311): 	at java.lang.Thread.run(Thread.java:1012)
[        ] E/amplify:aws-datastore( 7311): Caused by: java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
[        ] E/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:318)
[        ] E/amplify:aws-datastore( 7311): 	... 18 more
[        ] E/amplify:aws-datastore( 7311): Caused by: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0(AppSyncClient.java:116)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda4.accept(Unknown Source:6)
[        ] E/amplify:aws-datastore( 7311): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:151)
[        ] E/amplify:aws-datastore( 7311): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[        ] E/amplify:aws-datastore( 7311): 	... 3 more
[        ] W/amplify:aws-datastore( 7311): API sync failed - transitioning to LOCAL_ONLY.
[        ] W/amplify:aws-datastore( 7311): DataStoreException{message=Initial sync during DataStore initialization failed., cause=java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look at 
[        ] W/amplify:aws-datastore( 7311): https://github.com/aws-amplify/amplify-android/issues to see if there are any existing issues that 
[        ] W/amplify:aws-datastore( 7311): match your scenario, and file an issue with the details of the bug if there isn't.}
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:322)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda5.subscribe(Unknown Source:2)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
[        ] W/amplify:aws-datastore( 7311): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
[        ] W/amplify:aws-datastore( 7311): 	at java.lang.Thread.run(Thread.java:1012)
[        ] W/amplify:aws-datastore( 7311): Caused by: java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
[        ] W/amplify:aws-datastore( 7311): 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:318)
[        ] W/amplify:aws-datastore( 7311): 	... 18 more
[        ] W/amplify:aws-datastore( 7311): Caused by: DataStoreException{message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[0]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='0'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Enquiry' (/syncEnquiries/items[1]/noBedrooms)', locations='null', path='[GraphQLPathSegment{value='syncEnquiries'}, GraphQLPathSegment{value='items'}, GraphQLPathSegment{value='1'}, GraphQLPathSegment{value='noBedrooms'}]', extensions='null'}], cause=null, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$0(AppSyncClient.java:116)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda4.accept(Unknown Source:6)
[        ] W/amplify:aws-datastore( 7311): 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onResponse(AppSyncGraphQLOperation.java:151)
[        ] W/amplify:aws-datastore( 7311): 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[        ] W/amplify:aws-datastore( 7311): 	... 3 more
[   +5 ms] I/amplify:aws-datastore( 7311): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
[        ] I/amplify:aws-datastore( 7311): Setting currentState to LOCAL_ONLY
[        ] I/amplify:aws-datastore( 7311): Stopping subscription processor.
[   +1 ms] I/amplify:aws-datastore( 7311): Stopped subscription processor.
[ +160 ms] I/amplify:aws-api( 7311): No more active subscriptions. Closing web socket.

Amplify Config

const amplifyconfig = ''' {
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "analytics": {
        "plugins": {
            "awsPinpointAnalyticsPlugin": {
                "pinpointAnalytics": {
                    "appId": "appId",
                    "region": "ap-southeast-2"
                },
                "pinpointTargeting": {
                    "region": "ap-southeast-2"
                }
            }
        }
    },
    "api": {
        "plugins": {
            "awsAPIPlugin": {
                "removalist": {
                    "endpointType": "GraphQL",
                    "endpoint": "endpoint",
                    "region": "ap-southeast-2",
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS",
                    "apiKey": "apiKey"
                }
            }
        }
    },
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "UserAgent": "aws-amplify-cli/0.1.0",
                "Version": "0.1.0",
                "IdentityManager": {
                    "Default": {}
                },
                "AppSync": {
                    "Default": {
                        "ApiUrl": "ApiUrl",
                        "Region": "ap-southeast-2",
                        "AuthMode": "AMAZON_COGNITO_USER_POOLS",
                        "ClientDatabasePrefix": "removalist_AMAZON_COGNITO_USER_POOLS"
                    },
                    "removalist_AWS_IAM": {
                        "ApiUrl": "apiUrl",
                        "Region": "ap-southeast-2",
                        "AuthMode": "AWS_IAM",
                        "ClientDatabasePrefix": "removalist_AWS_IAM"
                    },
                    "removalist_API_KEY": {
                        "ApiUrl": "APiUrl",
                        "Region": "ap-southeast-2",
                        "AuthMode": "API_KEY",
                        "ApiKey": "ApiKey",
                        "ClientDatabasePrefix": "removalist_API_KEY"
                    }
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "PoolId",
                            "Region": "ap-southeast-2"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "ap-southeast-2_Uh8gr8KbU",
                        "AppClientId": "appClinenId",
                        "Region": "ap-southeast-2"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH",
                        "socialProviders": [],
                        "usernameAttributes": [
                            "EMAIL"
                        ],
                        "signupAttributes": [],
                        "passwordProtectionSettings": {
                            "passwordPolicyMinLength": 8,
                            "passwordPolicyCharacters": [
                                "REQUIRES_LOWERCASE",
                                "REQUIRES_NUMBERS",
                                "REQUIRES_SYMBOLS",
                                "REQUIRES_UPPERCASE"
                            ]
                        },
                        "mfaConfiguration": "OFF",
                        "mfaTypes": [
                            "SMS"
                        ],
                        "verificationMechanisms": [
                            "EMAIL"
                        ]
                    }
                },
                "PinpointAnalytics": {
                    "Default": {
                        "AppId": "Appid",
                        "Region": "ap-southeast-2"
                    }
                },
                "PinpointTargeting": {
                    "Default": {
                        "Region": "ap-southeast-2"
                    }
                }
            }
        }
    }
}''';
@Jordan-Nelson Jordan-Nelson added datastore Issues related to the DataStore Category pending-triage This issue is in the backlog of issues to triage labels Sep 20, 2022
@Jordan-Nelson
Copy link
Contributor

Hello @Intelbis - Have you made updates to your schema? If so, have you run amplify codegen models to generate new models and amplify push to push these schema updates?

@Jordan-Nelson Jordan-Nelson added the pending-response Issue is pending response from the issue requestor label Sep 20, 2022
@egyangel
Copy link

egyangel commented Sep 20, 2022

Same issue here :
I've already updated to 0.6.8 version and runing amplify codegen models and amplify push

My schema

 type User @model @auth(rules: [
    { allow: owner, ownerField:"id",identityClaim:"sub"},
    { allow: groups, groups: ["operator","administrator"], operations: [create, update, read, delete] }
]) {
    id: ID!
    cognitoId: ID!
    lastName: String
    phoneNumber: String!
    phoneNumberVerified: Boolean @default(value: "false")
    email: String!
    emailVerified: String @default(value: "false")
    name: String
    stripeId:String
    hasValidPaymentMethod: Boolean @default(value: "false")
    defaultPaymentMethod:String
    userStatus:UserStatus @default(value: "ACTIVE")
    balance:Float @default(value: "0")
    trip:[Trip] @hasMany
}

type Trip @model @auth(rules: [
    { allow: owner, operations: [read, update],ownerField: "userIdQuery",identityClaim:"sub"}
    { allow: groups, groups: ["operator","administrator"], operations: [create, update, read, delete] }
]) {
    id: ID!
    startTripDateTime: AWSDateTime
    endTripDateTime: AWSDateTime
    startBookDateTime: AWSDateTime
    endBookDateTime: AWSDateTime
    pauseInterval:[PauseInterval]
    totalBookedSeconds: Int
    totalTripSeconds:Int
    totalPauseSeconds:Int
    extraBookedSeconds: Int
    startLocationlon: String
    startLocationlat: String
    endLocationlon: String
    endLocationlat: String
    totalDistance: Float
    mPrice: Float
    totalDiscount: Float
    discountType: String
    vat: Float
    totalPrice: Float
    userIdQuery:String! @index(name: "byUserIdQuery", queryField: "tripByCustomerUserId")
    user:User @belongsTo
    vehicle:Vehicle  @belongsTo
    payed: Boolean
    paymentDate: AWSDateTime
    tripStatus: TripStatus
}

If I modify the trip from amplify studio i get this error:

GraphQLResponseException{message=Subscription error for Trip: [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSTimestamp' within parent 'User' (/onUpdateTrip/user/_lastChangedAt)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='_lastChangedAt'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'Int' within parent 'User' (/onUpdateTrip/user/_version)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='_version'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'ID' within parent 'User' (/onUpdateTrip/user/cognitoId)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='cognitoId'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSDateTime' within parent 'User' (/onUpdateTrip/user/createdAt)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='createdAt'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'User' (/onUpdateTrip/user/email)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='email'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'User' (/onUpdateTrip/user/phoneNumber)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='phoneNumber'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSDateTime' within parent 'User' (/onUpdateTrip/user/updatedAt)', locations='null', path='[GraphQLPathSegment{value='onUpdateTrip'}, GraphQLPathSegment{value='user'}, GraphQLPathSegment{value='updatedAt'}]', extensions='null'}

@Jordan-Nelson
Copy link
Contributor

@egyangel - If you are manipulating data in amplify studio, all records need to have the appropriate meta data fields (version, createdAt, updatedAt). It looks like lastUpdatedAt is null. I do not recall off the top of my head if studio will add these fields when adding a new record. You may need to add them manually. Do you mind opening a separate issue for this? It sounds like it could be a separate issue that we need to sync with the studio team on.

@Intelbis
Copy link
Author

Intelbis commented Sep 21, 2022

Hello @Intelbis - Have you made updates to your schema? If so, have you run amplify codegen models to generate new models and amplify push to push these schema updates?

Hi Jordan, Yes i have run the sudo amplify codegen models & sudo amplify push commands prior to running the app. My model name has been renamed to Enquiries from Todos. Also I have wiped the data from the android emulator and ran the app again. Same issue..
I have uploaded the pictures of the console and cloud. Im not sure why it doesnt sync. Please let me know how to resolve this.
Thank you!

@Jordan-Nelson
Copy link
Contributor

Can you share your schema?

@Intelbis
Copy link
Author

Intelbis commented Sep 21, 2022

Can you share your schema?

hi Jordan my schema.graphql is

type Enquiry @model @auth(rules: [{allow: owner}, {allow: public}, {allow: private}, {allow: private, provider: iam}]) {
id: ID!
description: String
isComplete: Boolean!
name: String!
noBedrooms: String!
}

many thanks!

@egyangel
Copy link

@egyangel - If you are manipulating data in amplify studio, all records need to have the appropriate meta data fields (version, createdAt, updatedAt). It looks like lastUpdatedAt is null. I do not recall off the top of my head if studio will add these fields when adding a new record. You may need to add them manually. Do you mind opening a separate issue for this? It sounds like it could be a separate issue that we need to sync with the studio team on.

Hi @Intelbis
I've already found another issue with my same problem.
Thanks

@Jordan-Nelson
Copy link
Contributor

@Intelbis - The log indicates that there is a model with a null value for noBedrooms. Is there a model saved in dynamo that is missing this field? Can you see what data is saved via the AWS console?

@Intelbis
Copy link
Author

@Intelbis - The log indicates that there is a model with a null value for noBedrooms. Is there a model saved in dynamo that is missing this field? Can you see what data is saved via the AWS console?

Hi where to find this information? I just went to dynamoDB through aws console there’s nothing. Tables are empty. No tables found it says

@Jordan-Nelson
Copy link
Contributor

If it is showing no tables, it may be displaying info for a different AWS region than where your app I located. You can select this in the top right of the console. Can you confirm you are viewing tables for the same region as your app?

@Intelbis
Copy link
Author

Intelbis commented Sep 22, 2022

If it is showing no tables, it may be displaying info for a different AWS region than where your app I located. You can select this in the top right of the console. Can you confirm you are viewing tables for the same region as your app?

Hi Jordan now I can see the tables. But where can I find the fields here.

Screen Shot 2022-09-22 at 1 18 45 pm

@Jordan-Nelson
Copy link
Contributor

If you click on the table name (I think you want to the third table in that list) there should be a button in the top right that says "Explore Table Items"

@Intelbis
Copy link
Author

Hey Jordan I found these items in there. I can see bedRoom field here...
Screen Shot 2022-09-23 at 2 20 13 am

@Intelbis
Copy link
Author

If you click on the table name (I think you want to the third table in that list) there should be a button in the top right that says "Explore Table Items"

Hi Jordan after exporting those items and running project again seemed to resolve the conflict. It works now.

@Jordan-Nelson
Copy link
Contributor

Okay great, I am glad you were able to resolve the issue. I will close this issue out.

For anyone facing this issue in the future, it looks like this may have been caused by the null fields after the schema was updated to make them non-null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datastore Issues related to the DataStore Category pending-response Issue is pending response from the issue requestor pending-triage This issue is in the backlog of issues to triage
Projects
None yet
Development

No branches or pull requests

3 participants