jforman / binder

Django Web Admin Gui for manging BIND DNS Zones
129 stars 41 forks source link

Support must be added before being able to support newly-encountered XML version 2.2.' #50

Open khowlette opened 7 years ago

khowlette commented 7 years ago

Getting error this running binder and click on my server that I created in the admin section. I'm testing under virtualenv and ran the requirements but get error below

Any ideas how I can fix this, thanks

pip list show these versions and I'm running on Ubuntu 14.04.4 LTS beautifulsoup4 (4.5.1) Django (1.8.16) dnspython (1.15.0) lxml (3.6.4) pip (7.1.2) pybindxml (0.6) setuptools (18.2) wheel (0.24.0)

'Support must be added before being able to support newly-encountered XML version 2.2.' Request Method: GET Request URL: http://172.17.200.111:8080/info/airlcdnstest01/ Django Version: 1.8.16 Exception Type: XmlError Exception Value:
'Support must be added before being able to support newly-encountered XML version 2.2.' Exception Location: /opt/dnstool/local/lib/python2.7/site-packages/pybindxml/reader.py in get_stats, line 68 Python Executable: /opt/dnstool/bin/python Python Version: 2.7.6 Python Path:
['/opt/binder/binder', '/opt/dnstool/lib/python2.7', '/opt/dnstool/lib/python2.7/plat-x86_64-linux-gnu', '/opt/dnstool/lib/python2.7/lib-tk', '/opt/dnstool/lib/python2.7/lib-old', '/opt/dnstool/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/opt/dnstool/local/lib/python2.7/site-packages', '/opt/dnstool/lib/python2.7/site-packages']

jforman commented 7 years ago

What version of BIND are you running? XML version 2.2 strikes me as quite old.

khowlette commented 7 years ago

Hi its running on CentOS 7 says bind 9.9.4

rpm -qa | grep bind bind-license-9.9.4-29.el7_2.4.noarch rpcbind-0.2.0-33.el7_2.1.x86_64 bind-9.9.4-29.el7_2.4.x86_64 bind-utils-9.9.4-29.el7_2.4.x86_64 bind-libs-9.9.4-29.el7_2.4.x86_64 bind-libs-lite-9.9.4-29.el7_2.4.x86_64

khowlette commented 7 years ago

Any thought on this, would love to get this working

jforman commented 7 years ago

9.9.4 is from >2 years ago (https://www.isc.org/blogs/bind-9-9-4-released/). Might you consider upgrading BIND to a version more recent?

To answer your question, the commit you're concerned with is from the library I use underneath Binder to process the BIND status XML (https://github.com/jforman/pybindxml/commit/bba5c1a5f04ecfb4f98000384adb4a74e80dc272). I removed support for <3.0 back in May 2016 as I was cleaning up the code. I'm honestly not to keen on adding it back in, given how old it is, and the added maintenance cost of that code.

khowlette commented 7 years ago

Thanks Jeff Seem like RHEL and CentOS only go up to 9.9.4 I think its to do with maintaining long term compatibility. Fedora does go to 9.10. Did think of installing the Fedora rpm's but it can introduce other dependency problems. I'm only testing at the moment so I may build a Ubuntu server instead to try out.

Keith

ghjacky commented 6 years ago

Bind version: 9.12.0b2 Got error too, as below:


Request Method: | GET
-- | --
http://192.168.12.187:8000/info/192.168.12.150/
1.11.7
XmlError
'Support must be added before being able to support newly-encountered XML version 3.11.'
/root/Public/py2/local/lib/python2.7/site-packages/pybindxml/reader.py in get_stats, line 68
/root/Public/py2/bin/python
2.7.13
['/root/PycharmProjects/binder',  '/root/Public/py2/lib/python2.7',  '/root/Public/py2/lib/python2.7/plat-x86_64-linux-gnu',  '/root/Public/py2/lib/python2.7/lib-tk',  '/root/Public/py2/lib/python2.7/lib-old',  '/root/Public/py2/lib/python2.7/lib-dynload',  '/usr/lib/python2.7',  '/usr/lib/python2.7/plat-x86_64-linux-gnu',  '/usr/lib/python2.7/lib-tk',  '/root/Public/py2/local/lib/python2.7/site-packages',  '/root/Public/py2/lib/python2.7/site-packages']
Wed, 22 Nov 2017 01:00:16 -0500

Request Method: | GET
-- | --
http://192.168.12.187:8000/info/192.168.12.150/
1.11.7
XmlError
'Support must be added before being able to support newly-encountered XML version 3.11.'
/root/Public/py2/local/lib/python2.7/site-packages/pybindxml/reader.py in get_stats, line 68
/root/Public/py2/bin/python
2.7.13
['/root/PycharmProjects/binder',  '/root/Public/py2/lib/python2.7',  '/root/Public/py2/lib/python2.7/plat-x86_64-linux-gnu',  '/root/Public/py2/lib/python2.7/lib-tk',  '/root/Public/py2/lib/python2.7/lib-old',  '/root/Public/py2/lib/python2.7/lib-dynload',  '/usr/lib/python2.7',  '/usr/lib/python2.7/plat-x86_64-linux-gnu',  '/usr/lib/python2.7/lib-tk',  '/root/Public/py2/local/lib/python2.7/site-packages',  '/root/Public/py2/lib/python2.7/site-packages']
Wed, 22 Nov 2017 01:00:16 -0500
ghjacky commented 6 years ago

I just find out the reader.py, and edit as below (added the elif fork for version 3.11 ....):

if self.xml_version == '3.0':
            self.stats = XmlV30(self.bs_xml)
        elif self.xml_version == '3.3':
            self.stats = XmlV33(self.bs_xml)
        elif self.xml_version == '3.5':
            self.stats = XmlV35(self.bs_xml)
        elif self.xml_version == '3.6':
            self.stats = XmlV36(self.bs_xml)
        elif self.xml_version == '3.11':
            self.stats = XmlV36(self.bs_xml)
        else:
            raise XmlError('Support must be added before being able to support newly-encountered XML version %s.' % self.xml_version)
grebnebo commented 6 years ago

you may install pybindxml from https://github.com/Dunedan/pybindxml it has 2.2 compatibility and all works even on centos 7