grpc / grpc-dart

The Dart language implementation of gRPC.
https://pub.dev/packages/grpc
Apache License 2.0
861 stars 271 forks source link

Null check operator used on a null value #529

Open jonasfj opened 3 years ago

jonasfj commented 3 years ago

Using package:grpc version 3.0.2, stack trace from pub.dev which uses package:grpc through package:appengine.

Error:
    gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error making call: Null check operator used on a null value, details: null, rawResponse: null, trailers: {})

Stack:
    dart:async/stream_controller.dart 561:44                                             _StreamController.addError
    package:grpc/src/client/call.dart 213:18                                             ClientCall._terminateWithError
    package:grpc/src/client/call.dart 269:7                                              ClientCall._sendRequest
    package:grpc/src/client/call.dart 249:24                                             ClientCall.onConnectionReady.<fn>
    package:stack_trace/src/stack_zone_specification.dart 126:26                         StackZoneSpecification._registerUnaryCallback.<fn>.<fn>

There is two issues here:


This isn't something that happens frequently:

73aL2d2WtMSZZMS

Full stack-trace ``` api_builder: Unhandled error in API handler (incidentId: 297a9bf5-c9f8-4a43-9885-5d610b1a2adb) Error: gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error making call: Null check operator used on a null value, details: null, rawResponse: null, trailers: {}) Stack: dart:async/stream_controller.dart 561:44 _StreamController.addError package:grpc/src/client/call.dart 213:18 ClientCall._terminateWithError package:grpc/src/client/call.dart 269:7 ClientCall._sendRequest package:grpc/src/client/call.dart 249:24 ClientCall.onConnectionReady. package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1436:47 _rootRunUnary ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async/future_impl.dart 348:23 Future.then package:grpc/src/client/call.dart 249:12 ClientCall.onConnectionReady package:grpc/src/client/http2_connection.dart 183:10 Http2ClientConnection._startCall package:grpc/src/client/http2_connection.dart 142:9 Http2ClientConnection.dispatchCall package:grpc/src/client/channel.dart 96:18 ClientChannelBase.createCall. package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1436:47 _rootRunUnary ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async/future_impl.dart 348:23 Future.then package:grpc/src/client/channel.dart 94:21 ClientChannelBase.createCall package:appengine/src/appengine_internal.dart 302:22 _ClientChannelWithClientId.createCall package:grpc/src/client/client.dart 49:18 Client.$createUnaryCall. package:grpc/src/client/client.dart 57:19 Client.$createUnaryCall package:appengine/src/grpc_api/dart/google/datastore/v1/datastore.pbgrpc.dart 70:12 DatastoreClient.runQuery package:appengine/src/grpc_api_impl/datastore_impl.dart 254:62 GrpcDatastoreImpl.query package:gcloud/src/db/db.dart 267:30 Query.run. dart:async/stream_controller.dart 773:24 _runGuarded dart:async/stream_controller.dart 651:7 _StreamController._subscribe. dart:async/stream_impl.dart 417:13 _BufferingStreamSubscription._guardCallback dart:async/stream_controller.dart 650:18 _StreamController._subscribe dart:async/stream_controller.dart 786:19 _ControllerStream._createSubscription dart:async/stream_impl.dart 473:9 _StreamImpl.listen dart:async/stream_pipe.dart 114:10 new _ForwardingStreamSubscription dart:async/stream_pipe.dart 86:16 _ForwardingStream._createSubscription dart:async/stream_pipe.dart 81:12 _ForwardingStream.listen dart:async/stream.dart 1035:10 Stream.toList package:pub_dev/package/backend.dart 242:30 PackageBackend.versionsOfPackage package:pub_dev/package/backend.dart 547:50 PackageBackend.listVersions ===== asynchronous gap =========================== package:pub_dev/frontend/handlers/package.dart 379:39 listVersionsHandler. package:pub_dev/frontend/handlers/package.dart 378:53 listVersionsHandler. package:neat_cache/neat_cache.dart 175:35 _Entry.get ===== asynchronous gap =========================== package:pub_dev/frontend/handlers/package.dart 378:49 listVersionsHandler package:pub_dev/frontend/handlers/pubapi.dart 39:18 PubApi.listVersions package:pub_dev/frontend/handlers/pubapi.g.dart 14:38 _$PubApiRouter. package:pub_dev/frontend/handlers/pubapi.g.dart 12:7 _$PubApiRouter. dart:core-patch/function_patch.dart 11:30 Function._apply dart:core-patch/function_patch.dart 34:12 Function.apply package:shelf_router/src/router_entry.dart 107:29 RouterEntry.invoke. package:shelf_router/src/router_entry.dart 103:30 RouterEntry.invoke. package:shelf_router/src/router_entry.dart 111:7 RouterEntry.invoke package:shelf_router/src/router.dart 175:38 Router.call package:pub_dev/frontend/handlers.dart 69:35 createAppHandler. ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async-patch/async_patch.dart 45:22 _asyncThenWrapperHelper package:pub_dev/frontend/handlers.dart createAppHandler. package:pub_dev/shared/handler_helpers.dart 82:29 _redirectLoopDetectorWrapper. package:pub_dev/shared/handler_helpers.dart 81:10 _redirectLoopDetectorWrapper. package:pub_dev/shared/handler_helpers.dart 154:29 _cspHeaderWrapper. package:pub_dev/shared/handler_helpers.dart 153:10 _cspHeaderWrapper. package:pub_dev/shared/handler_helpers.dart 255:27 _userAuthWrapper. package:pub_dev/shared/handler_helpers.dart 244:10 _userAuthWrapper. package:pub_dev/shared/handler_helpers.dart 146:25 _requestContextWrapper. package:pub_dev/shared/handler_helpers.dart 121:10 _requestContextWrapper. package:pub_dev/shared/handler_helpers.dart 281:38 _userSessionWrapper. package:pub_dev/shared/handler_helpers.dart 263:10 _userSessionWrapper. package:pub_dev/shared/handler_helpers.dart 303:38 _httpsWrapper. package:pub_dev/shared/handler_helpers.dart 295:10 _httpsWrapper. package:pub_dev/shared/handler_helpers.dart 237:25 _sanitizeRequestWrapper. package:pub_dev/shared/handler_helpers.dart 230:10 _sanitizeRequestWrapper. package:pub_dev/shared/handler_helpers.dart 178:27 _logRequestWrapper. package:pub_dev/shared/handler_helpers.dart 170:10 _logRequestWrapper. package:shelf/shelf_io.dart 114:29 handleRequest package:pub_dev/shared/handler_helpers.dart 51:5 runHandler. package:appengine/appengine.dart 80:12 runAppEngine. package:appengine/src/appengine_internal.dart 57:18 runAppEngine... package:gcloud/service_scope.dart 205:19 _ServiceScope._fork. dart:async/zone.dart 1428:13 _rootRun dart:async/zone.dart 1328:19 _CustomZone.run dart:async/zone.dart 1863:10 _runZoned dart:async/zone.dart 1851:12 runZonedGuarded dart:async/zone.dart 1782:12 runZoned package:gcloud/service_scope.dart 204:12 _ServiceScope._fork package:gcloud/service_scope.dart 102:30 fork package:appengine/src/appengine_internal.dart 55:9 runAppEngine.. package:appengine/src/server/server.dart 83:17 AppEngineHttpServer.run.. package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1436:47 _rootRunUnary dart:async/zone.dart 1335:19 _CustomZone.runUnary dart:async/zone.dart 1244:7 _CustomZone.runUnaryGuarded dart:async/stream_impl.dart 341:11 _BufferingStreamSubscription._sendData dart:async/stream_impl.dart 271:7 _BufferingStreamSubscription._add dart:async/stream_controller.dart 733:19 _SyncStreamControllerDispatch._sendData dart:async/stream_controller.dart 607:7 _StreamController._add dart:async/stream_controller.dart 554:5 _StreamController.add dart:_http/http_impl.dart 3237:19 _HttpServer._handleRequest dart:_http/http_impl.dart 2990:19 new _HttpConnection. package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1436:47 _rootRunUnary dart:async/zone.dart 1335:19 _CustomZone.runUnary dart:async/zone.dart 1244:7 _CustomZone.runUnaryGuarded dart:async/stream_impl.dart 341:11 _BufferingStreamSubscription._sendData dart:async/stream_impl.dart 271:7 _BufferingStreamSubscription._add dart:async/stream_controller.dart 733:19 _SyncStreamControllerDispatch._sendData dart:async/stream_controller.dart 607:7 _StreamController._add dart:async/stream_controller.dart 554:5 _StreamController.add dart:_http/http_parser.dart 394:19 _HttpParser._headersEnd dart:_http/http_parser.dart 750:15 _HttpParser._doParse dart:_http/http_parser.dart 324:7 _HttpParser._parse package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1436:47 _rootRunUnary dart:async/zone.dart 1335:19 _CustomZone.runUnary dart:async/zone.dart 1244:7 _CustomZone.runUnaryGuarded dart:async/stream_impl.dart 341:11 _BufferingStreamSubscription._sendData dart:async/stream_impl.dart 271:7 _BufferingStreamSubscription._add dart:async/stream_controller.dart 733:19 _SyncStreamControllerDispatch._sendData dart:async/stream_controller.dart 607:7 _StreamController._add dart:async/stream_controller.dart 554:5 _StreamController.add dart:io-patch/socket_patch.dart 2166:41 _Socket._onData package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1444:13 _rootRunUnary dart:async/zone.dart 1335:19 _CustomZone.runUnary dart:async/zone.dart 1244:7 _CustomZone.runUnaryGuarded dart:async/stream_impl.dart 341:11 _BufferingStreamSubscription._sendData dart:async/stream_impl.dart 271:7 _BufferingStreamSubscription._add dart:async/stream_controller.dart 733:19 _SyncStreamControllerDispatch._sendData dart:async/stream_controller.dart 607:7 _StreamController._add dart:async/stream_controller.dart 554:5 _StreamController.add dart:io-patch/socket_patch.dart 1702:33 new _RawSocket. dart:io-patch/socket_patch.dart 1213:14 _NativeSocket.issueReadEvent.issue dart:async/schedule_microtask.dart 40:21 _microtaskLoop dart:async/schedule_microtask.dart 49:5 _startMicrotaskLoop dart:isolate-patch/isolate_patch.dart 120:13 _runPendingImmediateCallback dart:isolate-patch/isolate_patch.dart 185:5 _RawReceivePortImpl._handleMessage ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async/stream_impl.dart 134:17 _BufferingStreamSubscription._registerDataHandler dart:async/stream_impl.dart 108:19 new _BufferingStreamSubscription.zoned dart:async/stream_impl.dart 103:14 new _BufferingStreamSubscription dart:async/stream_controller.dart 806:9 new _ControllerSubscription dart:async/stream_controller.dart 637:47 _StreamController._subscribe dart:async/stream_controller.dart 786:19 _ControllerStream._createSubscription dart:async/stream_impl.dart 473:9 _StreamImpl.listen dart:_http/http_impl.dart 3183:31 _HttpServer.listen package:appengine/src/server/server.dart 56:14 AppEngineHttpServer.run. package:stack_trace/src/stack_zone_specification.dart 126:26 StackZoneSpecification._registerUnaryCallback.. package:stack_trace/src/stack_zone_specification.dart 208:15 StackZoneSpecification._run package:stack_trace/src/stack_zone_specification.dart 126:14 StackZoneSpecification._registerUnaryCallback. dart:async/zone.dart 1436:47 _rootRunUnary dart:async/zone.dart 1335:19 _CustomZone.runUnary ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async/future_impl.dart 348:23 Future.then package:appengine/src/server/server.dart 50:10 AppEngineHttpServer.run package:appengine/src/appengine_internal.dart 54:9 runAppEngine. package:appengine/src/appengine_internal.dart 110:20 _withAppEngineServicesInternal. ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async-patch/async_patch.dart 45:22 _asyncThenWrapperHelper package:appengine/src/appengine_internal.dart _withAppEngineServicesInternal. package:gcloud/service_scope.dart 205:19 _ServiceScope._fork. dart:async/zone.dart 1428:13 _rootRun dart:async/zone.dart 1328:19 _CustomZone.run dart:async/zone.dart 1863:10 _runZoned dart:async/zone.dart 1785:10 runZoned package:gcloud/service_scope.dart 204:12 _ServiceScope._fork package:gcloud/service_scope.dart 102:30 fork package:appengine/src/appengine_internal.dart 101:10 _withAppEngineServicesInternal package:appengine/src/appengine_internal.dart 51:10 runAppEngine package:appengine/appengine.dart 77:10 runAppEngine package:pub_dev/shared/handler_helpers.dart 50:9 runHandler package:pub_dev/service/entrypoint/frontend.dart 71:11 _main. ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async-patch/async_patch.dart 45:22 _asyncThenWrapperHelper package:pub_dev/service/entrypoint/frontend.dart _main. package:pub_dev/service/services.dart 61:43 withServices. package:pub_dev/service/services.dart 61:23 withServices. package:gcloud/service_scope.dart 205:19 _ServiceScope._fork. dart:async/zone.dart 1428:13 _rootRun dart:async/zone.dart 1328:19 _CustomZone.run dart:async/zone.dart 1863:10 _runZoned dart:async/zone.dart 1785:10 runZoned package:gcloud/service_scope.dart 204:12 _ServiceScope._fork package:gcloud/service_scope.dart 102:30 fork package:pub_dev/service/services.dart 61:18 withServices package:pub_dev/service/entrypoint/frontend.dart 60:9 _main ===== asynchronous gap =========================== dart:async/zone.dart 1356:19 _CustomZone.registerUnaryCallback dart:async-patch/async_patch.dart 45:22 _asyncThenWrapperHelper package:pub_dev/service/entrypoint/_isolate.dart 282:24 _wrapper.. package:pub_dev/service/entrypoint/_isolate.dart 279:25 _wrapper.. package:stack_trace/src/chain.dart 94:24 Chain.capture. dart:async/zone.dart 1428:13 _rootRun dart:async/zone.dart 1328:19 _CustomZone.run dart:async/zone.dart 1863:10 _runZoned dart:async/zone.dart 1785:10 runZoned package:stack_trace/src/chain.dart 92:12 Chain.capture package:pub_dev/service/entrypoint/_isolate.dart 279:17 _wrapper. package:pub_dev/service/entrypoint/_isolate.dart 278:16 _wrapper. package:pub_dev/service/services.dart 206:36 _withPubServices... package:pub_dev/service/services.dart 206:16 _withPubServices... dart:async/zone.dart 1428:13 _rootRun dart:async/zone.dart 1328:19 _CustomZone.run package:pub_dev/service/services.dart 206:12 _withPubServices.. package:gcloud/service_scope.dart 205:19 _ServiceScope._fork. dart:async/zone.dart 1428:13 _rootRun dart:async/zone.dart 1328:19 _CustomZone.run dart:async/zone.dart 1863:10 _runZoned dart:async/zone.dart 1785:10 runZoned package:gcloud/service_scope.dart 204:12 _ServiceScope._fork package:gcloud/service_scope.dart 102:30 fork package:pub_dev/service/services.dart 204:18 _withPubServices. ```
TomKrauss commented 3 years ago

Is this a duplicate of https://github.com/grpc/grpc-dart/issues/488?

gitsofkhaleel commented 1 year ago

any update on this guys . stuck on same issue while using flutter for windows desktop app. I'm in corporate network

gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error making call: Null check operator used on a null value, details: null, rawResponse: null, trailers: {})

mosuem commented 1 year ago

Hi @gitsofkhaleel, could you add some details for me to try and reproduce your error?