question

fiveampsoftware avatar image
fiveampsoftware asked

Unable to call Send Account Recovery from Unity SDK

When trying to send account recovery email from the site using "try it" https://api.playfab.com/documentation/client/method/SendAccountRecoveryEmail works

BUT using the Unity SDK PlayFab call SendAccountRecoveryEmail from the client with a SendAccountRecoveryEmailRequest fails with a Internal Server 500

Is there a way to workaround this issue? Or am I not using the proper parameters in code, the code looks like this:

SendAccountRecoveryEmailRequestrequest=newSendAccountRecoveryEmailRequest()
{
Email =ForgotEmail.text,
TitleId =PlayFabSettings.TitleId,
};

PlayFabClientAPI.SendAccountRecoveryEmail(
request,
(SendAccountRecoveryEmailResultresult)=>
{
//Success here
},
(PlayFabErrore)=>
{
//Error here
}
);

something stranger as well but if I call RegisterPlayFabUser with an email from the client and then go to the "try it" site of the SendAccountRecoveryEmail, it says account not found

-Kevin

sdksAuthentication
10 |1200

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

fiveampsoftware avatar image
fiveampsoftware answered

Okay! Looks like I solved it - not a playfab issue but would be nice if it could handle the error more gracefully.

TextMeshPro can include a hidden character on some components, I had to use EmailInput.text.Trim() to fix it.

More info: https://forum.unity.com/threads/textmesh-pro-ugui-hidden-characters.505493/

10 |1200

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

brendan avatar image
brendan answered

Can you send us the full details of the response containing the 500 error? In particular, we need the Request ID, so that we can find this in the logs.

10 |1200

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

fiveampsoftware avatar image
fiveampsoftware answered

@Brendan

Would this be in ErrorDetails? It's null when it comes back. When I do e.GenerateErrorReport(), I get the following:

Error Report: /Client/SendAccountRecoveryEmail: 500 Internal Server Error

This is the code I use for the error logging:

PlayFabClientAPI.SendAccountRecoveryEmail(
	request,
	(SendAccountRecoveryEmailResult result) =>
	{
		Debug.Log("SUCCESS");
		OnForgotPasswordSuccess.Invoke();
	},
	(PlayFabError e) =>
	{
		Debug.Log("Error: " + e.ErrorMessage) ;
		Debug.Log("Error Report: " + e.GenerateErrorReport());
		if (e.ErrorDetails != null)
		{
			foreach (KeyValuePair<string, List<string>> s in e.ErrorDetails)
			{
				Debug.Log("Error Key: "+ s.Key);
				foreach (string stringConten in s.Value)
				{
				Debug.Log("Error Content: " + stringConten);
				}
			}
		}
		OnForgotPasswordError.Invoke();
	}
);

I created a player (using one of my email addresses): 50A4768573C9138F, of title ID 5D5E, that was created using the Unity SDK - RegisterPlayFabUser.

When I go to that player account and click send account recovery email from Game Manager, I get the following at the top of the page: Unable to reset password: Domain contains control or whitespace - not sure if that has anything to do with the error.

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.

fiveampsoftware avatar image fiveampsoftware commented ·

Okay used a packet sniffer and was able to get it:

"code": 500,
"status": "InternalServerError",
"error": "InternalServerError",
"errorCode": 1110,
"errorMessage": "An unexpected error occured while processing the request.",
"errorHash": "d7acf222bdaeef059ad91938d9666d37",
"errorDetails": {
"RequestID": ["29586380d8ce467cb3d934a68367a354"]
}
0 Likes 0 ·
brendan avatar image brendan commented ·

(Edit: Not sure why your post didn't show up 'till after mine, but thanks for providing the info!)

No, what I was looking for was the actual body of the response package - if you log the full PlayFabError that comes back, it's there.

In this case though, I was able to find the error in the logs. We got an unexpected error back from AWS - AmazonSimpleEmailServiceException, with the detail "Domain contains control or whitespace". I won't post the email address you had in your call here, but I made the same call (I didn't copy/paste the email address, but re-typed it, to be safe), and it worked fine. I didn't see any spaces in your call, so I suspect it was a control character in the string, somewhere.

0 Likes 0 ·
fiveampsoftware avatar image fiveampsoftware brendan commented ·

Trying to see if there's a hidden character being inserted from TextMeshPro or something. It looks like I got rate limited too :/

Error: The client has exceeded the maximum API request rate and is being throttled
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.