Pedro Oliveira created NIFI-14075:
-------------------------------------

             Summary: In ListenTrapSNMP, use different discrete errors based on 
SNMP4J's exceptions instead of normalizing to a generic message
                 Key: NIFI-14075
                 URL: https://issues.apache.org/jira/browse/NIFI-14075
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Extensions
    Affects Versions: 1.24.0
            Reporter: Pedro Oliveira


In the ListenerProcessor SNMP processor, when trying to connect to the SNMP 
Manager using SNMPv3 if there is an error a generic error message is written to 
the log file:

2024-12-03 16:57:20,163 ERROR [Timer-Driven Process Thread-9] 
org.apache.nifi.snmp.processors.GetSNMP 
GetSNMP[id=8cfbd124-0193-1000-b2b3-0e216fe00dd2] Processing halted: yielding [1 
sec]
org.apache.nifi.snmp.exception.RequestTimeoutException: Request timed out. 
Please check if (1). the agent host and port is correctly set, (2). the agent 
is running, (3). the agent SNMP version corresponds with the processor's one, 
(4) the community string is correct and has read access, (5) In case of SNMPv3 
check if the user credentials are valid and the user in a group with read 
access.

It is not easy to findout what the situation that triggers the error message is.
NiFi uses the SNMP4J library to handle the SNMP protocol communication, 
processes the different SNMP issues and can return the following errors:
{code:java}
        case SnmpConstants.SNMP_MP_WRONG_USER_NAME:
        case SnmpConstants.SNMP_MP_UNSUPPORTED_SECURITY_MODEL:
        case SnmpConstants.SNMP_MP_USM_ERROR:
        case SnmpConstants.SNMPv3_USM_AUTHENTICATION_FAILURE:
        case SnmpConstants.SNMPv3_USM_UNSUPPORTED_SECURITY_LEVEL:
        case SnmpConstants.SNMPv3_USM_UNKNOWN_SECURITY_NAME:
        case SnmpConstants.SNMPv3_USM_AUTHENTICATION_ERROR:
        case SnmpConstants.SNMPv3_USM_NOT_IN_TIME_WINDOW:
        case SnmpConstants.SNMPv3_USM_UNSUPPORTED_AUTHPROTOCOL:
        case SnmpConstants.SNMPv3_USM_UNKNOWN_ENGINEID:
        case SnmpConstants.SNMPv3_TSM_INADEQUATE_SECURITY_LEVELS:
{code}
 


but the NiFi processor error handling code doesn't differentiate them and only 
produces the generic message above.

 

Initially, we want to know whether such change is acceptable in your codebase 
or not. 
Should you accept these changes, we will work on the code modifications and 
create a pull request for further discussion.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to