maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

Daemon suddenly stopped working - BufferUnderflowException

Open eforx opened this issue 3 years ago • 5 comments

After few weeks of using this excellent utility, it suddenly stopped working. Reinstallation did not help.

$ java -version java version "1.8.0_311" Java(TM) SE Runtime Environment (build 1.8.0_311-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)

$ mvnd --version mvnd native client 0.7.1-windows-amd64 (97c587c11383a67b5bd0ff8388bd94c694b91c1e) Terminal: org.jline.terminal.impl.jansi.win.JansiWinSysTerminal

Exception in thread "main" java.nio.BufferUnderflowException
        at java.nio.ByteBuffer.get(ByteBuffer.java:798)
        at java.nio.ByteBuffer.get(ByteBuffer.java:826)
        at org.mvndaemon.mvnd.common.DaemonRegistry.readString(DaemonRegistry.java:303)
        at org.mvndaemon.mvnd.common.DaemonRegistry.doUpdate(DaemonRegistry.java:213)
        at org.mvndaemon.mvnd.common.DaemonRegistry.read(DaemonRegistry.java:164)
        at org.mvndaemon.mvnd.common.DaemonRegistry.getAll(DaemonRegistry.java:102)
        at org.mvndaemon.mvnd.client.DaemonConnector.connect(DaemonConnector.java:101)
        at org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:272)
        at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:118)

eforx avatar May 10 '22 05:05 eforx

The registry may have been corrupted somehow. Could you try deleting the ~/.m2/mvnd/registry directory and try again ?

gnodet avatar May 10 '22 05:05 gnodet

Seems it helps. Thank you very much! Are you interested about corrupted registry.bin file for future investigation?

eforx avatar May 10 '22 05:05 eforx

Sure, please attach it to this issue, I'll try to have a look.

gnodet avatar May 10 '22 07:05 gnodet

@eforx also, you should have seen the warning printed at https://github.com/apache/maven-mvnd/blob/4cea5d30785dbac160b1e140f612e8b99d8dbd04/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java#L252-L255. Isn't that the case ? it should have hinted you at deleting the registry file.

gnodet avatar May 10 '22 07:05 gnodet

The log does not contain mentioned phrase (I attached last log from yesterday also). It also looks like, the daemon stopped creating logs after computer restart (after registry corruption) - no more logs from today, till I removed ~/.m2/mvnd/registry directory.

daemon-239b49e8.log registry_corrupted.zip

eforx avatar May 10 '22 07:05 eforx

we've seen similar errors. has this been fixed and when will 0.8.1 be released?

tedchang77 avatar Aug 29 '22 03:08 tedchang77

Fixed by https://github.com/apache/maven-mvnd/commit/e51416f7f2f6d95add36c06090ff9b5aaa2a705a

gnodet avatar Aug 30 '22 07:08 gnodet