question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GoogleApiException: "Error response is null" - request to include status code in message

See original GitHub issue

I have just encountered an exception with an error message that does not produce any Google search results. I am just testing my app for the first time after rewriting it to use Google Storage.

I don’t expect a resolution, but rather I’m posting here so other people encountering the error can at least get a search result for it.

The issue was repeatable. Each time I performed the same action in my app, it caused the error. However, that code is used in other actions and works. That is to say my call to GetBucketAsync() works and then doesn’t work, depending on what I do in my app. It also caused my debugger to crash on GetBucketAsync() and it felt like it crashed from just stopping on that line, not executing it but maybe I imagined that.

It’s all a bit strange. I’ll keep experimenting and update.

Environment details

  • OS: macOS 12.2.1
  • .NET version: 6.0.100
  • Package name and version: Google.Cloud.Storage.V1, Version=3.6.0.0

Steps to reproduce

  1. Use the StorageClient.GetBucketAsync(...) method
  2. Observe an error sometimes.

Stack trace is below.

The service storage has thrown an exception: Google.GoogleApiException: Error response is null
   at Google.Apis.Services.BaseClientService.DeserializeError(HttpResponseMessage response)
   at Google.Apis.Requests.ClientServiceRequest`1.ParseResponse(HttpResponseMessage response)
   at Google.Apis.Requests.ClientServiceRequest`1.ExecuteAsync(CancellationToken cancellationToken)
   at Google.Apis.Requests.ClientServiceRequest`1.ExecuteAsync()
   at AcmeCorp.Coyote.Data.GoogleBlobs.GoogleIndexedObjectStore`1.GetBlobHeadsAsync(OpContext op) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Data/Coyote.Data.GoogleBlobs/GoogleIndexedObjectStore.cs:line 700
   at AcmeCorp.Coyote.Data.GoogleBlobs.GoogleIndexedObjectStore`1.TryGetItemAndHeadAsync(OpContext op, String blobKey) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Data/Coyote.Data.GoogleBlobs/GoogleIndexedObjectStore.cs:line 293
   at AcmeCorp.Coyote.Features.Capture.BoxItemDeleter.DeleteOutboxItemAsync(OpContext op, String itemKey) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Web.Capture.Guts/Coyote.Features.Capture/BoxItemDeleter.cs:line 40
   at AcmeCorp.Coyote.Features.Capture.Coyote.Outbox.DeleteAsync(OpContext op, String itemKey) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Web.Capture.Guts/Coyote.Features.Capture.Coyote/Outbox.cs:line 125
   at AcmeCorp.Coyote.Features.Capture.Coyote.Outbox.EnactAsync(Act act) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Web.Capture.Guts/Coyote.Features.Capture.Coyote/Outbox.cs:line 298
   at AcmeCorp.Coyote.Features.Capture.CaptureCommandsImpl.EnactOutboxItemAsync(Act act) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Web.Capture.Guts/Coyote.Features.Capture/CaptureCommandsImpl.cs:line 277
   at AcmeCorp.Coyote.Features.Capture.Coyote.CoyoteController.PostCaptureCommand(PostCaptureCommandFormModel formModel) in /Users/lukepuplett/Documents/Git/Coyote/src/AcmeCorp.Coyote.Web.Capture.Guts/Coyote.Features.Capture.Coyote/CoyoteController.cs:line 156
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
amanda-tarafacommented, Mar 3, 2022

As an FYI I’ve sent #2067 for review which should address this issue and makes several improvements on error hadling. Some of the changes are breaking, but only if code was dependant on the exact error message, which was not very useful to start with.

0reactions
jskeetcommented, Mar 1, 2022

Note - A problem could be if developers have written code contingent on that message text.

Yes, that’s always a risk 😦 Hopefully, given how little information is in that, and that the status code is available, that won’t actually cause problems - but we’ll note it in release notes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null ResponseBody sometimes, when uploading file using ...
I'm sometimes getting null ResponseBody when I send some files to google drive. This happens randomly, most of the files are sent, but...
Read more >
HTTP status and error codes for JSON | Cloud Storage
The following document provides reference information about the status codes and error messages that are used in the Cloud Storage JSON API.
Read more >
Exception message is always null when Http status code ...
One solution would be to pass the request's responseMessage from HttpURLConnection#getResponseMessage() to the call to ...
Read more >
YouTube Data API - Errors
This document identifies the different types of errors that YouTube Data API operations can return. You can also find a list of errors...
Read more >
com.google.api.client.googleapis.json.GoogleJsonError ...
Returns the list of detailed errors or null for none. setCode. Sets the HTTP status code of this response or null for none....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found