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.

Storage - UploadObjectAsync - "Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead." (.NET Core 3.0)

See original GitHub issue

Much like https://github.com/googleapis/google-api-dotnet-client/pull/1469, I’m getting:

Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead.

The stack trace I have is:

   at Google.Cloud.Storage.V1.StorageClientImpl.UploadHelper.CheckFinalProgress()
   at Google.Cloud.Storage.V1.StorageClientImpl.UploadHelper.ExecuteAsync(CancellationToken cancellationToken)

My guess is CheckFinalProgress is finding and rethrowing an exception from elsewhere in the (comprehensively intimidating) upload infrastructure.

I’m on 2.4.0-beta3. After (a lot!) of paging through releases, I couldn’t see anything in the changelogs. In the meantime, I see there’s a 2.5.0 now, so I’ll update, and set AllowSynchronousIO=true.

For others looking to make a one-off exception for a single request:

var syncIOFeature = HttpContext.Features.Get<IHttpBodyControlFeature>();
if (syncIOFeature != null)
{
    syncIOFeature.AllowSynchronousIO = true;
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jskeetcommented, Jan 11, 2020

Thanks for reporting this. I’ll have a look on Monday.

0reactions
kierenjcommented, Jan 22, 2020

I have now, yes, thank you - all working as expected 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET Core : Synchronous operations are disallowed. ...
System.InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.
Read more >
NET Core 3.0 AllowSynchronousIO Workaround
InvalidOperationException: Synchronous operations are disallowed. Call ReadAsync or set AllowSynchronousIO to true instead. at Microsoft.
Read more >
Synchronous operations are disallowed. Call ReadAsync ...
I am setting up Sentry on asp.net Core and I am getting the following message: ... Call ReadAsync or set AllowSynchronousIO to true...
Read more >
Synchronous operations are disallowed. Call ReadAsync or ...
Call ReadAsync or set AllowSynchronousIO to true instead. I could run the application with Visual Studio 2019 without any issue (on IIS Express) ......
Read more >
Google Cloud Storage v1 API - Class StorageClient (4.6.0)
Creates a copy of an object synchronously, potentially to a different bucket. This method uses the rewriteObject underlying API operation ...
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