question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Playfab Unity Extension Started Giving Me Error

Hello everyone,

I'm using Unity 2019.2.9f1 and Playfab version is 2.80.200121. Everything is up-to-date; however I have started receiving this error message continuously in the editor.

The error:

Playfab EditorExtensions: Caught an error:SharedErrorCallbackHTTP/1.1 403 Forbidden

The code: (It executes the EdExStates.OnError case to print that error message)

/// <summary>
        /// Handles state updates within the editor extension.
        /// </summary>
        /// <param name="state">the state that triggered this event.</param>
        /// <param name="status">a generic message about the status.</param>
        /// <param name="json">a generic container for additional JSON encoded info.</param>
        private void StateUpdateHandler(EdExStates state, string status, string json)
        {
            switch (state)
            {
                case EdExStates.OnMenuItemClicked:
                    PlayFabEditorPrefsSO.Instance.curSubMenuIdx = 0;
                    break;

                case EdExStates.OnSubmenuItemClicked:
                    int parsed;
                    if (int.TryParse(json, out parsed))
                        PlayFabEditorPrefsSO.Instance.curSubMenuIdx = parsed;
                    break;

                case EdExStates.OnHttpReq:
                    object temp;
                    if (string.IsNullOrEmpty(json) || Json.PlayFabSimpleJson.TryDeserializeObject(json, out temp))
                        break;

                    var deserialized = temp as Json.JsonObject;
                    object useSpinner = false;
                    object blockUi = false;

                    if (deserialized.TryGetValue("useSpinner", out useSpinner) && bool.Parse(useSpinner.ToString()))
                    {
                        ProgressBar.UpdateState(ProgressBar.ProgressBarStates.spin);
                    }

                    if (deserialized.TryGetValue("blockUi", out blockUi) && bool.Parse(blockUi.ToString()))
                    {
                        AddBlockingRequest(status);
                    }
                    break;

                case EdExStates.OnHttpRes:
                    ProgressBar.UpdateState(ProgressBar.ProgressBarStates.off);
                    ProgressBar.UpdateState(ProgressBar.ProgressBarStates.success);
                    ClearBlockingRequest(status);
                    break;

                case EdExStates.OnError:
                    // deserialize and add json details
                    // clear blocking requests
                    ProgressBar.UpdateState(ProgressBar.ProgressBarStates.error);
                    ClearBlockingRequest();
                    Debug.LogError(string.Format("PlayFab EditorExtensions: Caught an error:{0}", status));
                    break;

                case EdExStates.OnWarning:
                    ProgressBar.UpdateState(ProgressBar.ProgressBarStates.warning);
                    ClearBlockingRequest();
                    Debug.LogWarning(string.Format("PlayFab EditorExtensions: {0}", status));
                    break;

                case EdExStates.OnSuccess:
                    ClearBlockingRequest();
                    ProgressBar.UpdateState(ProgressBar.ProgressBarStates.success);
                    break;
            }
        }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

We have tested importing the PlayFab Editor Extensions, PlayFab SDK 2.80.200121 to Unity 2019.2.9f1. We can’t reproduce this issue, the PlayFab EditorExtensions work fine. And the 403 error is an access forbidden error, meaning that the client is being rejected from making the call to the endpoint in questions. Since there's nothing in our service that would return that, it would have to be somewhere between the client and PlayFab - most likely their ISP. You can try to get a network capture for more info.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

It looks like the error randomly appears. Sometimes it gives me that error message, sometimes it doesn't.

The interesting part is when the error appears, it doesn't affect anything. I tried to login and did some API calls and everything worked.

0 Likes 0 ·
Dale Strickler avatar image Dale Strickler commented ·

I am getting a very closely related error:

PlayFab EditorExtensions: Caught an error:SharedErrorCallbackHTTP/1.1 404 Not Found

I am also noticing that two of the changes in a recent update to the editor extension are changes in URLs:

- Application.OpenURL("https://docs.microsoft.com/en-us/gaming/playfab/release-notes/");
+ Application.OpenURL("https://api.playfab.com/releaseNotes/");

and:

- PlayFabEditorHttp.MakeDownloadCall("https://aka.ms/PlayFabUnitySdk", (fileName) =>
+ PlayFabEditorHttp.MakeDownloadCall("https://api.playfab.com/sdks/download/unity-via-edex", (fileName) =>

Though the debug tacking is not very clear it seems like there could be an issue that some of the PlayFab servers URLs are not correctly exposed. I believe this has been completely dismissed and that more research is needed. Looking at the GIT repo of the Unity PlayFab Editor extension issues with server settings and URLs is a very good possibility of why we are seeing errors. These do error seem to relate to PlayFab URLs. not our (customer) URLs

0 Likes 0 ·
Dale Strickler avatar image Dale Strickler commented ·

Note the full console debug information never mentions any code that we created. Only code in the PlayFab Editor Extension:

PlayFab EditorExtensions: Caught an error:SharedErrorCallbackHTTP/1.1 404 Not Found
UnityEngine.Debug:LogError(Object)
PlayFab.PfEditor.PlayFabEditor:StateUpdateHandler(EdExStates, String, String) (at Assets/PlayFabEditorExtensions/Editor/PlayFabEditor.cs:332)
PlayFab.PfEditor.PlayFabEditor:RaiseStateUpdate(EdExStates, String, String) (at Assets/PlayFabEditorExtensions/Editor/PlayFabEditor.cs:247)
PlayFab.PfEditor.PlayFabEditorHelper:SharedErrorCallback(String) (at Assets/PlayFabEditorExtensions/Editor/Scripts/Utils/PlayFabEditorHelper.cs:133)
PlayFab.PfEditor.<Post>d__7:MoveNext() (at Assets/PlayFabEditorExtensions/Editor/Scripts/PlayFabEditorSDK/PlayFabEditorHttp.cs:177)
PlayFab.PfEditor.EditorCoroutine:Update() (at Assets/PlayFabEditorExtensions/Editor/Scripts/Utils/EditorCoroutine.cs:103)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:332)


0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.