[BUG] Erroneous warning logs when performing CreateIfNotExistsAsync
See original GitHub issueDescribe the bug The following code logs a warning:
var serviceCollection = new ServiceCollection();
serviceCollection.AddLogging(b => b.AddConsole());
serviceCollection.AddAzureClients(ab => ab.AddBlobServiceClient("UseDevelopmentStorage=true"));
var serviceProvider = serviceCollection.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<BlobServiceClient>();
var container = client.GetBlobContainerClient(Guid.NewGuid().ToString());
await container.CreateIfNotExistsAsync();
await container.CreateIfNotExistsAsync(); // here
Expected behavior No warning is logged, we’re not doing anything out of the ordinary which should trigger a warning for our operators.
Actual behavior (include Exception or Stack Trace) It logs a warning, sample:
warn: Azure-Core[8]
Error response [e5d2b146-8b40-47dc-8e0a-f12a623487d4] 409 The specified container already exists. (00.0s)
Server:Windows-Azure-Blob/1.0,Microsoft-HTTPAPI/2.0
x-ms-request-id:01ffe3d0-ee47-44d7-a35d-9303d108d19e
x-ms-version:2020-04-08
x-ms-error-code:ContainerAlreadyExists
Date:Wed, 31 Mar 2021 07:31:06 GMT
Content-Length:230
Content-Type:application/xml
To Reproduce See example above.
Environment:
- Name and version of the Library package used: Azure.Storage.Blobs 12.8.1 (but earlier versions as well)
- Hosting platform or OS and .NET runtime version: up-to-date Windows 10 at least in NET Framework 4.8 and .NET Core 3.1
- IDE and version : up-to-date Visual Studio 2019
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Alternative for BlobContainerClient.CreateIfNotExistsAsync ...
CreateIfNotExistsAsync method to avoid 409 http error. Context: This is a known problem, that a blob client CreateIfNotExists(Async) returns ...
Read more >Only 11 issues displayed in release summary
Currently we are using workaround to fetch the log file and scan it for ##[warning] and ##[error] messages. Sample release definition using ...
Read more >Troubleshoot client application errors in Azure Storage ...
This article helps you investigate client application errors by using metrics, client side logs, and resource logs in Azure Monitor.
Read more >Alternative for BlobContainerClient ... - appsloveworld.com
Your code will have to handle this problem. Checking for existence won't help. The problem is concurrency on the server side, not concurrency...
Read more >Logging levels explained
What should you log at Error/Warn level? What is the difference between Debug and Trace? Should you ever log something at Info level?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thinking about it, we can do something short-term as well. #20064 and https://github.com/microsoft/ApplicationInsights-dotnet/pull/2200
Hi @drauch, since you haven’t asked that we “
/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.