openconfig / gnmi

gRPC Network Management Interface
Apache License 2.0
464 stars 196 forks source link

Errors are often not displayed correctly #9

Closed wisotzky closed 6 years ago

wisotzky commented 7 years ago

Using latest version of gnmi_cli against my server which is running gnmi v0.3.1. If using wrong username/password I often get the following response:

#  gnmi_cli -a pe1:57400 -with_user_pass -ca_crt CAcert.pem -qt s -dt p -pi 10s -q state/port[port-id=1/1/1]/ethernet/statistics/out-utilization
username: wrong
password: E0919 14:00:31.086602    5194 gnmi_cli.go:186] cli.QueryDisplay:
        sendQueryAndDisplay(ctx, {Addrs:[pe1:57400] Target: Replica:0 Discard:false Queries:[[state port[port-id=1/1/1] ethernet statistics out-utilization]] Type:stream Timeout:30s NotificationHandler:<nil> ProtoHandler:<nil> Credentials:0xc420152460 TLS:0xb78020 Extra:map[]}, &{PollingInterval:10s StreamingDuration:0s Count:0 countExhausted:false Delimiter:/ Display:0x7c6040 DisplayPrefix: DisplayIndent:   DisplayType:p DisplayPeer:false Timestamp: DisplaySize:false Latency:false ClientTypes:[]}):
        client had error while displaying results:
        rpc error: code = Unimplemented desc =

But sometime the error display is correct:

#  gnmi_cli -a pe1:57400 -with_user_pass -ca_crt CAcert.pem -qt s -dt p -pi 10s -q state/port[port-id=1/1/1]/ethernet/statistics/out-utilization
username: wrong
password: E0919 14:00:13.705036    5187 gnmi_cli.go:186] cli.QueryDisplay:
        sendQueryAndDisplay(ctx, {Addrs:[pe1:57400] Target: Replica:0 Discard:false Queries:[[state port[port-id=1/1/1] ethernet statistics out-utilization]] Type:stream Timeout:30s NotificationHandler:<nil> ProtoHandler:<nil> Credentials:0xc420152460 TLS:0xb78020 Extra:map[]}, &{PollingInterval:10s StreamingDuration:0s Count:0 countExhausted:false Delimiter:/ Display:0x7c6040 DisplayPrefix: DisplayIndent:   DisplayType:p DisplayPeer:false Timestamp: DisplaySize:false Latency:false ClientTypes:[]}):
        client had error while displaying results:
        rpc error: code = Unauthenticated desc = Invalid username or password

Unclear, why this is. Is there any way to check, if this is a server or client issues. In addition I am confused why getting the message "client had error while displaying results".

gcsl commented 7 years ago

Would you add the following flag to see if this reliably produces the error you expect?

-client_types gnmi

If the above flag is not set, gnmi_cli by default attempts to connect on both the older (deprecated) service in openconfig.proto as well as gnmi.proto and without grpc reflection enabled and checked in the client, it becomes racy. We are considering making gnmi the default soon as part of the continued deprecation of openconfig.proto.

On Tue, Sep 19, 2017 at 5:01 AM, wiso notifications@github.com wrote:

Using latest version of gnmi_cli against my server which is running gnmi v0.3.1. If using wrong username/password I often get the following response:

gnmi_cli -a pe1:57400 -with_user_pass -ca_crt CAcert.pem -qt s -dt p -pi 10s -q state/port[port-id=1/1/1]/ethernet/statistics/out-utilization

username: wrong password: E0919 14:00:31.086602 5194 gnmi_cli.go:186] cli.QueryDisplay: sendQueryAndDisplay(ctx, {Addrs:[pe1:57400] Target: Replica:0 Discard:false Queries:[[state port[port-id=1/1/1] ethernet statistics out-utilization]] Type:stream Timeout:30s NotificationHandler: ProtoHandler: Credentials:0xc420152460 TLS:0xb78020 Extra:map[]}, &{PollingInterval:10s StreamingDuration:0s Count:0 countExhausted:false Delimiter:/ Display:0x7c6040 DisplayPrefix: DisplayIndent: DisplayType:p DisplayPeer:false Timestamp: DisplaySize:false Latency:false ClientTypes:[]}): client had error while displaying results: rpc error: code = Unimplemented desc =

But sometime the error display is correct:

gnmi_cli -a pe1:57400 -with_user_pass -ca_crt CAcert.pem -qt s -dt p -pi 10s -q state/port[port-id=1/1/1]/ethernet/statistics/out-utilization

username: wrong password: E0919 14:00:13.705036 5187 gnmi_cli.go:186] cli.QueryDisplay: sendQueryAndDisplay(ctx, {Addrs:[pe1:57400] Target: Replica:0 Discard:false Queries:[[state port[port-id=1/1/1] ethernet statistics out-utilization]] Type:stream Timeout:30s NotificationHandler: ProtoHandler: Credentials:0xc420152460 TLS:0xb78020 Extra:map[]}, &{PollingInterval:10s StreamingDuration:0s Count:0 countExhausted:false Delimiter:/ Display:0x7c6040 DisplayPrefix: DisplayIndent: DisplayType:p DisplayPeer:false Timestamp: DisplaySize:false Latency:false ClientTypes:[]}): client had error while displaying results: rpc error: code = Unauthenticated desc = Invalid username or password

Unclear, why this is. Is there any way to check, if this is a server or client issues?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openconfig/gnmi/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/ARfIL_IqG5exbpv6nib9KGIPB8wPNHwVks5sj60sgaJpZM4PcSKn .

awly commented 6 years ago

https://github.com/openconfig/gnmi/commit/c50dc0ef9aa3ad6dfdd07b4f33f5cdcff2bb2bc8 should fix this. Feel free to re-open if you still see this behavior on HEAD