[ldns-users] ldns-read-zone output not very helpful

Wouter Wijngaards wouter at nlnetlabs.nl
Wed Jul 21 08:43:11 UTC 2021

Hi Anand,

On 20/07/2021 23:20, Anand Buddhdev via ldns-users wrote:
> On 20/07/2021 14:59, Paul Wouters wrote:
> Hi Paul,
>> It is the line number. Make a parse error on line 10 and see it fail:
>> [root at ns0 ~]# ldns-read-zone /tmp/nohats.ca Syntax error, could not
>> parse the RR's rdata at 10
> I just tried again:
> % ldns-read-zone ripe.net.zone
> Syntax error, could not parse the RR's class at 3638
> Line 3638 is actually a blank line! Here are the lines before and after it:
> 3636 reg01-test.atlas    86400   A
> 3637 reg01-test.atlas    86400   AAAA    2001:67c:2e8:11::
> 3638
> 3639 reg02-test.atlas    86400   A
> 3640 reg02-test.atlas    86400   AAAA    2001:67c:2e8:11::
> So I'm completely stumped, and have no idea why ldns-read-zone is
> failing. Would appreciate some help from the developers...

So the error happens because the code is trying to read the class but
this fails. To be precise: the owner name can be read. The TTL can be
read, and if it exists, it parses. But when it then attempts to read the
next token, for the class, that token cannot be read.

You skip the class token and have a type token. But the token itself
cannot be read, I mean it skips spaces and tabs but then fails. So the
token fetch failed at the class position.

Perhaps there is data there, but there is whitespace on the line. And
the empty spaces are read as an owner and TTL, empty values, and then
the class token read finds the end of the buffer and this fails with the
syntax error.

Or there could be invisible unicode characters in the sourcefile. But I
do not immediately see what codepath would then print this error.

The parser should skip lines filled with whitespace I see in the code
rr.c:760. So that should not really happen. The error is from rr.c:233.

Best regards, Wouter

> Anand
> _______________________________________________
> ldns-users mailing list
> ldns-users at lists.nlnetlabs.nl
> https://lists.nlnetlabs.nl/mailman/listinfo/ldns-users

More information about the ldns-users mailing list