snmpGetBulkRequest with maxRepetitions=0 & identical non-repeater OIDs returns null response

I’m using snmp4j-agent 3.6.x where a snmpGetBulkRequest having maxRepetitions=0 and identical non-repeater OIDs
returns a valid response

But when I upgrade to 3.7.x or greater , the same snmpGetBulkRequest returns a null response.

Can anyone clarify why this is happening?

Thanks in advance!

Could you please give all parameters of the GETBULK request (i.e., non-repeaters value and number of OIDs given)?
In addition, what do you mean by “null” response? A timeout or zero variable bindings in the response PDU?

Parameters
snmpGetBulk(Snmp snmpSession, String host, int port, Target target, PDU pdu, SnmpVersion v2c, int nonRepeaters=2, int maxRepetitions=0, OID… **oids = 3 OIDs **)

In addition, what do you mean by “null” response? A timeout or zero variable bindings in the response PDU?

To be precise, A nullpointer exception is thrown
java.lang.NullPointerException
at org.snmp4j.PDU.getBERLength(PDU.java:646)
at org.snmp4j.PDU.getBERPayloadLengthPDU(PDU.java:652)
at org.snmp4j.PDU.getBERLength(PDU.java:573)
at org.snmp4j.agent.CommandProcessor.sendResponse(CommandProcessor.java:457)
at org.snmp4j.agent.CommandProcessor.finalizeRequest(CommandProcessor.java:438)
at org.snmp4j.agent.agentx.master.AgentXCommandProcessor.finalizeRequest(AgentXCommandProcessor.java:234)
at org.snmp4j.agent.agentx.master.AgentXCommandProcessor.onResponse(AgentXCommandProcessor.java:1903)
at org.snmp4j.agent.agentx.AgentX.processCommand(AgentX.java:265)
at org.snmp4j.agent.agentx.AgentXMessageDispatcherImpl.fireCommandEvent(AgentXMessageDispatcherImpl.java:205)
at org.snmp4j.agent.agentx.AgentXMessageDispatcherImpl.processMessage(AgentXMessageDispatcherImpl.java:101)
at org.snmp4j.transport.AbstractTransportMapping.fireProcessMessage(AbstractTransportMapping.java:125)
at org.snmp4j.transport.DefaultTcpTransportMapping$ServerThread.dispatchMessage(DefaultTcpTransportMapping.java:653)
at org.snmp4j.transport.DefaultTcpTransportMapping$ServerThread.readSnmpMessagePayload(DefaultTcpTransportMapping.java:617)
at org.snmp4j.transport.DefaultTcpTransportMapping$ServerThread.readMessage(DefaultTcpTransportMapping.java:533)
at org.snmp4j.transport.DefaultTcpTransportMapping$ServerThread.readMessage(DefaultTcpTransportMapping.java:299)
at org.snmp4j.transport.AbstractTransportServerThread.doServer(AbstractTransportServerThread.java:358)
at org.snmp4j.transport.DefaultTcpTransportMapping$ServerThread.run(DefaultTcpTransportMapping.java:356)
at java.base/java.lang.Thread.run(Thread.java:829)

Which version of SNMP4J-AgentX are you using with SNMP4J-Agent 3.7.x?
Why are you not using SNMP4J-Agent 3.8.1?

I’m using snmp4j-agentX 3.6.1
I’m getting this exception in all the versions of snmp4j-agent greater than 3.7.x (even in 3.8.1)

Thanks

The bug (regression) is indeed in SNMP4J-Agent 3.7.x. There is a new SNAPSHOT version available for download with the fix.
The release will be made on 2025-02-02T23:00:00Z

Hi,

Is the new release with fix available yet? I couldn’t see any new releases made in snmp4j-agent

Thanks

SNMP4J-Agent 3.8.2 is now available.