1+ ---
2+ layout: dl-page
3+ permalink: /devlog/gamelift/faq/
4+ title: FAQs for GameLift, AWS, and Unity
5+ desc: A collection of GameLift, AWS, and Unity FAQs and troubleshooting
6+
7+ ---
8+ <!-- TODO: consider making a search bar and also links in a side bar? -->
9+ < div class ="container ">
10+ < div class ="row ">
11+ < div class ="col-12 ">
12+ < p class ="mt-4 "> < a href ="/devlog/ "> < i class ="fa fa-chevron-left mb-1 "> </ i > Back to Dev Log</ a > </ p >
13+ < ul class ="list-unstyled mt-6 ">
14+ < li >
15+ < h2 class ="mb-2 text-primary "> HttpErrorResponseException: Thrown from an AWS Lambda call</ h2 >
16+
17+ < p > This is a general exception that I see quite a bit as it can be thrown from
18+ various AWS API calls. But for this one, I'll be focusing an example exception
19+ that's thrown when calling out to a Lambda function from your Unity project. As
20+ in the case when you're trying to connect to the Realtime GameLift server. It may
21+ look something like this: < br />
22+
23+ < small > < pre > < code >
24+ HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
25+ Amazon.Runtime.HttpWebRequestMessage+< GetResponseAsync > d__20.MoveNext ()
26+ --- End of stack trace from previous location where exception was thrown ---
27+ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
28+ System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task)
29+ System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task)
30+ System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task)
31+ System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult ()
32+ Amazon.Runtime.Internal.HttpHandler`1+< InvokeAsync > d__9`1[TRequestContent,T].MoveNext ()
33+ --- End of stack trace from previous location where exception was thrown ---
34+ ...
35+ </ code > </ pre > </ small >
36+ </ p >
37+
38+ < p > When you click on the error you'll see a much larger stack trace that just seems
39+ to repeat. However, if you look carefully, you'll see the real cause: the call
40+ you made from your Unity project to the Lambda function was denied.
41+ < img class ="mt-3 card-img-top img-fluid " src ="/assets/img/find-error-in-st.jpg "
42+ alt ="AmazonLambdaException ">
43+ </ p >
44+ < h4 > Resolution</ h4 >
45+ < ul >
46+ < li > Usually that means there's something wrong with the permissions set in the
47+ role:
48+ < ul >
49+ < li > Make sure you have the correct Actions and Resource.</ li >
50+ < li > Make sure the Lambda function name is the one you're trying to access.</ li >
51+ < li > Double check the region.</ li >
52+ </ ul >
53+ < img class ="mt-3 card-img-top img-fluid " src ="/assets/img/httpErrorResponseException-resolution.jpg "
54+ alt ="AmazonLambdaException ">
55+ </ li >
56+
57+ < li > If the role looks good, make sure that it's attached to the correct identity
58+ Pool.</ li >
59+ < li > Check your Cognito Identity Pool configurations (select the pool, hit edit in
60+ top right) and verify the
61+ < strong > Unauthenticated role</ strong > is set to the correct one.</ li >
62+ < li > < em > If you find something else that worked, please let me know and I'll add it!</ em > </ li >
63+ </ ul >
64+ </ li >
65+ </ ul >
66+
67+ </ div >
68+ </ div >
69+ </ div >
0 commit comments