0
最終的にAPIをAWS Lambdaにアップロードできる状態になったので、APIゲートウェイを使用してテストするたびにエラーが表示されます。APIGatewayProxyFunctionのヌル参照例外
{
"errorType": "AggregateException",
"errorMessage": "One or more errors occurred. (Object reference not set to an instance of an object.)",
"stackTrace": [
"at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)",
"at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)",
"at lambda_method(Closure , Stream , Stream , ContextInfo)"
],
"cause": {
"errorType": "NullReferenceException",
"errorMessage": "Object reference not set to an instance of an object.",
"stackTrace": [
"at Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction.MarshallRequest(InvokeFeatures features, APIGatewayProxyRequest apiGatewayRequest)",
"at Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction.<FunctionHandlerAsync>d__12.MoveNext()"
]
}
}
コード:
public class LambdaEntryPoint :
Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction
{
protected override void Init(IWebHostBuilder builder)
{
try
{
builder
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.UseApiGateway();
}
catch (Exception ex)
{
LambdaLogger.Log("Exception throw in LambdaEntryPoint: " + ex);
}
}
}
私は、スタートアップやLambdaEntryPointから記録された例外を得ることはありません。私はAWSが本当に新しいので、他に何を調べるべきかわかりません。
これに関するアイデアですか?
はい、私もそのバグをオープンしました。それは、AWS側のものとコード関連のもののようですが、私はまだそれを分離することができませんでした。 –