Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 139 forks source link

HoloLens 2: Microsoft.Azure.SpatialAnchors.CloudSpatialException #181

Closed Ib594 closed 4 years ago

Ib594 commented 4 years ago

The guides, I'm following: https://docs.microsoft.com/de-de/windows/mixed-reality/mrlearning-asa-ch1 https://docs.microsoft.com/de-de/windows/mixed-reality/mrlearning-sharing(photon)-ch1

My setup: Unity 2019.2.17.f1 MRTK 2.3 ARFoundation 2.0.2 AzureSpatialAnchors.unitypackage MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors.2.3.0.1.unitypackage MRTK.HoloLens2.Unity.Tutorials.Assets.GettingStarted.2.3.0.3.unitypackage MRTK.HoloLens2.Unity.Tutorials.Assets.MultiUserCapabilities.2.3.0.0.unitypackage

What I already did:

I always get the same exception when creating an azure spatial anchor, connecting to the azure service and photon works without any problems.

Log: UnityPlayer.log

MartinPyka commented 4 years ago

Just to clarify: the log file contains a stack trace that is thrown, when we try to create an Anchor in Azure. The stack trace starts with:

Microsoft.Azure.SpatialAnchors.CloudSpatialException at Microsoft.Azure.SpatialAnchors.NativeLibraryHelpers.CheckStatus (System.IntPtr handle, Microsoft.Azure.SpatialAnchors.status value) [0x00000] in <00000000000000000000000000000000>:0 at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.Task.Execute () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.AudioClip+PCMReaderCallback.Invoke (System.Single[] data) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.Task.ExecuteEntry (System.Boolean bPreventDoubleExecution) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <00000000000000000000000000000000>:0

polinenibharat commented 4 years ago

Thank you for the post. We at the Azure Spatial Anchor's team acknowledge the issue and will investigate.

Ib594 commented 4 years ago

We had Authentication issues, editing the SpatialAnchorManager.cs and adding the account domain could solve the problem.

Arc-Soul commented 4 years ago

Is the problem really solved? I still have the issue. @Ib594 : editing the SpatialAnchorManager.cs and adding the account domain could solve the problem. I saw the script, but it don't contain account domain. How should I add it?

19valentin99 commented 4 years ago

@Arc-Soul , I have encountered the same problem (and I spent a couple of days trying to solve it) but after I saw at the bottom right of the tutorial page there is a link with "View all page feedback" (https://github.com/MicrosoftDocs/mixed-reality/issues?utf8=%E2%9C%93&q=%222089610b-9581-ea9b-11c5-7be97e53c584%22&in=body) and one of the posts says that if you create an Azure Spatial Anchor for "East US 2" the problem will be fixed (there is also an explanation on how to use other region but this worked for me).

I hope that this will fix your problem.

chwarr commented 4 years ago

Please make sure to configure the account's domain to match what you see in the Azure portal for your account. Please do not rely on an unset domain defaulting to East US 2.

Efaq commented 3 years ago

@chwarr could you please give more details about "make sure your code configures your Azure Spatial Anchor's account domain"? Exactly which part of the code? And how to configure the ASA account domain? I have had a hard time finding documentation about it, and the problem still persists for me.

Thanks!

chwarr commented 3 years ago

See if these sections of the documentation help, @Efaq:

If none of these work, can you open a new issue with the details of what you're encountering?

khilesh55 commented 2 years ago

Folks, I had been super confused for two whole days during which I tried 20+ different fixes for this issue. I was getting the exact same stack trace segment that OP was getting.

Finally I noticed that my free account credits had run out. I logged in with a company subscription, created a new spatial anchors resource, copied down the credentials for it, put the credentials in Assets/AzureSpatialAnchors.SDK/Resources/SpatialAnchorConfig [API Key mode], and also in the ParentAnchor gameobject's SpatialAnchorManager component (I'm using this tutorial https://docs.microsoft.com/en-us/learn/modules/azure-spatial-anchors-tutorials/5-exercise-save-retrieve-share-azure-spatial-anchors?ns-enrollment-type=LearningPath&ns-enrollment-id=learn.azure.beginner-hololens-2-tutorials)

Now everything works just fine.