Skip to content

NrtmClientFactory getting IllegalStateException (Unexpected response from NRTM server) #480

@devnull-mr

Description

@devnull-mr

Hi,

we are using Bootstrap and NRTM as per documentation.

Now, when starting the whois server locally it connects fine to the NRTM service:

[NrtmClientFactory] Connected to whois.ripe.net:4444
[NrtmClientFactory] %START Version: 3 RIPE 41429898-41453941

It then starts to load the updates to the WHOIS_MIRROR_RIPE_GRS Database until it has reached the serial number mentioned above:

select max(serial_id) from WHOIS_MIRROR_RIPE_GRS.serials;
+----------------+
| max(serial_id) |
+----------------+
|       41453941 |
+----------------+
1 row in set (0.01 sec)

But then, once it has loaded the latest serial, it gets an IllegalStateException:

ERROR [NrtmClientFactory] caught java.lang.IllegalStateException, cannot import from source RIPE-GRS, stopping.
ERROR [NrtmClientFactory] Unexpected response from NRTM server: "%END 41429898 - 41453941"
java.lang.IllegalStateException: Unexpected response from NRTM server: "%END 41429898 - 41453941"
	at net.ripe.db.whois.nrtm.client.NrtmClientFactory$NrtmClient.readOperationAndSerial(NrtmClientFactory.java:231)
	at net.ripe.db.whois.nrtm.client.NrtmClientFactory$NrtmClient.readUpdates(NrtmClientFactory.java:181)
	at net.ripe.db.whois.nrtm.client.NrtmClientFactory$NrtmClient.run(NrtmClientFactory.java:86)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

After that, the whois server keeps running and I can sent queries to it, but it no longer gets any new updates via NRTM.
Only if I stop and restart the whois server it gets the next serials via NRTM but then runs into the same issue again.

I am running

INFO  [WhoisServer] Running version: 1.92-SNAPSHOT

which was compiled from the git master branch on March 26th.

Has the protocol changed recently ?

NrtmClientFactory has this on line 35:

private static final Pattern OPERATION_AND_SERIAL_PATTERN = Pattern.compile("^(ADD|DEL)[ ](\\d+)$");

so it only knows ADD and DEL, but not END, which is why it is failing in readOperationAndSerial():

final Matcher matcher = OPERATION_AND_SERIAL_PATTERN.matcher(line);
if (!matcher.find()) {
throw new IllegalStateException("Unexpected response from NRTM server: \"" + line + "\"");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions