Skip to content

gNMI Subscription Error: "Subscription to path /network-instances/network-instance/afts/ is allowed only for GNMI Subscribe RPC" #65

@a-soga

Description

@a-soga

gNMI Subscription Failure for /network-instances/network-instance/afts/ on Juniper PTX10008

[Description]
I'm trying to collect telemetry data for FIB route counts from a Juniper PTX10008 using jtimon (v2.0.4) and gnmic. The target path is /network-instances/network-instance/afts/ipv4-unicast/summary/route-count/state/total-count/fib-count, but subscriptions to /network-instances/network-instance/afts/ fail. jtimon returns an error indicating the path is only allowed for gNMI Subscribe RPC, and gnmic either hangs or returns an error depending on the mode used. Other paths (e.g., /interfaces/interface/state/counters/in-octets) work correctly, suggesting the issue is specific to the /network-instances/network-instance/afts/ path or its sub-paths.

[Environment]
Device
model :Juniper PTX10008
Junos OS : 24.2R2.16-EVO
IP Address: 10.y.y.y

Collector
Host : 10.x.x.x
jtimon Version: v2.0.4

※YANG Model: Confirmed support for /network-instances/network-instance/afts/ in Junos 24.2R2.16-EVO via Junos YANG Data Model Explorer.

[Device Configuration(PTX10008)]
set system services extension-service request-response grpc clear-text address 10.y.y.y
set system services extension-service request-response grpc clear-text port 30000
set system services extension-service request-response grpc skip-authentication
set system services extension-service notification allow-clients address 10.9.0.0/16

set services analytics streaming-server TELEMETRY-SERVER remote-address 10.x.x.x
set services analytics streaming-server TELEMETRY-SERVER remote-port 30000
set services analytics export-profile EXPORT-PARAMS local-address 10.y.y.y
set services analytics export-profile EXPORT-PARAMS local-port 30000
set services analytics export-profile EXPORT-PARAMS reporting-rate 5
set services analytics export-profile EXPORT-PARAMS format json
set services analytics export-profile EXPORT-PARAMS transport grpc
set services analytics sensor FIB-COUNT server-name TELEMETRY-SERVER
set services analytics sensor FIB-COUNT export-name EXPORT-PARAMS
set services analytics sensor FIB-COUNT resource "/network-instances/network-instance[name=default]/afts/ipv4-unicast/summary/route-count/state/total-count/fib-count"

[jtimon Configuration (ptx10008.json)]
★Working Configuration (without /network-instances/network-instance/afts/)

{
"host": "10.y.y.y",
"port": 30000,
"grpc": {
"ws": 0
},
"paths": [
{"path": "/junos/system/linecard/environment/", "freq": 5000},
{"path": "/components/component/cpu/utilization", "freq": 5000},
{"path": "/interfaces/interface/state/counters/in-octets", "freq": 5000},
{"path": "/interfaces/interface/state/counters/out-octets", "freq": 5000},
{"path": "/interfaces/interface/state/counters/in-unicast-pkts", "freq": 5000},
{"path": "/interfaces/interface/state/counters/out-unicast-pkts", "freq": 5000},
{"path": "/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/session-state", "freq": 5000},
{"path": "/interfaces/interface/ethernet/state/counters/jnx-pfc-statistics/", "freq": 5000}
]
}

Command:
./jtimon-linux-amd64 --prometheus --config ptx10008.json --prometheus-host 10.x.x.x --prometheus-port 8090 --print

Result:
Telemetry data is successfully received for the above paths.

★Failing Configuration (with /network-instances/network-instance/afts/)
Added to paths:
{"path": "/network-instances/network-instance/afts/", "freq": 5000}

Command:
./jtimon-linux-amd64 --prometheus --config ptx10008.json --prometheus-host 10.x.x.x --prometheus-port 8090 --print

Error:
rpc error: code = InvalidArgument desc = Internal error, Subscription to path /network-instances/network-instance/afts/ is allowed only for GNMI Subscribe RPC

[Attempt 1]
Command:
/usr/local/bin/gnmic sub --address 10.y.y.y:30000 --mode stream --stream-mode sample --sample-interval 5s --path /network-instances/network-instance/afts/ --insecure --format prototext

Result: Command hangs (no prompt returned), and no telemetry data is received.

[Attempt 2]
Command(STREAM Mode with Specific Path):
/usr/local/bin/gnmic sub --address 10.y.y.y:30000 --mode stream --stream-mode sample --sample-interval 5s --path /network-instances/network-instance/afts/ipv4-unicast/summary/route-count/state/total-count/fib-count --insecure --format prototext

Result: Command hangs (no prompt returned), and no telemetry data is received.

[Attempt 3]
Command(ONCE Mode):
/usr/local/bin/gnmic sub --address 10.y.y.y:30000 --mode once --sample-interval 5s --path /network-instances/network-instance/afts/ --insecure --format prototext

Error:
rpc error: code = InvalidArgument desc = Internal error, target defined mode not supported for sensor /network-instances/network-instance/afts/
Error: one or more requests failed

[Attempt 4: STREAM Mode with Other Path (Successful)]
Command:
/usr/local/bin/gnmic sub --address 10.y.y.y:30000 --mode stream --stream-mode sample --sample-interval 5s --path /interfaces/interface/state/counters/in-octets --insecure --format prototext

Result: Successfully received telemetry data, e.g.:
{
"source": "10.y.y.y:30000",
"subscription-name": "default-1750314742",
"timestamp": 1750314727918493914,
"time": "2025-06-19T06:32:07.918493914Z",
"prefix": "interfaces/interface[name=et-1/0/32]/state/counters",
"updates": [
{
"Path": "in-octets",
"values": {
"in-octets": 8709975
}
}
],
"extensions": [
{
"Ext": {
"RegisteredExt": {
"id": 1,
"msg": "CgpQVFgxMEs4LTQ3EAEiDHNlbnNvcl8xMTE0MCovL2ludGVyZmFjZXMvaW50ZXJmYWNlL3N0YXRlL2NvdW50ZXJzL2luLW9jdGV0cy8yLy9pbnRlcmZhY2VzL2ludGVyZmFjZS9zdGF0ZS9jb3VudGVycy9pbi1vY3RldHMvOg5ldm8tYWZ0bWFuZC1idECAgIABYPPzjLf4Mg=="
}
}
}
]
}

[Additional Tests]
・Data Existence: Verified FIB routes exist via show route forwarding-table family inet on the device.
・Network Connectivity: Confirmed connectivity between 10.y.y.y and 10.x.x.x
・Other Paths: Other paths (e.g., /interfaces/interface/state/counters/in-octets) work correctly with both jtimon and gnmic.

[Expected Behavior]
jtimon or gnmic successfully retrieves telemetry data for /network-instances/network-instance[name=default]/afts/ipv4-unicast/summary/route-count/state/total-count/fib-count

[Request]
Could you provide any insights into possible causes, recommended configurations, or known issues related to this path when using jtimon or Juniper's gNMI implementation? Additionally, any suggestions for debugging steps or guidance on how to proceed would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions