Skip to content

Example GNMI device does not work with PLAINTEXT #2365

@ihrasko

Description

@ihrasko

Describe the bug
Example GNMI device cannot establish a connection when user wishes to use PLAINTEXT connection-type.

Branch
main

To Reproduce
Steps to reproduce the behavior:

  1. Follow https://github.com/PANTHEONtech/lighty/blob/main/lighty-examples/lighty-gnmi-community-restconf-app/README.md.
  2. Do not add certificates.
  3. Change payload to connect device to:
curl --request PUT 'http://127.0.0.1:8888/restconf/data/network-topology:network-topology/topology=gnmi-topology/node=gnmi-simulator' \
--header 'Content-Type: application/json' \
--data-raw '{
    "node": [
        {
            "node-id": "gnmi-simulator",
            "connection-parameters": {
                "host": "127.0.0.1",
                "port": 10161,
                "connection-type" : "PLAINTEXT"
                "credentials": {
                    "username": "admin",
                    "password": "admin"
                }
            },
            "extensions-parameters": {
                "gnmi-parameters": {
                    "use-model-name-prefix": true
                }
            }
        }
    ]
}'
  1. Device fails to connect:
curl --request GET 'http://127.0.0.1:8888/restconf/data/network-topology:network-topology/topology=gnmi-topology/node=gnmi-simulator' | python3 -m json.tool

returns

{
    "network-topology:node": [
        {
            "node-id": "gnmi-simulator",
            "gnmi-topology:extensions-parameters": {
                "gnmi-parameters": {
                    "use-model-name-prefix": true
                }
            },
            "gnmi-topology:connection-parameters": {
                "port": 10161,
                "host": "127.0.0.1",
                "connection-type": "PLAINTEXT"
            },
            "gnmi-topology:node-state": {
                "node-status": "TRANSIENT_FAILURE"
            }
        }
    ]
}

Expected behavior
Device is connected successfully and requests to device are exchanged in plaintext which is useful for debugging purposes during development.

Additional context
Nor controller, nor device are not providing any useful logs.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions