cancel
Showing results for 
Search instead for 
Did you mean: 

Spatial Anchor LoadUnboundSharedAnchorsAsync Error -1006 - Need Help

anice2706
Honored Guest
 
Hello developers,
 
I'm encountering an issue with Shared Spatial Anchors in my Meta Quest Unity project. 
The save and share process seems to work fine, but loading fails with error code -1006.
 
My implementation steps:
 
1. First, I save the anchor and share it:
// Save anchor
var saveResult = await anchor.SaveAnchorAsync();
 
// Share with users - this works successfully
OVRSpatialAnchor.ShareAsync(anchors, users).ContinueWith(OnShareCompleted, anchors);
 
private void OnShareCompleted(OVRSpatialAnchor.OperationResult result, IEnumerable<OVRSpatialAnchor> anchors)
{
    if (result != OVRSpatialAnchor.OperationResult.Success)
    {
        return;
    }
    // Success callback is properly triggered
}
2. Then when trying to load:
 
var unboundAnchors = new List<OVRSpatialAnchor.UnboundAnchor>();
var uuids = new List<Guid> { mainAnchorUUID };
                
var result = await OVRSpatialAnchor.LoadUnboundSharedAnchorsAsync(uuids, unboundAnchors);
if (!result.Success)
{
    // Getting error code -1006 here
    return;
}
The interesting part is:
 
Save operation completes successfully
Share callback is triggered correctly
UserIDs are properly set
But loading always fails with error -1006
 
Has anyone encountered this error before? Any suggestions on what might be causing this or how to resolve it?
Thanks in advance for any help!
1 REPLY 1

laurent.becherel
Honored Guest

Hello!

-1006 is quite unfortunate, as it most of the time means the error was not handled/expected by the OpenXR method. We have had reports of -1006 errors when sharing, not on the loading itself.

It could mean that the error comes from the cloud itself, something like "you're not allowed to", but I'm just guessing at that point.

 

A few questions though:

- This discussion is in the "Meta Spatial SDK Development" category, but I think that's happening on Unity, in the Meta Core SDK, am I correct to assume that?

- Which version of the OS and the SDK are you using?

- Is the "sharer" (owner/creator) the same as the loader? I'd try another one just in case self loading is not supported right after sharing.

- Sorry to ask, but this is a common pitfall : are you 100% sure that both players have "share data cloud point" enabled and have entitlement to the app?

- Last but not least, have a look at logcat on your device, it is possible there are some more interesting errors reported at the OS level by the anchor sharing service. (Not sure if the logs are visible however, but possibly errors could be surfaced there)

Hope you find a way around the problem.

If you're truly stuck, I recommend trying out either the showcase "Discovery" (this would validate your headset/users are properly setup) and using the Colocation Building Blocks directly in your project to validate that your project is properly setup, and the move forward in debugging the code (although look at it, it looks totally fine!)