Failed Creating room when using PlayFab

YanYan
I'm using PlayFab and Photon together and everything worked fine yesterday. I just suddenly can't create room today. I have logged in with PlayFab and PUN, but I get the error when creating a room:

[Photon]Failed created room. [32752] Failed to create game on https://mytitleid.playfablogic.com/webhook/1/prod/3DS36XKQCF7FD378R3SRXBDTNCT6GYNGCOGPW67E9FJCZK9UX6/RoomCreated? : Unexpected character encountered while parsing value: . Path '', line 0, position 0.

Does any know what this means and how I can fix it?

Comments

  • JohnTubeJohnTube mod
    edited January 11
    Hi @Yan,

    Thank you for choosing Photon!

    It looks like you are returning the expected JSON format for the PathCreate webhook from RoomCreated CloudScript handler.
    You could simply use
    return { "ResultCode": 0}
    
    or
    return { "ResultCode": 0, "Message": "OK"}
    
    or
    return { "ResultCode": 0, "State": "", Message: "OK"}
    

    It's a bit unusual as I thought PlayFab automatically returns default success response if you don't explicitly return anything.
  • doug_hdoug_h
    edited January 11
    Same issue here but fixed with your suggestion @JohnTube - thanks.

    OK, I spoke to soon - after trying those 3 return codes in my RoomCreated PlayFab handler it still gives the same error. The only way I could get it to go away was to remove the webhook from the Photon Dashboard (I guess this takes a few minutes to propagate to Photon servers which made me think it was fixed whilst changing CloudScript).

    As a test I removed all code from the RoomCreated handler in PlayFab except the return codes but no change.
  • JohnTube wrote: »
    Hi @Yan,

    Thank you for choosing Photon!

    It looks like you are returning the expected JSON format for the PathCreate webhook from RoomCreated CloudScript handler.
    You could simply use
    return { "ResultCode": 0}
    
    or
    return { "ResultCode": 0, "Message": "OK"}
    
    or
    return { "ResultCode": 0, "State": "", Message: "OK"}
    

    It's a bit unusual as I thought PlayFab automatically returns default success response if you don't explicitly return anything.

    Hi, thanks for quick reaction. I changed the RoomCreated CloudScript in PlayFab like:

    // Triggered automatically when a Photon room is first created
    handlers.RoomCreated = function (args) {
    //log.debug("Room Created - Game: " + args.GameId + " MaxPlayers: " + args.CreateOptions.MaxPlayers);
    return { "ResultCode": 0, "Message": "OK"}
    };

    The problem still exists. Is my CloudScript wrong here?
  • doug_h wrote: »
    Same issue here but fixed with your suggestion @JohnTube - thanks.

    OK, I spoke to soon - after trying those 3 return codes in my RoomCreated PlayFab handler it still gives the same error. The only way I could get it to go away was to remove the webhook from the Photon Dashboard (I guess this takes a few minutes to propagate to Photon servers which made me think it was fixed whilst changing CloudScript).

    As a test I removed all code from the RoomCreated handler in PlayFab except the return codes but no change.

    Hi, I also tried removing RoomCreated and RoomJoined webhook in Photon Dashboard but it still exists. Could you tell me how you fixed this? After you removed the webhook, you could create room?
  • JohnTube wrote: »
    Hi @Yan,

    Thank you for choosing Photon!

    It looks like you are returning the expected JSON format for the PathCreate webhook from RoomCreated CloudScript handler.
    You could simply use
    return { "ResultCode": 0}
    
    or
    return { "ResultCode": 0, "Message": "OK"}
    
    or
    return { "ResultCode": 0, "State": "", Message: "OK"}
    

    It's a bit unusual as I thought PlayFab automatically returns default success response if you don't explicitly return anything.

    Okay guys I tried the three methods again and all of them worked. I noticed that "Message" in method 2 and Message in method 3 are different, although both of them work. If you can't make it work after changing CloudScript, try to set the Webhook in Photon Dashboard again following the document here.

    Thank you all!
  • JohnTube wrote: »
    Hi @Yan,

    Thank you for choosing Photon!

    It looks like you are returning the expected JSON format for the PathCreate webhook from RoomCreated CloudScript handler.
    You could simply use
    return { "ResultCode": 0}
    
    or
    return { "ResultCode": 0, "Message": "OK"}
    
    or
    return { "ResultCode": 0, "State": "", Message: "OK"}
    

    It's a bit unusual as I thought PlayFab automatically returns default success response if you don't explicitly return anything.

    Hi, I'm also having this trouble. Even after trying JohnTube solutions and resetting the webhook it's still not fixed
  • I also have same problem.
    PlayFab static IP addresses updated on 11th Jan. Maybe it is something related to this.

  • FrasloFraslo
    edited January 12
    Same issue here, everything was running fine for a few months. Since yesterday no rooms can be created/re-created, no updates being done to client & server since 1 month.

    No rooms can be created they all return:
    Failed to load state from https://XXXX.playfablogic.com/webhook/1/prod/XXXX/RoomCreated? : Unexpected character encountered while parsing value: . Path '', line 0, position 0.
    

    I return the data from the Playfab webhook like this (Actual response data for one of the rooms which worked fine till +-14 hours ago):
    {
    	"ResultCode": 0,
    	"State": {
    		"ActorCounter": 0,
    		"ActorList": [],
    		"Binary": {
    			"18": "RAAAAAVi+nkAAHNzAAF0eAAAAHuDAAAAH4sIAAAAAAAAA6tWKlOyMtZRylSyiq4GkUYWpmY6SolKVoY6SgVKVrpAqljJSsnE0NHUzcjMyczI1dnY1NJISUcpDyisVKsD1WVgjEWXo4mpuaWbuYmjiaGRoZOJOVRXflFJanppZk5OolJtbC0ArtPRlIMAAABzAAFteAAAACYOAAAAH4sIAAAAAAAAA6tWKlOyMtZRylWyio6tBQB1O2r9DgAAAHMAAWN4AAAAqmwBAAAfiwgAAAAAAAADdY87EsIwDETvsrUKJBs7+CoMBb+hoAOGJuO7o2xiEmBo/Nl90ko9nihBcEBRwQ0lCc7+TrqK2bqNi0eUbY8Hijl3QVkL9jzdAAQn/1QhodYIek1NVI11ft6ZNVfbxJmSU3L6y+nAORACieGazRBa2hg2drHPIG1JkVD+v0nXRlkMMVkee30P+7VqphjZNy77xrqrL1jj26tsAQAAcwABcHgAAAAmDgAAAB+LCAAAAAAAAAOrVipTsjLWUSpQsoqOrQUAMCoiQg4AAAA="
    		},
    		"CheckUserOnJoin": true,
    		"LobbyProperties": [
    			"c",
    			"m"
    		],
    		"DeleteCacheOnLeave": true,
    		"EmptyRoomTTL": 0,
    		"IsOpen": true,
    		"IsVisible": false,
    		"LobbyType": 0,
    		"MaxPlayers": 15,
    		"PlayerTTL": -1,
    		"SuppressRoomEvents": false,
    		"Slice": 0,
    		"ExcludedActors": [],
    		"PublishUserId": false,
    		"ExpectedUsers": [],
    		"RoomFlags": 35
    	}
    }
    
  • FrasloFraslo
    edited January 12
    I tried to return the most basic response like proposed above:
    handlers.RoomCreated = function (args) {
            return { ResultCode : 0 }
    }
    

    But it returns the same error, so it's most likely not a problem with the structure in my previous post.
    I also tried to change the config to update the RoomCreated path to a different cloudscript function, but it results in the same error.

    I'm really stuck here with my production game being broken, any leads or ideas would be really appreciated. :)
  • So after a bit more playing around, all other webhooks fire - RoomJoined, RoomLeft etc., with no added return code in CloudScript.

    After deleting and re-adding webhook config and trying various things in CloudScript, the only way I can get it working is to remove the RoomCreated webhook.
  • I am facing the same issue. Adding a return code to RoomCreated and resetting webhook config didn't help
  • JohnTubeJohnTube mod
    edited January 12
    everyone facing this please send an email to [email protected] with your AppId, AppVersion and Region used.
    also the exact error(s) you see/get, how to reproduce and when you noticed it first or when it started.
  • Ok thank you JohnTube, I did send an e-mail with the details!
  • UPDATE:

    Sorry you are running into this!

    PlayFab's JSON response has some weird char(s) as prefix.
    Please see attached screenshot.

    This was not there before and while we did not change anything we are willing to better handle it like Postman does.

    But for now you should report this to PlayFab.

    Thank you for your time and patience!

    R1JXoVg.jpeg
  • My colleagues have identified this as BOM (Byte Order Mark).
    I personally encountered the name before and only now I looked it up anyway.

    Something must have changed from PlayFab side.
    So either they can revert for now or try not send BOM 'if possible'.
  • Thank you for checking it out so fast! :) I can forward this finding to PlayFab, unfortunately is my Playfab forum topic about this issue on their site still 'awaiting moderation' after 7 hours, so it will probably be very slow before any dev will pick this one up..

    Would it be possible for you to forward this issue directly to PlayFab? Since it's an issue which is completely Service to Service and out of our control, it's probably also affecting quite some other Photon customers. (And assuming that it will be faster picked up if comes directly from Photon)

    Or anyone with a PlayFab premium/enterprise account might have better luck at PlayFab..
  • Hi @Fraslo,

    Thank you for choosing Photon!

    Of course we did reach out to PlayFab.
    And we are working on a update from our end that will support this.
  • Hi @Hiber, @doug_h, @vivek2691,

    Thank you for choosing Photon!

    Notifying you in case you missed the updates.
  • JohnTube wrote: »
    UPDATE:

    The issue should be resolved now.

    From Photon side: we added a fix and started rolling out to a separate cluster and moved affected apps from customers that reported this there. We will continue rollout of this update slowly now to all servers.
    From PlayFab side: they reverted a CloudScript related change to last week's version and the BOM causing this is gone for now for all applications. They will make sure it won't cause problems when they update again the next time.

    Thank you for your patience and understanding!

    Thank you @JohnTube. All hooks working as expected.
  • Same here, everything is working again. Thank you for your fast solution, great support! :)
  • Thank you all it's all fixed for me too
  • This was driving me nuts the past two days, but I'm glad I finally found this thread last evening and happy to see it fixed after checking again today.
  • We're still having the same issue with our title (Operation 227 failed).

    Shall we wait a little bit longer or contact you to make sure it is indeed in the separate cluster?
  • Hi @tonytony,

    Thank you for choosing Photon!

    Are you sure it's the same issue, if so, send an email to [email protected] and let us know your AppId, AppVersion, Region(s).
    Also the repro steps + actual error message.
    Extra info: client SDK used and its version + PlayFab TitleID.
Sign In or Register to comment.