is09-souzou / AppSync-Resolver-Mapping-Lambda

AWS Lambda
0 stars 0 forks source link

Cannot Create User: runtime error: invalid memory address or nil pointer dereference #11

Closed NozomiSugiyama closed 6 years ago

NozomiSugiyama commented 6 years ago

Cannot Create User: runtime error: invalid memory address or nil pointer dereference

Overview

Emailを空にした状態でcreateUser mutationを送信した際にエラーが発生する.

ポインタのエラーがありそう.

https://github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/pull/10 の修正にて発生したエラーだと思う.

NozomiSugiyama commented 6 years ago

Cloud Watch上のエラー

runtime error: invalid memory address or nil pointer dereference: errorString
[
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/vendor/github.com/aws/aws-lambda-go/lambda/function.go",
    "line": 27,
    "label": "(*Function).Invoke.func1"
}
,
{
    "path": "runtime/asm_amd64.s",
    "line": 573,
    "label": "call32"
}
,
{
    "path": "runtime/panic.go",
    "line": 502,
    "label": "gopanic"
}
,
{
    "path": "runtime/panic.go",
    "line": 63,
    "label": "panicmem"
}
,
{
    "path": "runtime/signal_unix.go",
    "line": 388,
    "label": "sigpanic"
}
,
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/src/model/user.go",
    "line": 27,
    "label": "CreateUser"
}
,
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/src/handlers/user/createUser.go",
    "line": 19,
    "label": "CreateUserHandle"
}
,
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/src/router/router.go",
    "line": 18,
    "label": "Router"
}
,
{
    "path": "runtime/asm_amd64.s",
    "line": 576,
    "label": "call256"
}
,
{
    "path": "reflect/value.go",
    "line": 447,
    "label": "Value.call"
}
,
{
    "path": "reflect/value.go",
    "line": 308,
    "label": "Value.Call"
}
,
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/vendor/github.com/aws/aws-lambda-go/lambda/handler.go",
    "line": 111,
    "label": "newHandler.func1"
}
,
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/vendor/github.com/aws/aws-lambda-go/lambda/handler.go",
    "line": 22,
    "label": "lambdaHandler.Invoke"
}
,
{
    "path": "github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/vendor/github.com/aws/aws-lambda-go/lambda/function.go",
    "line": 59,
    "label": "(*Function).Invoke"
}
,
{
    "path": "runtime/asm_amd64.s",
    "line": 574,
    "label": "call64"
}
,
{
    "path": "reflect/value.go",
    "line": 447,
    "label": "Value.call"
}
,
{
    "path": "reflect/value.go",
    "line": 308,
    "label": "Value.Call"
}
,
{
    "path": "net/rpc/server.go",
    "line": 384,
    "label": "(*service).call"
}
,
{
    "path": "runtime/asm_amd64.s",
    "line": 2361,
    "label": "goexit"
}
]
NozomiSugiyama commented 6 years ago

https://github.com/is09-souzou/AppSync-Resolver-Mapping-Lambda/pull/12 deploy、動作確認終了.