onosproject / onos-config

Configuration subsystem for ONOS (µONOS Architecture)
45 stars 56 forks source link

Cannot connect to stratum devices (mininet version) using gnmi_cli via onos-config NB #1068

Closed adibrastegarnia closed 4 years ago

adibrastegarnia commented 4 years ago

Describe the bug Cannot connect to stratum devices (mininet version) using gnmi_cli.

I0130 20:19:50.249054   32304 device_cli.go:177] Get Operation
I0130 20:19:50.249632   32304 device_cli.go:247] Without TLS
E0130 20:19:55.250892   32304 device_cli.go:183] could not create a gNMI client: Dialer(onos-config:5150, 5s): context deadline exceeded

To Reproduce Steps to reproduce the behavior: 1- onit create cluster --set onos-cli.enabled=true 2- onit add network -n network-1 --topo linear --devices 2 3- Try to run a gnmi_cli (use modified version in the opennetworking lab organization) command:

 gnmi_cli -address onos-config:5150 -get \
    -proto "path: <target: 'network-1-0, 'elem: <name:'interfaces'>>" \
    -encodingType "PROTO" \
    -tlsDisabled \
    -timeout 5s -alsologtostderr \
    -client_crt $ONOS_SIMULATORS_ROOT/pkg/certs/client1.crt \
    -client_key $ONOS_SIMULATORS_ROOT/pkg/certs/client1.key \
    -ca_crt $ONOS_SIMULATORS_ROOT/pkg/certs/onfca.crt

Expected behavior

Logs, text or screenshots


onit exec -- onos topo get devices
ID            ADDRESS             VERSION   STATE
network-1-0   network-1-0:28000   1.0.0     GNMI: {Connectivity: REACHABLE, Channel: CONNECTED, Service: AVAILABLE}
network-1-1   network-1-1:28000   1.0.0     GNMI: {Connectivity: REACHABLE, Channel: CONNECTED, Service: AVAILABLE}

{"level":"info","ts":1580444910.9687023,"logger":"southbound.synchronizer","caller":"synchronizer/factory.go:208","msg":"Connecting to device id:\"network-1-0\" revision:38 address:\"network-1-0:28000\" version:\"1.0.0\" timeout:<seconds:5 > credentials:<> tls:<plain:true > type:\"Stratum\" "}
{"level":"info","ts":1580444910.9687724,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:77","msg":"Connecting to network-1-0:28000 over gNMI for network-1-0"}
{"level":"info","ts":1580444910.9718547,"logger":"southbound","caller":"southbound/clientManager.go:51","msg":"Plain connection connection to network-1-0:28000"}
{"level":"info","ts":1580444910.979476,"logger":"controller.change.network","caller":"network/watcher.go:148","msg":"Updating watch for device network-1-0:1.0.0"}
{"level":"info","ts":1580444910.9904625,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:85","msg":"network-1-0:28000 connected over gNMI"}
{"level":"info","ts":1580444910.99325,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:105","msg":"network-1-0:28000 Encoding:PROTO Capabilities "}
{"level":"info","ts":1580444910.9933112,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:107","msg":"Getting initial configuration for device network-1-0 with type Stratum and version 1.0.0"}
{"level":"info","ts":1580444911.0040212,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:123","msg":"No pre-existing configuration for network-1-0"}
{"level":"info","ts":1580444911.0044258,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:190","msg":"Syncing Op & State of network-1-0 started. Mode 3"}
{"level":"info","ts":1580444911.0045457,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:204","msg":"Getting state by 1 ReadOnly paths for network-1-0"}
{"level":"info","ts":1580444911.0086987,"logger":"southbound.synchronizer","caller":"synchronizer/factory.go:129","msg":"Received event network-1-0 EventTypeDeviceConnected 2020-01-31T04:28:31Z {{ <nil> }}"}
{"level":"info","ts":1580444911.0087702,"logger":"manager","caller":"manager/devicehandler.go:25","msg":"Device network-1-0 connected"}
{"level":"info","ts":1580444911.0104043,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:247","msg":"Calling Get again for network-1-0 with expanded 1 wildcard read-only paths"}
{"level":"info","ts":1580444911.020343,"logger":"controller.change.network","caller":"network/watcher.go:148","msg":"Updating watch for device network-1-1:1.0.0"}
{"level":"info","ts":1580444911.02089,"logger":"southbound.synchronizer","caller":"synchronizer/factory.go:60","msg":"Topo device network-1-1 ADDED"}
{"level":"info","ts":1580444911.0227199,"logger":"controller.change.network","caller":"network/watcher.go:148","msg":"Updating watch for device network-1-0:1.0.0"}
{"level":"info","ts":1580444911.0209923,"logger":"manager","caller":"manager/devicehandler.go:68","msg":"Device network-1-0 is updated with states REACHABLE, CONNECTED, AVAILABLE"}
{"level":"info","ts":1580444911.0220044,"logger":"southbound.synchronizer","caller":"synchronizer/factory.go:208","msg":"Connecting to device id:\"network-1-1\" revision:40 address:\"network-1-1:28000\" version:\"1.0.0\" timeout:<seconds:5 > credentials:<> tls:<plain:true > type:\"Stratum\" "}
{"level":"info","ts":1580444911.0269697,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:77","msg":"Connecting to network-1-1:28000 over gNMI for network-1-1"}
{"level":"info","ts":1580444911.0280995,"logger":"southbound","caller":"southbound/clientManager.go:51","msg":"Plain connection connection to network-1-1:28000"}
{"level":"info","ts":1580444911.036619,"logger":"controller.change.network","caller":"network/watcher.go:176","msg":"Watching device network-1-0:1.0.0"}
{"level":"info","ts":1580444911.0463269,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:85","msg":"network-1-1:28000 connected over gNMI"}
{"level":"info","ts":1580444911.0465822,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:362","msg":"Handling 84 received OpState paths. network-1-0"}
{"level":"info","ts":1580444911.0499964,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:432","msg":"Subscribing to 42 paths. network-1-0"}
{"level":"info","ts":1580444911.0522575,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:105","msg":"network-1-1:28000 Encoding:PROTO Capabilities "}
{"level":"info","ts":1580444911.0599906,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:107","msg":"Getting initial configuration for device network-1-1 with type Stratum and version 1.0.0"}
{"level":"info","ts":1580444911.0718555,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:123","msg":"No pre-existing configuration for network-1-1"}
{"level":"info","ts":1580444911.0719736,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:190","msg":"Syncing Op & State of network-1-1 started. Mode 3"}
{"level":"info","ts":1580444911.072002,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:204","msg":"Getting state by 1 ReadOnly paths for network-1-1"}
{"level":"info","ts":1580444911.0724258,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:247","msg":"Calling Get again for network-1-1 with expanded 1 wildcard read-only paths"}
{"level":"info","ts":1580444911.0755925,"logger":"southbound.synchronizer","caller":"synchronizer/factory.go:129","msg":"Received event network-1-1 EventTypeDeviceConnected 2020-01-31T04:28:31Z {{ <nil> }}"}
{"level":"info","ts":1580444911.0764556,"logger":"manager","caller":"manager/devicehandler.go:25","msg":"Device network-1-1 connected"}
{"level":"info","ts":1580444911.0929089,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:362","msg":"Handling 84 received OpState paths. network-1-1"}
{"level":"info","ts":1580444911.095172,"logger":"southbound.synchronizer","caller":"synchronizer/synchronizer.go:432","msg":"Subscribing to 42 paths. network-1-1"}
{"level":"info","ts":1580444911.1057072,"logger":"manager","caller":"manager/devicehandler.go:68","msg":"Device network-1-1 is updated with states REACHABLE, CONNECTED, AVAILABLE"}
{"level":"info","ts":1580444911.105934,"logger":"controller.change.network","caller":"network/watcher.go:148","msg":"Updating watch for device network-1-1:1.0.0"}
{"level":"info","ts":1580444911.119498,"logger":"controller.change.network","caller":"network/watcher.go:176","msg":"Watching device network-1-1:1.0.0"}
SeanCondon commented 4 years ago

I'm confused by either the title or what you're doing gnmi_cli -address onos-config:5150 Here you're connecting to onos-config not the devices - this does not match up with the title of the issue

adibrastegarnia commented 4 years ago

I'm confused by either the title or what you're doing gnmi_cli -address onos-config:5150 Here you're connecting to onos-config not the devices - this does not match up with the title of the issue @SeanCondon I am trying to get config values of stratum devices via onos-config NB API