-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: runtime error: invalid memory address or nil pointer dereference #227
Comments
get this issue too for whenever I have an Update prefix and a string id = 1 and other types on the Request |
Same here |
I solved this issue by modifying plugin.go, in line 2811 added several nil checks |
Thanks for sharing @nonaxanon ! Any chances these changes can be introduced in here? |
This is not a good resolution. Doc: Request messages for Create and Update methods should have an Ormable Type in a field named payload If not the basic Update, should not name UpdateXXX |
why it requires you to add payload field to update when autogen is not specified? |
Is this is for Update prefixed APIs? I have create a project (https://github.com/C0rWin/buf-gorm-demo/blob/main/protos/entity.proto) to demonstrate the behavour which leads to the panic and to be honest I am not clear what is the root cause leading to the panic. PS. Noted that most comments are almost one year old while still facing this issue, hence wondering whenever it was addressed? Or this is an expected and I'm just doing something wrong? |
still facing this issue... |
I solved this by change every messages named "Update". |
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1315fce]
goroutine 1 [running]:
github.com/infobloxopen/protoc-gen-gorm/plugin.(*ORMBuilder).followsUpdateConventions(0xc0000671a0, 0xc000828ea0, 0xc000828ea0, {0x13bb7c7, 0x6})
/Users/anguodong/go/pkg/mod/github.com/infobloxopen/[email protected]/plugin/plugin.go:2814 +0x20e
github.com/infobloxopen/protoc-gen-gorm/plugin.(*ORMBuilder).parseServices(0xc0000671a0, 0xc0001be100)
/Users/anguodong/go/pkg/mod/github.com/infobloxopen/[email protected]/plugin/plugin.go:2641 +0x54e
github.com/infobloxopen/protoc-gen-gorm/plugin.(*ORMBuilder).Generate(0xc0000671a0)
/Users/anguodong/go/pkg/mod/github.com/infobloxopen/[email protected]/plugin/plugin.go:282 +0x251
main.main()
/Users/anguodong/go/pkg/mod/github.com/infobloxopen/[email protected]/main.go:33 +0xb0
--gorm_out: protoc-gen-gorm: Plugin failed with status code 2.
make: *** [api] Error 1
The text was updated successfully, but these errors were encountered: