Error in SonarLint for IntelliJ trying to create directory on read-only volume

An IllegalStateException occurs when attempting to open a project configured with SonarLint in IntelliJ from a read-only volume. In the stack trace below, /Volumes/Personal is a read-only .dmg hard drive image. This should really notify the user with an option to never view the error again for this project instead of throwing an exception.

Environment:

  • Java: JetBrains s.r.o. 11.0.13
  • OS: Mac OS X x86_64
  • IDE: IntelliJ IDEA 2021.2.4
  • SonarLint: 6.5.1.43866
java.lang.IllegalStateException: Unable to create directory: /Volumes/Personal/code/my-service/.idea/sonarlint/issuestore
	at o.ss.sl.core.client.api.util.FileUtils.mkdirs(FileUtils.java:208)
	at o.sl.ij.issue.persistence.IssuePersistence.<init>(IssuePersistence.java:47)
	at jdk.internal.reflect.GeneratedConstructorAccessor1919.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at c.ij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:52)
	at c.ij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:877)
	at c.ij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:48)
	at c.ij.serviceContainer.ServiceComponentAdapter.access$createAndInitialize(ServiceComponentAdapter.kt:12)
	at c.ij.serviceContainer.ServiceComponentAdapter$doCreateInstance$1.run(ServiceComponentAdapter.kt:42)
	at c.ij.oa.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
	at c.ij.oa.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
	at c.ij.oa.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
	at c.ij.oa.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:223)
1 Like

Hello @cwillwe,

May I ask you why you need to open a project in IntelliJ from a read-only volume ? One of our assumption is that if you open a project in an IDE you might want to modify it at some point, so I want to understand your use case.

For the moment the only workaround I can think of is to open the project from a writable folder/volume.

2 Likes