Error compiling IP-MIB

Problem:
When trying to Generate Data Collection for IP-MIB.mib in GUI SNMP MIB Compiler I get this error:

2022-05-13T09:49:10+02:00 [INFO] Reading MIBs from /usr/share/opennms/share/mibs
2022-05-13T09:50:01+02:00 [INFO] Uploading IP-MIB.mib
2022-05-13T09:50:04+02:00 [INFO] File IP-MIB.mib successfuly uploaded
2022-05-13T09:50:24+02:00 [INFO] The file editing has been canceled.
2022-05-13T09:50:26+02:00 [INFO] Parsing MIB file /usr/share/opennms/share/mibs/pending/IP-MIB.mib
2022-05-13T09:50:28+02:00 [INFO] MIB parsed successfuly.
2022-05-13T09:50:28+02:00 [INFO] Renaming file IP-MIB.mib to IP-MIB.mib
2022-05-13T09:50:35+02:00 [INFO] Parsing MIB file /usr/share/opennms/share/mibs/compiled/IP-MIB.mib
2022-05-13T09:50:36+02:00 [INFO] MIB parsed successfuly.
2022-05-13T09:50:43+02:00 [ERROR] class org.opennms.core.xml.MarshallingResourceFailureException: Failed to marshal/unmarshal XML file while marshalling DatacollectionGroup: javax.xml.bind.MarshalException - with linked exception: [Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: org.eclipse.persistence.oxm.record.ValidatingMarshalRecord$MarshalSAXParseException; cvc-pattern-valid: Value ‘ipaddress’ is not facet-valid with respect to pattern ‘(Cc(32|64)?|Gg(32|64)?|TtTt|Ii(32|64)?|OoSs)|Ss|HhSs’ for type ‘#AnonType_typemibObj’.]; nested exception is javax.xml.bind.MarshalException - with linked exception: [Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: org.eclipse.persistence.oxm.record.ValidatingMarshalRecord$MarshalSAXParseException; cvc-pattern-valid: Value ‘ipaddress’ is not facet-valid with respect to pattern ‘(Cc(32|64)?|Gg(32|64)?|TtTt|Ii(32|64)?|OoSs)|Ss|HhSs’ for type ‘#AnonType_typemibObj’.]

I have no idea what that means and how to fix this.

Expected outcome:
Data collection to be generated

OpenNMS version:
Horizon 29.0.9

Hi.
I have faced the same problem with another MIB.

This happens when trying to create Data collections in the GUI, so I wonder if it also happens when one configure it using the configuration files SnmpCollector (opennms.com)

But didn’t had the time yet to try it.

But, by what is stated here, maybe it is not supported and we have to change IpAddress use by string on the MIB …
Data Types (opennms.com)

Anyone from the developing team can confirm if ipaddress is not supported at all by the DataCollection process ?

Since IpAddress is defined in SNMPv2-SMI that is compiled, I was expecting it to be usable.

Best regards,
Ricardo

While IpAddress is part of the RFC specs for MIBs, we need the type set to STRING for datacollection definitions. (As stated in that data type document linked above)

1 Like

Thank you for elaborating, but more importantly: is there a fix?
I’m a user, not a developer :wink:

Not yet.

https://issues.opennms.org/browse/NMS-14314

1 Like

@Dieter , seems it is solved in 30.0.1 Release OpenNMS Horizon 30.0.1 (Chinchilla) · OpenNMS/opennms · GitHub

Hi, I had the original issue, upgraded to 30.0.1, but now I see a new issue, and it is repoting cvc-pattern-valid: Value ‘bits’. It was ‘ipaddress’ before. What is the best way to get this issue logged?

2022-08-02T18:06:48+01:00 **[INFO]** Uploading CISCO-ENVMON-MIB.mib

2022-08-02T18:06:48+01:00 **[INFO]** File CISCO-ENVMON-MIB.mib successfuly uploaded

2022-08-02T18:06:54+01:00 **[INFO]** Parsing MIB file /opt/opennms/share/mibs/pending/CISCO-ENVMON-MIB.mib

2022-08-02T18:06:54+01:00 **[INFO]** MIB parsed successfuly.

2022-08-02T18:06:54+01:00 **[INFO]** Renaming file CISCO-ENVMON-MIB.mib to CISCO-ENVMON-MIB.mib

2022-08-02T18:06:59+01:00 **[INFO]** Parsing MIB file /opt/opennms/share/mibs/compiled/CISCO-ENVMON-MIB.mib

2022-08-02T18:06:59+01:00 **[INFO]** MIB parsed successfuly.

2022-08-02T18:07:00+01:00 **[INFO]** Found 9 events.

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonShutdownNotification

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonVoltageNotification

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonTemperatureNotification

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonFanNotification

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonRedundantSupplyNotification

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonVoltStatusChangeNotif

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonTempStatusChangeNotif

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonFanStatusChangeNotif

2022-08-02T18:07:03+01:00 **[DEBUG]** Normalizing event uei.opennms.org/traps/CISCO-ENVMON-MIB/ciscoEnvMonSuppStatusChangeNotif

2022-08-02T18:07:03+01:00 **[INFO]** Saving XML data into /opt/opennms/etc/events/CISCO-ENVMON-MIB.events.xml

2022-08-02T18:07:03+01:00 **[INFO]** Adding a reference to events/CISCO-ENVMON-MIB.events.xml inside eventconf.xml.

2022-08-02T18:07:03+01:00 **[INFO]** Saving XML data into /opt/opennms/etc/eventconf.xml

2022-08-02T18:07:03+01:00 **[INFO]** The event's configuration reload operation is being performed.

2022-08-02T18:07:08+01:00 **[INFO]** Parsing MIB file /opt/opennms/share/mibs/compiled/CISCO-ENVMON-MIB.mib

2022-08-02T18:07:08+01:00 **[INFO]** MIB parsed successfuly.

2022-08-02T18:07:13+01:00 **[ERROR]** class org.opennms.core.xml.MarshallingResourceFailureException: Failed to marshal/unmarshal XML file while marshalling DatacollectionGroup: javax.xml.bind.MarshalException - with linked exception: [Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: org.eclipse.persistence.oxm.record.ValidatingMarshalRecord$MarshalSAXParseException; cvc-pattern-valid: Value 'bits' is not facet-valid with respect to pattern '([Cc](ounter|OUNTER)(32|64)?|[Gg](auge|AUGE)(32|64)?|[Tt](ime|IME)[Tt](icks|ICKS)|[Ii](nteger|NTEGER)(32|64)?|[Oo](ctet|CTET)[Ss](tring|TRING))|[Ss](tring|TRING)|[Hh](ex|EX)[Ss](tring|TRING)|[Oo]paque|OPAQUE' for type '#AnonType_typemibObj'.]; nested exception is javax.xml.bind.MarshalException - with linked exception: [Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.XMLMarshalException Exception Description: An error occurred marshalling the object Internal Exception: org.eclipse.persistence.oxm.record.ValidatingMarshalRecord$MarshalSAXParseException; cvc-pattern-valid: Value 'bits' is not facet-valid with respect to pattern '([Cc](ounter|OUNTER)(32|64)?|[Gg](auge|AUGE)(32|64)?|[Tt](ime|IME)[Tt](icks|ICKS)|[Ii](nteger|NTEGER)(32|64)?|[Oo](ctet|CTET)[Ss](tring|TRING))|[Ss](tring|TRING)|[Hh](ex|EX)[Ss](tring|TRING)|[Oo]paque|OPAQUE' for type '#AnonType_typemibObj'.]

Create an issue in our jira: https://issues.opennms.org and reference this thread in the jira

If you link the Jira issue here, I’ll try to shepherd it along.

thanks, here is the JIRA I created

NMS-14640

1 Like

Thx, I can confirm

Hi, I am using 30.0.1, and it fixed the cvc-pattern-valid: Value ipaddress.
But this is now showing an error for ‘bits’.

JIRA seems to be down, so not sure if this has progressed at all?

The Jira issue has been flagged to be worked on, though I believe it is still in the scoping state to determine the work needed to handle the bits data type.