Error in SonarLint for IntelliJ - 10.11: AlreadyDisposedException

Environment:

  • Java: JetBrains s.r.o. 21.0.4
  • OS: Linux amd64
  • IDE: IntelliJ IDEA 2024.2.3
  • SonarLint: 10.11.0.79648

While restarting IntelliJ, every time on IntelliJ restart, since I upgraded to IntelliJ 2024.2 and latest Sonarlint.

c.ij.serviceContainer.AlreadyDisposedException: VFS is already closed (disposed)
	at c.ij.oa.vfs.newvfs.persistent.FSRecordsImpl.alreadyClosedException(FSRecordsImpl.java:467)
	at c.ij.oa.vfs.newvfs.persistent.FSRecordsImpl.handleError(FSRecordsImpl.java:1382)
	at c.ij.oa.vfs.newvfs.persistent.FSRecordsImpl.writeContent(FSRecordsImpl.java:1326)
	at c.ij.oa.vfs.newvfs.persistent.PersistentFSImpl.writeContent(PersistentFSImpl.java:491)
	at c.ij.oa.vfs.newvfs.persistent.PersistentFSImpl.contentsToByteArray(PersistentFSImpl.java:838)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileImpl.contentsToByteArray(VirtualFileImpl.java:120)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileImpl.contentsToByteArray(VirtualFileImpl.java:109)
	at c.ij.oa.vfs.VfsUtilCore.loadBytes(VfsUtilCore.java:415)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileSystemEntry.computeCharset(VirtualFileSystemEntry.java:500)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileSystemEntry.getCharset(VirtualFileSystemEntry.java:483)
	at o.sl.ij.SonarLintIntelliJClient.toClientFileDto(SonarLintIntelliJClient.kt:798)
	at o.sl.ij.SonarLintIntelliJClient.listProjectFiles(SonarLintIntelliJClient.kt:758)
	at o.sl.ij.SonarLintIntelliJClient.listFiles$lambda$30$lambda$29(SonarLintIntelliJClient.kt:680)
	at o.sl.ij.util.ThreadUtilsKt.computeOnPooledThread$lambda$2(ThreadUtils.kt:47)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:162)
	at c.ij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at c.ij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)
	Suppressed: c.ij.util.io.ClosedStorageException: Storage already closed
		at c.ij.platform.util.io.storages.mmapped.MMappedFileStorage.pageByIndexLocked(MMappedFileStorage.java:414)
		at c.ij.platform.util.io.storages.mmapped.MMappedFileStorage.pageByIndex(MMappedFileStorage.java:243)
		at c.ij.platform.util.io.storages.mmapped.MMappedFileStorage.pageByOffset(MMappedFileStorage.java:228)
		at c.ij.platform.util.io.storages.appendonlylog.AppendOnlyLogOverMMappedFile.append(AppendOnlyLogOverMMappedFile.java:530)
		at c.ij.oa.vfs.newvfs.persistent.dev.content.VFSContentStorageOverMMappedFile.lambda$storeRecord$3(VFSContentStorageOverMMappedFile.java:222)
		at c.ij.platform.util.io.storages.intmultimaps.extendiblehashmap.ExtendibleHashMap.lookupOrInsert(ExtendibleHashMap.java:212)
		at c.ij.oa.vfs.newvfs.persistent.dev.content.VFSContentStorageOverMMappedFile.storeRecord(VFSContentStorageOverMMappedFile.java:182)

Hello @fcsonar, thanks for notifying us about this. I’m not aware of such an issue, and I’m not exactly sure how SonarLint could be responsible for it.

  • Could you try deleting the cache under ~/.cache/JetBrains/IntelliJIdea2024.2
  • Could you try without SonarLint and see if you face the same issue
  • Testing on another project or with another IDE version could be great as well

In the meantime, we are going to further investigate.

Environment:

  • Java: JetBrains s.r.o. 21.0.4
  • OS: Mac OS X x86_64
  • IDE: IntelliJ IDEA 2024.2.3
  • SonarLint: 10.11.0.79648
c.ij.serviceContainer.AlreadyDisposedException: VFS is already closed (disposed)
	at c.ij.oa.vfs.newvfs.persistent.FSRecordsImpl.alreadyClosedException(FSRecordsImpl.java:467)
	at c.ij.oa.vfs.newvfs.persistent.FSRecordsImpl.handleError(FSRecordsImpl.java:1382)
	at c.ij.oa.vfs.newvfs.persistent.FSRecordsImpl.writeContent(FSRecordsImpl.java:1326)
	at c.ij.oa.vfs.newvfs.persistent.PersistentFSImpl.writeContent(PersistentFSImpl.java:491)
	at c.ij.oa.vfs.newvfs.persistent.PersistentFSImpl.contentsToByteArray(PersistentFSImpl.java:838)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileImpl.contentsToByteArray(VirtualFileImpl.java:120)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileImpl.contentsToByteArray(VirtualFileImpl.java:109)
	at c.ij.oa.vfs.VfsUtilCore.loadBytes(VfsUtilCore.java:415)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileSystemEntry.computeCharset(VirtualFileSystemEntry.java:500)
	at c.ij.oa.vfs.newvfs.impl.VirtualFileSystemEntry.getCharset(VirtualFileSystemEntry.java:483)
	at o.sl.ij.SonarLintIntelliJClient.toClientFileDto(SonarLintIntelliJClient.kt:798)
	at o.sl.ij.SonarLintIntelliJClient.listModuleFiles(SonarLintIntelliJClient.kt:736)
	at o.sl.ij.SonarLintIntelliJClient.listFiles$lambda$27$lambda$26(SonarLintIntelliJClient.kt:677)
	at o.sl.ij.util.ThreadUtilsKt.computeOnPooledThread$lambda$2(ThreadUtils.kt:47)
	at c.ij.oa.ap.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:162)
	at c.ij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at c.ij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)
	Suppressed: c.ij.util.io.ClosedStorageException: Storage already closed
		at c.ij.platform.util.io.storages.mmapped.MMappedFileStorage.pageByIndexLocked(MMappedFileStorage.java:414)
		at c.ij.platform.util.io.storages.mmapped.MMappedFileStorage.pageByIndex(MMappedFileStorage.java:243)
		at c.ij.platform.util.io.storages.mmapped.MMappedFileStorage.pageByOffset(MMappedFileStorage.java:228)
		at c.ij.platform.util.io.storages.appendonlylog.AppendOnlyLogOverMMappedFile.append(AppendOnlyLogOverMMappedFile.java:530)
		at c.ij.oa.vfs.newvfs.persistent.dev.content.VFSContentStorageOverMMappedFile.lambda$storeRecord$3(VFSContentStorageOverMMappedFile.java:222)
		at c.ij.platform.util.io.storages.intmultimaps.extendiblehashmap.ExtendibleHashMap.lookupOrInsert(ExtendibleHashMap.java:212)
		at c.ij.oa.vfs.newvfs.persistent.dev.content.VFSContentStorageOverMMappedFile.storeRecord(VFSContentStorageOverMMappedFile.java:182)
		at c.ij.oa.vfs.newvfs.persistent.PersistentFSContentAccessor.writeContent(PersistentFSContentAccessor.java:46)

Hi @Lugas_Septiawan,

Welcome to the community and thanks for this report!

I’ve combined your thread with another one with the same error. Per an earlier post from the team,

 
Thx,
Ann

For your information, we will release a new version early next week including changes on this area. I’m still unsure in which way SonarLint is responsible for this issue, but you should hopefully see an amelioration.

1 Like
  • Could you try without SonarLint and see if you face the same issue

Yes, I tried this.

Without SonarLint, there is no issue.

  • Could you try deleting the cache under ~/.cache/JetBrains/IntelliJIdea2024.2

I tried this, then reinstalled SonarLint.
Issue is reproduced again.

  • Testing on another project or with another IDE version could be great as well

With earlier IntelliJ version (2023) and earlier SonarLint, there was no problem.

Thanks for the details. Just for confirmation, have you tried with SonarLint 10.11.1, which was released this week?

Thanks Nicolas.

I have installed SonarLint 10.11.1
Then restarted IntelliJ two times
Then I don’t reproduce the issue anymore.

SonarLint now works.

2 Likes

Super, thank you for letting us know!

If you enjoy SonarLint for IntelliJ, do not hesitate to leave a review on our marketplace page, it’s always appreciated :sonarlint:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.