Skip to content

[BUG] Missing SAI log level enumerations in gNMI ocbinds due to union type deduplication in goyang #668

Description

@rakshitha-marvell

BUG SUMMARY:

In the SONiC YANG model sonic-logger.yang, the LOGLEVEL leaf is defined as a union of two enumeration typedefs named swss_loglevel and sai_loglevel. These two typedefs represent log level values for different components. The swss_loglevel typedef is used for SWSS components, while the sai_loglevel typedef is used for SAI components.
When performing a gNMI GET operation on a logger entry that is configured with a SAI log level value such as SAI_LOG_LEVEL_DEBUG, the request fails with an error stating that the value could not be unmarshalled into an enumeration type. This indicates that the generated code does not recognize SAI log level values as valid enumeration members.

LOGS :

On Client side :

$gnmic get --path sonic-logger
GetRequest failed:
rpc error: code = NotFound desc = could not unmarshal SAI_LOG_LEVEL_DEBUG into type enumeration
Error: one or more requests failed

On Server Side :

GetRequest path: /sonic-logger:sonic-logger
Translib: Received Get request
XlateFromDb: JSON response created from DB data
WARNING: ocbinds.Unmarshal() returned:
could not unmarshal SAI_LOG_LEVEL_DEBUG into type enumeration
GET operation failed with error:
could not unmarshal SAI_LOG_LEVEL_DEBUG into type enumeration

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions