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

Warning: <context> element has non-unique value in 'name' key attribute in bind.pm line 308. #181

Closed
frollic opened this issue Apr 30, 2017 · 37 comments
Assignees

Comments

@frollic
Copy link

frollic commented Apr 30, 2017

Enabled bind in the conf file, and monitorix started to throw these warnings:

Warning: element has non-unique value in 'name' key attribute: zonemgr-pool at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: client at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: client at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: client at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: cache at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: cache_heap at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res0 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res1 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res2 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res3 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res4 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res5 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res6 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res7 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res8 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res9 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res10 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res11 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res12 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res13 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res14 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res15 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res16 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res17 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res18 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res19 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res20 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res21 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res22 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res23 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res24 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res25 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res26 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res27 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res28 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res29 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res30 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res31 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res32 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res33 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res34 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res35 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res36 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res37 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res38 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res39 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res40 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res41 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res42 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res43 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res44 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res45 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res46 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res47 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res48 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res49 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res50 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res51 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res52 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res53 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res54 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res55 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res56 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res57 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res58 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res59 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res60 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res61 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res62 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res63 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res64 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res65 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res66 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res67 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res68 at /usr/lib/monitorix/bind.pm line 308.
Warning: element has non-unique value in 'name' key attribute: res69 at /usr/lib/monitorix/bind.pm line 308.

the attribute name differs (there's more of them, I didn't C&P all), but the error message is the same.

bind.pm is the same as the current one at github.

BIND 9.10.4-P8-RedHat-9.10.4-4.P8.fc25 is used.

@mikaku
Copy link
Owner

mikaku commented May 11, 2017

@frollic

I've seen a similar problem here https://rt.cpan.org/Public/Bug/Display.html?id=45025

Can you, please, change the line https://github.com/mikaku/Monitorix/blob/master/lib/bind.pm#L308 in your bind.pm by:

my $data = XMLin($response->content,  keyattr => {});

and restart Monitorix.

Let me know.

@frollic
Copy link
Author

frollic commented May 11, 2017

Works a lot better now, but there's a new warning ;)

bind_update(): Not a HASH reference at /usr/lib/monitorix/bind.pm line 330.

All values, below the graphs, are "-nan" but, this might be a result of the above....

@mikaku
Copy link
Owner

mikaku commented May 11, 2017

Can you pastebin (here or somewhere) the complete XML output you get using the same command line as in your list option inside the <bind> section of your Monitorix configuration file?

Thanks.

@frollic
Copy link
Author

frollic commented May 12, 2017

Hi,

not sure how should have DLed the page, so I used curl - curl http://localhost:8053/ > a

Here's the output.
https://paste.fedoraproject.org/paste/21Yl3GB8gazv5~MMIJoKzF5M1UNdIGYhyRLivL9gydE=/raw

I haven't made any adjustments to the bind section in the conf file, which my be the culprit.

@mikaku
Copy link
Owner

mikaku commented May 15, 2017

I've removed my suggested change above:

my $data = XMLin($response->content,  keyattr => {});

So, I'm using the default bind.pm for this test.

I've put that raw into a file and then modified the bind.pm in order to read that file instead of opening a connection to a BIND server. The result is the same, the only difference is that every time it gets the same values.

I'm not seeing any error message in the log file. It looks like bind.pm is able to parse correctly all this (big) XML file.

Sometimes, after BIND has been restarted, the XML output changes a lot and it might help to stop these annoying messages.

Are you still getting the same errors?

@frollic
Copy link
Author

frollic commented May 16, 2017

Yes,

If I revert, they come back.

@mikaku
Copy link
Owner

mikaku commented May 16, 2017

I'm unable to reproduce your problem. 😞

@frollic
Copy link
Author

frollic commented May 18, 2017

If you email me your IP, I'll make my bind/named accessible from remote.

my username at gmail.

@mikaku
Copy link
Owner

mikaku commented May 19, 2017

Ok, done.

@mikaku
Copy link
Owner

mikaku commented May 22, 2017

@frollic,

Around 1030h (CET) today I've started a Monitorix that collects BIND data from your IP address. So far, I've not yet seen any error message in the logs:

Mon May 22 10:28:45 2017 - Starting Monitorix version 3.9.0 (pid 10569).
Mon May 22 10:28:45 2017 - Loaded main configuration file '/root/mnt/RHC/monitorix/github/Monitorix/zz.conf'.
Mon May 22 10:28:45 2017 - Initializing graphs.
Mon May 22 10:28:45 2017 - Generating the 'index.html' file.
Mon May 22 10:28:45 2017 - Started built-in HTTP server (pid 10606).
Mon May 22 10:28:45 2017 - Ok, ready.
Mon May 22 10:28:45 2017 - WARNING: the built-in HTTP server has authentication disabled.
HTTPServer: You can connect to your server at http://localhost:9090/

The following is a recent screen shot with the stats of your BIND server. This should be the same as yours.

bind

My system is an up-to-date genuine CentOS 6, and hence Monitorix is using Perl v5.10.1.

@frollic
Copy link
Author

frollic commented May 22, 2017

hmmm .....

upgraded to monitorix-3.9.0-2.fc26.noarch.rpm, still seeing the element has non-unique value error.

could this be related to some external functionality used by monitorix ?

@mikaku
Copy link
Owner

mikaku commented May 24, 2017

Well, the bind.pm module uses the Perl-XML-Simple package which in my CentOS 6 system has the version 2.18.

Perhaps your system has a newer version that is showing that message?

@frollic
Copy link
Author

frollic commented May 25, 2017

Yeah, when the warnings come, the graphs seem to get plotted correctly.

Here: perl-XML-Simple-2.22-3.fc25.noarch

@mikaku
Copy link
Owner

mikaku commented May 25, 2017

Looks like in some version after 2.18 they increased the log level.
You could try passing the option to turn the Strict Mode off in line 308:

my $data = XMLin($response->content, StrictMode => 0);

(crossing fingers)

@frollic
Copy link
Author

frollic commented May 25, 2017

nope, still the same :-|

@Erreu
Copy link

Erreu commented Jun 2, 2017

I resorted to commenting out "use warnings;" in bind.pm to prevent the logs from filling up. ¯\(ツ)
monitorix 3.9.0
XML-Simple 2.22

@frollic
Copy link
Author

frollic commented Jun 5, 2017

Yup,

That seems to solve the problem for me as well ... ;)

Thnx Erreu

@mikaku
Copy link
Owner

mikaku commented Jun 12, 2017

Disabling global warnings might prevent from seeing other interesting warnings.
Anyway, I don't know if exist a way to disable warnings from an specific Perl module.

@maniac0r
Copy link

maniac0r commented Aug 19, 2017

strange enough i have similar issue on Archlinux, but i don't even get the data graphed for incoming queries, nor NameServer Statistics , but other BIND graphs works fine (like outgoing queries, resolver statistics, CacheDB RRSets..) .

Monitorix 3.9
Perl v5.26.0
Bind 9.11.2-2

EDIT: attaching bind stats xml file
bs.txt

@wmyrda
Copy link

wmyrda commented Jan 21, 2018

Have You guys found any solution to this problem other than workaround to comment out "use warnings;"? I still see that issue in 3.10...

@mikaku
Copy link
Owner

mikaku commented Jan 23, 2018

@wmyrda, what version of Perl-XML-Simple you have there?

@wmyrda
Copy link

wmyrda commented Jan 23, 2018

@mikaku
[I] dev-perl/XML-Simple
Available versions: 2.200.0-r1 2.220.0 {test}
Installed versions: 2.220.0(00:23:14 20.12.2017)(-test)
Homepage: http://search.cpan.org/dist/XML-Simple/
Description: An API for simple XML files

@wmyrda
Copy link

wmyrda commented Jan 23, 2018

wow it seems Gentoo uses stone age version of it from 2012... I see how it goes with more recent

@wmyrda
Copy link

wmyrda commented Jan 23, 2018

I have tried version 2.18, 2.20, 2.22 & 2.24 with same result. It may be something changed elsewhere. In perl itself maybe?

[I] dev-lang/perl
Available versions: 5.24.3(0/5.24) ()5.26.1(0/5.26) ()5.26.1-r1(0/5.26) **5.26.9999(0/5.26) **5.28.9999(0/5.27.7) {berkdb debug doc gdbm ithreads}
Installed versions: 5.26.1-r1(0/5.26)(03:36:10 13.01.2018)(berkdb gdbm ithreads -debug -doc)
Homepage: https://www.perl.org/
Description: Larry Wall's Practical Extraction and Report Language

@mikaku
Copy link
Owner

mikaku commented Jan 23, 2018

@wmyrda, mine is perl-XML-Simple-2.18-6.el6.noarch and is working perfectly.
It looks like depending of the version of that Perl module you might experience different problems, but I'm unsure if all these problems are because of that Perl module. :-/

@wmyrda
Copy link

wmyrda commented Jan 23, 2018

@mikaku On 22 May 2017 You have said your perl version is 5.10. Is it still the case? As mine and few other people is 5.26 than difference is quite substantial. One can expect some change could have taken place that is causing the issue.
The lowest currently available in Gentoo is 5.24.3 so I am not able to easily check that much older perl version to be sure whether it is that or not.

@mikaku
Copy link
Owner

mikaku commented Jan 24, 2018

Perl 5.26!, you guys are living on the edge! ;-)

I have that module working finely either on CentOS 6 (Perl v5.10.1) and on CentOS 7 (Perl v5.16.3), so I'm afraid the latest Perl version I've tested it is v5.16.3.

@wmyrda
Copy link

wmyrda commented Jan 24, 2018

5.16 sounds more likely ;) I did not fill like checking all the way back to 5.10 :P Hence there is fewer versions to check I will do so in a bit.

@wmyrda
Copy link

wmyrda commented Jan 24, 2018

Well I used up all the portage tricks I know to install older version of perl 5.24.3, but every single time it wants to pull back 5.26.1. I didn't know downgrading perl would be that hard. I'll ask in the forums how others do it and hopefully figure out a way, but it is likely that I will install some other distro in virtualbox with older perl version to see if that is the cause of the bind.pm breakage.

@mikaku
Copy link
Owner

mikaku commented Jan 24, 2018

OK, keep us informed.
Thanks!

@wmyrda
Copy link

wmyrda commented Feb 1, 2018

I just tested Monitorix on the Ubuntu Server 16.04 LTS where they use perl 5.22 and the problem still does appear :(
Perhaps You could take a look at that version?

@wmyrda
Copy link

wmyrda commented Feb 2, 2018

I have just noticed that there is additional difference among 5.22 & 5.26. On the Ubuntu system (perl 5.22, bind 9.10.3) even with #use warnings; I get information on all graphs while on Gentoo with (perl 5.26, bind 9.11.2) "incoming queries" and "name server statistics" are empty. That kinda makes the whole issue a bit more severe :(

@mikaku
Copy link
Owner

mikaku commented Feb 5, 2018

Not sure if I understood your last posts:

You said:

I just tested Monitorix on the Ubuntu Server 16.04 LTS where they use perl 5.22 and the problem still does appear

and then:

On the Ubuntu system (perl 5.22, bind 9.10.3) even with #use warnings; I get information on all graphs ...

So, it works in Ubuntu system with Perl 5.22 and BIND 9.10.3?

Let me know.

@wmyrda
Copy link

wmyrda commented Feb 5, 2018

I hope this clears it up

  1. "bind.pm line 308" appears on both systems I tested
  2. commenting out "use warnings;" in bind.pm stops that log flooding on both systems
  3. Ubuntu with Perl 5.22 & BIND 9.10.3 & "use warnings;" workaround work without any side effects
  4. Gentoo with perl 5.26, bind 9.11.2 & "use warnings;" workaround work only partially as "incoming queries" and "name server statistics" are empty

@mikaku
Copy link
Owner

mikaku commented Feb 7, 2018

OK, I have just finally installed F27 on a virtual machine. It comes with Perl v5.26.1 and BIND 9.11.2 and now I see a lot of messages like these:

Warning: <context> element has non-unique value in 'name' key attribute: res518 at /usr/lib/monitorix/bind.pm line 308.
Warning: <context> element has non-unique value in 'name' key attribute: res519 at /usr/lib/monitorix/bind.pm line 308.
Warning: <context> element has non-unique value in 'name' key attribute: res520 at /usr/lib/monitorix/bind.pm line 308.
Warning: <context> element has non-unique value in 'name' key attribute: res521 at /usr/lib/monitorix/bind.pm line 308.
Warning: <context> element has non-unique value in 'name' key attribute: res522 at /usr/lib/monitorix/bind.pm line 308.

So, give me some time to find out if I can fix them.
Thanks for your patience.

mikaku added a commit that referenced this issue Jun 25, 2019
@mikaku
Copy link
Owner

mikaku commented Jun 25, 2019

I've rewritten the way how bind.pm collects its data. Now it no longer uses the Perl module XML-Simple, instead it uses the Perl module XML-LibXML.

Please, download the latest version of bind.pm and let me know if everything works as expected.

Don't forget to install Perl XML-LibXML in your system.

@mikaku
Copy link
Owner

mikaku commented Jun 27, 2019

Thanks to the help of @Nyut0n in #244, the bind.pm module now works finely with the ISC BIND statistics version 3.

@mikaku mikaku closed this as completed Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants