Closed bluikko closed 4 months ago
Hi @bluikko,
please take a look at this patch: https://github.com/pierky/arouteserver/pull/135 It should implement the solution that you are proposing, that is increasing resiliency and making errors non-blockers
I've already merged it into dev, and I will include it in the next release.
I agree with the comment about the log message being pretty useless as it is now. I've pushed a commit to log only the broken record instead of the whole file (I think that was my actual original idea, but then raw
vs row
triggered the problem).
Thanks again for filing this issue.
I've just pushed out a new alpha release that contains this fix. If CI/CD will be happy, it will be available under the PyPi test instance in a few hours. It will be possible to install it by following the instructions at https://arouteserver.readthedocs.io/en/latest/INSTALLATION.html#development-and-pre-release-versions
If everything goes well, I plan to ship it as part of a new release in a few days.
Oh sorry for the duplicate. I looked only the recent issues, didn't imagine this is a recurring issue going back months!
I've just pushed out a new alpha release that contains this fix. If CI/CD will be happy, it will be available under the PyPi test instance in a few hours. It will be possible to install it by following the instructions at https://arouteserver.readthedocs.io/en/latest/INSTALLATION.html#development-and-pre-release-versions
If everything goes well, I plan to ship it as part of a new release in a few days.
It looks good to me.
I have tested with the docker image tag 1.23-alpha4-pypy3
and did not notice any regressions.
Testing with the invalid registro.br dump file it seems to work as expected and the invalid line is silently skipped.
Edit: I take it that other errors in the BR data dump file would still trigger printing of the whole file? That might be something to look at if it is not major work...
While I'm here, sorry to derail this issue, but I've noticed some changes in the IX-F JSON export between 1.21.6 and 1.22.1. After I updated from 1.21.6 to 1.22.1 the generated IX-F JSON export file seems to be missing a newline at the last line of the file (and some other issues maybe).
I did not see any relevant changes in a source diff for those versions when I looked into this, eventually I decided to just work around the issues since they were minor. Perhaps some library was updated that caused this change.
Do you think this might warrant its own issue?
First of all I wanted to say thank you so much for your continued work and releasing the new version, seems to work great!
In the release notes for 1.23.0 it links to this issue and mentions that
now logs a warning message and skips the record.
But looking at the PR diff and the master branch file it looks like it just continues silently and does not print a warning?
If I recall correctly that was also corroborated by my testing using an invalid registro.br dump file with a whois err
line.
It is a very, very small issue but I wonder if this was maybe an oversight and it was supposed to print a warning?
Personally I don't have strong feelings for either continue silently or with a warning.
Of course I might be wrong also, just took a new peek at the patch/file after I noticed a possible discrepancy in the release notes. In the case I'm wrong and it prints a warning then please accept my apology for wasting your time (again).
Of course I might be wrong also, just took a new peek at the patch/file after I noticed a possible discrepancy in the release notes. In the case I'm wrong and it prints a warning then please accept my apology for wasting your time (again).
I don't call it "wasting time", but rather "contributing to an OSS project", thanks for you feedback. It's thank to similar feedback and comments that the tool improved over time.
Let me try to explain the changes to that diff in the last release. There were actually 2 changes there:
--whois err--
are now ignored silently;So, there was no intention to print a warning when --whois err--
records were detected, as that's not really a parsing error. Maybe this is where the confusion comes from?
However, I'm also not super sure about how to handle similar situations. It's a bit of a corner case, grey area.
Today 2024-07-15 the Registro.br dump has an invalid record:
It should be noted that the dump file is actually from 2024-07-12 and has not been updated since.
The dump file is available as of now at the arouteserver default location: ftp://ftp.registro.br/pub/numeracao/origin/nicbr-asn-blk-latest.txt
And for downloads in the future, the direct link to data of 2024-07-12: ftp://ftp.registro.br/pub/numeracao/origin/nicbr-asn-blk-20240712.txt
This reveals two possible improvements that could be made in arouteserver:
Error messages
Currently it is difficult to find out where the error is exactly: on error the whole Registro.br dump is printed first and then an error message saying:
Parsing resilience
I think I understand the rationale behind completely stopping processing if the dump file could not be parsed. It will prevent the situation where possibly invalid file ends up with no useful data and then the generated configuration file would be missing all Registro.br dump data.
Edit: It's "Registro.br" and not "NIC.BR"