whois icon indicating copy to clipboard operation
whois copied to clipboard

NrtmClientFactory getting IllegalStateException (Unexpected response from NRTM server)

Open devnull-mr opened this issue 6 years ago • 0 comments

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: https://github.com/RIPE-NCC/whois/blob/f2278b6e8cf97d8088b2261c00ddd95c53a2f51d/whois-nrtm/src/main/java/net/ripe/db/whois/nrtm/client/NrtmClientFactory.java#L35

so it only knows ADD and DEL, but not END, which is why it is failing in readOperationAndSerial(): https://github.com/RIPE-NCC/whois/blob/f2278b6e8cf97d8088b2261c00ddd95c53a2f51d/whois-nrtm/src/main/java/net/ripe/db/whois/nrtm/client/NrtmClientFactory.java#L229-L232

devnull-mr avatar Apr 05 '18 12:04 devnull-mr