question

IshidaAtsushi-2107 avatar image
0 Votes"
IshidaAtsushi-2107 asked HoratiuRoman-5987 answered

Upload model failed after "Attemping to upload asset..." in Azure Object Anchors quick start.

When I was following the tutorials in the guide below, I failed to upload my model.

https://docs.microsoft.com/en-us/azure/object-anchors/quickstarts/get-started-model-conversion#convert-a-3d-model

The error message is as follows:

"Attempting to upload asset...

AggregateException:
Retry failed after 6 tries. (A task was canceled.) (A task was canceled.) (A task was canceled.) (A task was canceled.) (A task was canceled.) (A task was canceled.)"

What is causing the error?

The following items have been checked:
AccountDomain, AccountID, and AccountKey are filled with correct values.
The size of the model is less than 150MB.

azure-object-anchors
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@IshidaAtsushi-2107 Welcome to Microsoft Q&A forum!

Could you please confirm, if you have already checked troubleshooting steps? Model Conversion Error Codes


0 Votes 0 ·

@AshokPeddakotla-MSFT Thank you for your reply.

Yes, I already check this document.
But, I could not see any errors in the list.

The program is stopped between line A and B, so I guess UploadAsync is failing, but I can't figure out why.

                     Console.WriteLine("Attempting to upload asset..."); //line A. This message was output.
                     Uri assetUri = (await client.GetAssetUploadUriAsync()).Value.UploadUri;
                     BlobClient uploadBlobClient = new BlobClient(assetUri);
                     using (FileStream fs = File.OpenRead(configuration.InputAssetPath))
                     {
                         await uploadBlobClient.UploadAsync(fs);
                     }
    
                     Console.WriteLine("Attempting to create asset conversion job..."); //line B. This message was not output.


0 Votes 0 ·

Ack. Checking this issue with our team and update you as earliest. Appreciate your time and patience.

0 Votes 0 ·

@IshidaAtsushi-2107 Apologies for the delay in response.
Are you on wifi? This usually happen when there is bad network connectivity. A flaky network connection can cause this problem.

0 Votes 0 ·
Show more comments
AshokPeddakotla-MSFT avatar image
0 Votes"
AshokPeddakotla-MSFT answered asergaz commented

@IshidaAtsushi-2107 Below is an update from our team on your issue.

Here are a few suggestions that we think would help further debug/understand the issue.

1) Add this line of code:

 Console.WriteLine($"\t{assetUri}");
 Right after the call to:
 Uri assetUri = (await client.GetAssetUploadUriAsync()).Value.UploadUri;

Run the sample. The upload uri will print to screen. Copy it, and try to open it up on any browser. Share with us what the browser displays. If the company’s intranet is blocking is, it should fail, and the browser might be able to show us a better error message. If the intranet is not blocking it, the message will be different.

2) Add this function to the code:

 private void PrintException(Exception e)
 {
     Console.Error.WriteLine($"\n{e.GetType().Name}:\n{e.Message}");
     if (e.InnerException != null)
     {
         PrintException(e.InnerException);
     }
 }

Then, replace this line of code:

 Console.Error.WriteLine($"\n{e.GetType().Name}:\n{e.Message}");
 With this line instead:
 PrintException(e);

Run the sample again. This should give us much better error details on the failure while running the sample.

3) Add this function to the code:

 private static async Task UploadBlobAsync(BlobClient blobClient, string fileToUploadPath)
 {
     FileInfo file = new FileInfo(fileToUploadPath);
     long uploadFileSize = file.Length;
    
     object lockObj = new object();
     int consoleRow = Console.CursorTop;
     Progress<long> progressHandler = new Progress<long>();
     progressHandler.ProgressChanged += new EventHandler<long>(delegate (object sender, long bytesUploaded)
     {
         lock (lockObj)
         {
             Console.SetCursorPosition(0, consoleRow);
             Console.Write($"\tProgress: {((float)bytesUploaded / uploadFileSize) * 100 : 00.00}%");
         }
     });
    
     using (FileStream fs = File.OpenRead(fileToUploadPath))
     {
         await blobClient.UploadAsync(fs, progressHandler: progressHandler);
     }
 }

Then, replace this line of code:

 using (FileStream fs = File.OpenRead(configuration.InputAssetPath))
 {
     await uploadBlobClient.UploadAsync(fs);
 }

With this line instead:

   await UploadBlobAsync(uploadBlobClient, configuration.InputAssetPath);

Run the sample again. This will print progress status while the upload is happening, allowing us to know if the upload is not working at all, or if it is partially allowing to upload a portion of the file.

Also, we will work on our side to make these improvements to the sample code as well.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Thank you for the detailed information.
(Sorry for the delayed response, I was absent due to an adverse reaction to the vaccine)

The results of the implementation are as follows
1)

 <Error>
 <Code>AuthorizationPermissionMismatch</Code>
 <Message>This request is not authorized to perform this operation using this permission. RequestId:4ad219bf-401e-008e-1e7c-8afcfa000000 Time:2021-08-06T04:36:37.1740179Z</Message>
 </Error>

From this result, I checked the access key and ID again, and they were entered correctly.
Is this message due to the company's intranet blocking it?

