Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Jinja template rendering error: 'collections.OrderedDict object' has no attribute 'default' at MIB" since version 1.4.4 #92

Closed
kmeinhar opened this issue Aug 7, 2024 · 2 comments
Labels
area:pysmi PySMI package duplicate This issue or pull request already exists

Comments

@kmeinhar
Copy link

kmeinhar commented Aug 7, 2024

Expected behavior

I expected mibdump can compile our MIB RITTAL CMC III version 3.17.

This was possible with mibdump version 0.3.4 that was installed before the takeover on 17.07.24.

Actual behavior

But a bug happened like this:

mibdump --mib-source file:///usr/share/snmp/mibs --destination-directory /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs --destination-format pysnmp RITTAL-CMC-III-MIB

Error

Jinja template rendering error: 'collections.OrderedDict object' has no attribute 'default' at MIB RITTAL-CMC-III-MIB

This did not happen with mibdump version 0.3.4 that was installed before the takeover on 17.07.24.

Detailed steps

The steps are:

  • Download the MIB

Python package information

pysmi 1.4.4

Operating system information

Linux

Python information

3.10.14

(Optional) Contents of your test script

No response

Relevant log output

2024-08-07 13:35:57,609 pysmi: checking if RITTAL-SMI-MIB requires updating
2024-08-07 13:35:57,609 pysmi: /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/RITTAL-SMI-MIB.pyc not present or not a file
2024-08-07 13:35:57,609 pysmi: found /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/RITTAL-SMI-MIB.py, mtime Wed, 07 Aug 2024 13:34:26 GMT
2024-08-07 13:35:57,609 pysmi: will be using existing compiled MIB RITTAL-SMI-MIB found by PyFileSearcher{"/usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs"}
2024-08-07 13:35:57,609 pysmi: checking if SNMPv2-CONF requires updating
2024-08-07 13:35:57,609 pysmi: /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-CONF.pyc not present or not a file
2024-08-07 13:35:57,609 pysmi: found /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-CONF.py, mtime Wed, 07 Aug 2024 13:28:57 GMT
2024-08-07 13:35:57,609 pysmi: will be using existing compiled MIB SNMPv2-CONF found by PyFileSearcher{"/usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs"}
2024-08-07 13:35:57,609 pysmi: checking if SNMPv2-MIB requires updating
2024-08-07 13:35:57,609 pysmi: /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-MIB.pyc not present or not a file
2024-08-07 13:35:57,609 pysmi: found /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-MIB.py, mtime Wed, 07 Aug 2024 13:28:57 GMT
2024-08-07 13:35:57,609 pysmi: will be using existing compiled MIB SNMPv2-MIB found by PyFileSearcher{"/usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs"}
2024-08-07 13:35:57,610 pysmi: checking if SNMPv2-SMI requires updating
2024-08-07 13:35:57,610 pysmi: /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-SMI.pyc not present or not a file
2024-08-07 13:35:57,610 pysmi: found /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-SMI.py, mtime Wed, 07 Aug 2024 13:28:57 GMT
2024-08-07 13:35:57,610 pysmi: will be using existing compiled MIB SNMPv2-SMI found by PyFileSearcher{"/usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs"}
2024-08-07 13:35:57,610 pysmi: checking if SNMPv2-TC requires updating
2024-08-07 13:35:57,610 pysmi: /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-TC.pyc not present or not a file
2024-08-07 13:35:57,610 pysmi: found /usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-TC.py, mtime Wed, 07 Aug 2024 13:28:57 GMT
2024-08-07 13:35:57,610 pysmi: will be using existing compiled MIB SNMPv2-TC found by PyFileSearcher{"/usr/local/lib/python3.10/site-packages/pysnmp/smi/mibs"}
2024-08-07 13:35:57,610 pysmi: MIBs parsed 1, MIBs failed 0
2024-08-07 13:35:57,610 pysmi: compiling RITTAL-CMC-III-MIB read from file:///usr/share/snmp/mibs/RITTAL-CMC-III-MIB.txt
2024-08-07 13:35:57,660 pysmi: canonical MIB name RITTAL-CMC-III-MIB (None), imported MIB(s) RITTAL-SMI-MIB,SNMPv2-CONF,SNMPv2-MIB,SNMPv2-SMI,SNMPv2-TC
2024-08-07 13:35:58,196 pysmi: error from <pysmi.codegen.pysnmp.PySnmpCodeGen object at 0x79cccfd73ca0>: Jinja template rendering error: 'collections.OrderedDict object' has no attribute 'default' at MIB RITTAL-CMC-III-MIB
2024-08-07 13:35:58,197 pysmi: MIBs built 0, MIBs failed 1
2024-08-07 13:35:58,197 pysmi: trying to borrow RITTAL-CMC-III-MIB from PyFileBorrower{https://mibs.pysnmp.com:443/mibs/notexts/@mib@, genTexts=False, exts=['.py']}
2024-08-07 13:35:58,197 pysmi: trying to borrow file RITTAL-CMC-III-MIB from https://mibs.pysnmp.com:443/mibs/notexts/@mib@
2024-08-07 13:35:58,197 pysmi: looking for MIB RITTAL-CMC-III-MIB
2024-08-07 13:35:58,197 pysmi: trying to fetch MIB from https://mibs.pysnmp.com:443/mibs/notexts/RITTAL-CMC-III-MIB.py
2024-08-07 13:35:58,433 pysmi: HTTP response 404
2024-08-07 13:35:58,433 pysmi: trying to fetch MIB from https://mibs.pysnmp.com:443/mibs/notexts/RITTAL-CMC-III-MIB.py
2024-08-07 13:35:58,540 pysmi: HTTP response 404
2024-08-07 13:35:58,541 pysmi: trying to fetch MIB from https://mibs.pysnmp.com:443/mibs/notexts/RITTAL-CMC-III-MIB-MIB.py
2024-08-07 13:35:58,656 pysmi: HTTP response 404
2024-08-07 13:35:58,656 pysmi: trying to fetch MIB from https://mibs.pysnmp.com:443/mibs/notexts/rittal-cmc-iii-mib-mib.py
2024-08-07 13:35:58,775 pysmi: HTTP response 404
2024-08-07 13:35:58,775 pysmi: error from PyFileBorrower{https://mibs.pysnmp.com:443/mibs/notexts/@mib@, genTexts=False, exts=['.py']}: source MIB RITTAL-CMC-III-MIB not found
2024-08-07 13:35:58,775 pysmi: trying to borrow RITTAL-CMC-III-MIB from PyFileBorrower{https://mibs.pysnmp.com:443/mibs/fulltexts/@mib@, genTexts=True, exts=['.py']}
2024-08-07 13:35:58,775 pysmi: skipping incompatible borrower PyFileBorrower{https://mibs.pysnmp.com:443/mibs/fulltexts/@mib@, genTexts=True, exts=['.py']} for file RITTAL-CMC-III-MIB
2024-08-07 13:35:58,775 pysmi: error from PyFileBorrower{https://mibs.pysnmp.com:443/mibs/fulltexts/@mib@, genTexts=True, exts=['.py']}: 
2024-08-07 13:35:58,775 pysmi: MIBs available for borrowing 0, MIBs failed 1
2024-08-07 13:35:58,775 pysmi: MIBs built 0, MIBs failed 1
2024-08-07 13:35:58,775 pysmi: failing with problem MIBs: RITTAL-CMC-III-MIB
Missing source MIBs: 
Ignored MIBs: 
Failed MIBs: RITTAL-CMC-III-MIB (Jinja template rendering error: 'collections.OrderedDict object' has no attribute 'default' at MIB RITTAL-CMC-III-MIB)
MIBs analyzed 6, MIBs failed 0
Created/updated MIBs: 
Pre-compiled MIBs borrowed: 
Up to date MIBs: RITTAL-SMI-MIB, SNMPv2-CONF, SNMPv2-MIB, SNMPv2-SMI, SNMPv2-TC
@kmeinhar kmeinhar added bug Something isn't working triage New issues that need to be sorted out. labels Aug 7, 2024
@kmeinhar
Copy link
Author

kmeinhar commented Aug 7, 2024

Please let me know if it is possible to get more debug information for why the compilation of the MIB failed. I would like to help fix the issue.

@lextm lextm added duplicate This issue or pull request already exists area:pysmi PySMI package and removed bug Something isn't working triage New issues that need to be sorted out. labels Aug 7, 2024
@lextm lextm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
@lextm
Copy link

lextm commented Aug 7, 2024

Duplicate to #83.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:pysmi PySMI package duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants