fullstorydev / grpcui

An interactive web UI for gRPC, along the lines of postman
MIT License
5.15k stars 383 forks source link

Runtime error: invalid memory address or nil pointer dereference #271

Closed dmumladze closed 10 months ago

dmumladze commented 11 months ago

Any reason I should be getting this error? I have the latest Go and grpcui, but getting this weird error. There are no local imports in my proto and btw, I can connect and use Postman without any issues.

grpcui -vvv -plaintext -proto ./grpc/Model.proto localhost:8009

2023/10/04 16:38:40 INFO: [core] [Channel #1] Channel created
2023/10/04 16:38:40 INFO: [core] [Channel #1] original dial target is: "localhost:8009"
2023/10/04 16:38:40 INFO: [core] [Channel #1] parsed dial target is: {URL:{Scheme:localhost:8009 Opaque:8009 User: Host: Path: RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/10/04 16:38:40 INFO: [core] [Channel #1] fallback to scheme "passthrough"
2023/10/04 16:38:40 INFO: [core] [Channel #1] parsed dial target is: {URL:{Scheme:passthrough Opaque: User: Host: Path:/localhost:8009 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/10/04 16:38:40 INFO: [core] [Channel #1] Channel authority set to "localhost:8009"
2023/10/04 16:38:40 INFO: [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "localhost:8009",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Type": 0,
      "Metadata": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2023/10/04 16:38:40 INFO: [core] [Channel #1] Channel switches to new LB policy "pick_first"
2023/10/04 16:38:40 INFO: [core] [Channel #1 SubChannel #2] Subchannel created
2023/10/04 16:38:40 INFO: [core] [Channel #1] Channel Connectivity change to CONNECTING
2023/10/04 16:38:40 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2023/10/04 16:38:40 INFO: [core] [Channel #1 SubChannel #2] Subchannel picks a new address "localhost:8009" to connect
2023/10/04 16:38:40 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc0000095f0, {CONNECTING <nil>}
2023/10/04 16:38:40 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2023/10/04 16:38:40 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc0000095f0, {READY <nil>}
2023/10/04 16:38:40 INFO: [core] [Channel #1] Channel Connectivity change to READY
**panic: runtime error: invalid memory address or nil pointer dereference**
[signal 0xc0000005 code=0x0 addr=0x28 pc=0xe73042]

goroutine 1 [running]:
github.com/jhump/protoreflect/desc/protoparse.parseToProtoRecursive({0x1a98080, 0xc00010c0d8}, {0xc000120080, 0x1e}, 0xc0001bd568?, 0xdbc186?, 0x0?)
        C:/go/pkg/mod/github.com/jhump/protoreflect@v1.15.2/desc/protoparse/parser.go:389 +0x1a2
github.com/jhump/protoreflect/desc/protoparse.parseToProtoRecursive.func1(0xc00011a0c0, 0xc000172230, 0xc000152190, {0x1a98080, 0xc00010c0d8}, 0x16d7860?, 0xc0001bd701?)
        C:/go/pkg/mod/github.com/jhump/protoreflect@v1.15.2/desc/protoparse/parser.go:401 +0x207
github.com/jhump/protoreflect/desc/protoparse.parseToProtoRecursive({0x1a98080, 0xc00010c0d8}, {0xc00004e360, 0x23}, 0xc0000a4800?, 0xc000124040?, 0x0?)
        C:/go/pkg/mod/github.com/jhump/protoreflect@v1.15.2/desc/protoparse/parser.go:402 +0x23e
github.com/jhump/protoreflect/desc/protoparse.parseToProtosRecursive({0x1a98080, 0xc00010c0d8}, {0xc000316480, 0x1, 0x0?}, 0x0?, 0x0?)
        C:/go/pkg/mod/github.com/jhump/protoreflect@v1.15.2/desc/protoparse/parser.go:365 +0x8b
github.com/jhump/protoreflect/desc/protoparse.Parser.ParseFiles({{0x0, 0x0, 0x0}, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, ...}, ...)
        C:/go/pkg/mod/github.com/jhump/protoreflect@v1.15.2/desc/protoparse/parser.go:153 +0x1a8
github.com/fullstorydev/grpcurl.DescriptorSourceFromProtoFiles({0x0, 0x0, 0x0}, {0xc000316480?, 0xc000319260?, 0x1719c94?})
        C:/go/pkg/mod/github.com/fullstorydev/grpcurl@v1.8.8/desc_source.go:71 +0xd8
main.main()
        C:/go/pkg/mod/github.com/fullstorydev/grpcui@v1.3.2/cmd/grpcui/grpcui.go:557 +0x1388
jhump commented 11 months ago

Dang. Looks like the same thing as https://github.com/fullstorydev/grpcurl/issues/414 (and https://github.com/jhump/protoreflect/issues/572). Sorry for the breakage, my bad.

There's a fixed release of protoreflect (v1.15.3), so this repo needs the same fix that was already made in grpcurl.

dragonsinth commented 11 months ago

@dependabot halp

dragonsinth commented 11 months ago

https://github.com/fullstorydev/grpcui/pull/272

gpassini commented 10 months ago

This is fixed in https://github.com/fullstorydev/grpcui/pull/272, and released in https://github.com/fullstorydev/grpcui/releases/tag/v1.3.3. Closing this issue.