2,3)

 Progress:  08.86%
 AggregateException:
 Retry failed after 6 tries. (A task was canceled.) (A task was canceled.) (A task was canceled.) (A task was canceled.) (A task was canceled.) (A task was canceled.)
    
 TaskCanceledException:
 A task was canceled.

The value of Progress repeatedly returned to 0 after exceeding 8%-10%.
Please let me know if you have any additional information.



0 Votes 0 ·

@IshidaAtsushi-2107 Thanks for the additional details. We will review it and update you soon.

0 Votes 0 ·
HoratiuRoman-5987 avatar image
0 Votes"
HoratiuRoman-5987 answered HoratiuRoman-5987 published

Hi. I'm trying to upload a model as well and I'm getting a similar error, or maybe the same.

I pasted the error first and then the code. I just wrapped it all in a try{} catch so I can output the error. The error seems to happen on first line. Note: I actually tried on my company wifi, on my usb tethering mobile 4g wifi, as well as without internet at all and I get the same error. So I suspect the Azure library gives a bad upload URL or something.... but I can't see that code because it's probably in a .dll somewhere.

Any idea how to fix?

 Attempting to upload asset...
 Failed.... :(
 System.AggregateException: Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry. (No such host is known.) (No such host is known.) (No such host is known.) (No such host is known.)
  ---> Azure.RequestFailedException: No such host is known.
  ---> System.Net.Http.HttpRequestException: No such host is known.
  ---> System.Net.Sockets.SocketException (11001): No such host is known.
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    --- End of inner exception stack trace ---
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    at Azure.Core.Pipeline.ResponseBodyPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.LoggingPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    --- End of inner exception stack trace ---
    at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.MixedReality.ObjectAnchors.Conversion.BlobUploadEndpointRestClient.GetAsync(Guid accountId, String xMrcCv, CancellationToken cancellationToken)
    at Azure.MixedReality.ObjectAnchors.Conversion.ObjectAnchorsConversionClient.GetAssetUploadUriAsync(CancellationToken cancellationToken)
    at ConversionQuickstart.Program.RunJob(String jobId) in C:\Unity\azure-object-anchors\quickstarts\conversion\ConversionQuickstart\Program.cs:line 85
  ---> (Inner Exception #1) Azure.RequestFailedException: No such host is known.
  ---> System.Net.Http.HttpRequestException: No such host is known.
  ---> System.Net.Sockets.SocketException (11001): No such host is known.
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    --- End of inner exception stack trace ---
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    at Azure.Core.Pipeline.ResponseBodyPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.LoggingPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)<---
    
  ---> (Inner Exception #2) Azure.RequestFailedException: No such host is known.
  ---> System.Net.Http.HttpRequestException: No such host is known.
  ---> System.Net.Sockets.SocketException (11001): No such host is known.
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    --- End of inner exception stack trace ---
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    at Azure.Core.Pipeline.ResponseBodyPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.LoggingPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)<---
    
  ---> (Inner Exception #3) Azure.RequestFailedException: No such host is known.
  ---> System.Net.Http.HttpRequestException: No such host is known.
  ---> System.Net.Sockets.SocketException (11001): No such host is known.
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    --- End of inner exception stack trace ---
    at Azure.Core.Pipeline.HttpClientTransport.ProcessAsync(HttpMessage message, Boolean async)
    at Azure.Core.Pipeline.ResponseBodyPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.LoggingPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
    at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)<---
    
 Waiting for job completion...
    
 NullReferenceException:
 Object reference not set to an instance of an object.


The code is as follows:

 Console.WriteLine("Attempting to upload asset...");
                     try
                     {
                         Uri assetUri = (await client.GetAssetUploadUriAsync()).Value.UploadUri;
    
                         Console.WriteLine($"\tUpload Uri: {assetUri}");
                         BlobClient uploadBlobClient = new BlobClient(assetUri);
                         await UploadBlobAsync(uploadBlobClient, configuration.InputAssetPath);
                         Console.WriteLine("\nAsset uploaded");
    
                         // Schedule our asset conversion job specifying:
                         // - The uri to our uploaded asset
                         // - Our asset file format
                         // - Gravity direction of 3D asset
                         // - The unit of measurement of the 3D asset
                         Console.WriteLine("Attempting to create asset conversion job...");
                         AssetConversionOptions assetOptions = new AssetConversionOptions(
                             assetUri,
                             AssetFileType.FromFilePath(configuration.InputAssetPath),
                             configuration.Gravity,
                             configuration.AssetDimensionUnit);
                         conversionOperation = await client.StartAssetConversionAsync(assetOptions);
    
                         jobId = conversionOperation.Id;
                         Console.WriteLine($"Successfully created asset conversion job. Job ID: {jobId}");
                     }
                     catch (Exception e)
                     {
                         Console.WriteLine("Failed.... :(");
                         Console.WriteLine(e);
                     }
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HoratiuRoman-5987 avatar image
1 Vote"
HoratiuRoman-5987 answered

Hi, I got the same error but then I tried something clever :)

I created a new resource that was identical, but instead of North Europe I set the location to East US 2. Now the upload worked. Hope this helps you diagnose! @IshidaAtsushi-2107

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.