Forum Discussion

anice2706's avatar
anice2706
Honored Guest
8 months ago

Spatial Anchor LoadUnboundSharedAnchorsAsync Error -1006 - Need Help

 
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!

3 Replies

  • 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!)

  • I was stuck with this error for a week, but finally solved it. I solved it by resetting the spatial data and room information for all devices I was using. After that, all share anchor operations were successful.

     

    The cause is not that LoadUnboundSharedAnchorsAsync is failing, but that the ShareAsync API is returning Success despite missing the necessary information. When I look at the Logcat for the headset running ShareAsync, the method returns Success despite errors being logged before and after the upload. It was the reason for my mistake.

     

    I'm using Unity 6000.0.49f and SDK v76.

    • Railon's avatar
      Railon
      Protege

      Thanks for the info! Helped us to solve the issue.

      However we still have these 1006 errors from time to time. We have a menu to load other groups and when we switch between groups, after a few tries it works and loads the anchors. Still annoying and I would be happy to get a better description for the 1006 errors.

      ChatGPT Deep Research gave me this:

      Meaning: The code -1006 corresponds to OVRPlugin.Result.Failure_OperationFailed in the Oculus/Meta XR API
      gist.githubusercontent.com
      It indicates a general, non-specific failure when executing an operation (in this case, loading anchors) and provides no further details. In practice, this means something went wrong, but no more precise error code is available. In Meta’s documentation, this code is typically not explained in detail — it only appears as an enum value in the API references.
      gist.githubusercontent.com