Unable do delete directory

556 views
Skip to first unread message

frank.re...@googlemail.com

unread,
Dec 1, 2016, 11:18:44 AM12/1/16
to SonarLint
While tryint to update the server bindings...

eclipse.buildId=4.6.1.M20160907-1200
java.version=1.8.0_101
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

org.sonarlint.eclipse.core
Error
Thu Dec 01 17:06:21 CET 2016
Unable to update binding for project 'castle.util'

java.lang.IllegalStateException: Unable to delete directory ...\EclipseWorkspace\.sonarlint\storage\bie2-sv00005\modules\xyz
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.deleteDirectory(FileUtils.java:66)
at org.sonarsource.sonarlint.core.container.connected.update.ModuleConfigUpdateExecutor.update(ModuleConfigUpdateExecutor.java:84)
at org.sonarsource.sonarlint.core.container.connected.ConnectedContainer.updateModule(ConnectedContainer.java:86)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.updateModule(ConnectedSonarLintEngineImpl.java:262)
at org.sonarlint.eclipse.core.internal.server.Server.updateProject(Server.java:223)
at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:57)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.nio.file.DirectoryNotEmptyException: ...\2_EclipseWorkspace\.sonarlint\storage\bie2-sv00005\modules\xyz\server_issues\1\d
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.nio.file.Files.delete(Unknown Source)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils$1.postVisitDirectory(FileUtils.java:60)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils$1.postVisitDirectory(FileUtils.java:51)
at java.nio.file.Files.walkFileTree(Unknown Source)
at java.nio.file.Files.walkFileTree(Unknown Source)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.deleteDirectory(FileUtils.java:51)
... 6 more

Julien HENRY

unread,
Dec 2, 2016, 3:00:23 AM12/2/16
to Frank Benoit, SonarLint
Hi Frank,

Saying 'Hi' and 'Thanks' is appreciated.

Could you precise if the error is reproducible if you try to update binding again, or if you encountered it only once (could be a race condition)?

++

Julien

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/dd8b1bf1-28a0-4b63-838c-a1d1792b0dd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

janos....@sonarsource.com

unread,
Dec 2, 2016, 3:57:30 AM12/2/16
to SonarLint, frank.re...@googlemail.com
Hi,

I confirm this problem tends to happen easily, though it's not clear how to reproduce. I created a ticket to track: https://jira.sonarsource.com/browse/SLE-128

I will update the ticket (soon) with a workaround to get out of the broken state until a definitive fix is ready.

Cheers,
Janos
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

alpe...@gmail.com

unread,
Dec 6, 2016, 4:58:33 AM12/6/16
to SonarLint, frank.re...@googlemail.com
Hello,

I am facing same issue and I see issue is related to permission to some metadata file. Before talking anything more, first here is exception stacktrace.

java.lang.IllegalStateException: Unable to delete directory D:\workspace\.sonarlint\modules\MyService\issues
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.deleteDirectory(FileUtils.java:66)
at org.sonarlint.eclipse.core.internal.tracking.IssueStore.clear(IssueStore.java:86)
at org.sonarlint.eclipse.core.internal.tracking.PersistentIssueTrackerCache.clear(PersistentIssueTrackerCache.java:101)
at org.sonarlint.eclipse.core.internal.tracking.IssueTracker.clear(IssueTracker.java:91)
at org.sonarlint.eclipse.core.internal.SonarLintCorePlugin$$Lambda$114/25629167.accept(Unknown Source)
at java.util.Optional.ifPresent(Unknown Source)
at org.sonarlint.eclipse.core.internal.SonarLintCorePlugin.clearIssueTracker(SonarLintCorePlugin.java:194)
at org.sonarlint.eclipse.core.internal.resources.SonarLintProject.unbind(SonarLintProject.java:111)
at org.sonarlint.eclipse.ui.internal.server.UnbindProjectDialog$UnbindProjectJob.run(UnbindProjectDialog.java:82)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.nio.file.DirectoryNotEmptyException: D:\workspace\.sonarlint\modules\MyService\issues\d\c
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.nio.file.Files.delete(Unknown Source)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils$1.postVisitDirectory(FileUtils.java:60)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils$1.postVisitDirectory(FileUtils.java:51)
at java.nio.file.Files.walkFileTree(Unknown Source)
at java.nio.file.Files.walkFileTree(Unknown Source)
at org.sonarsource.sonarlint.core.client.api.util.FileUtils.deleteDirectory(FileUtils.java:51)
... 9 more



I see it comes because one of the file under server_issues folder has no permission even for admin user. When I see file properties/security tab, I see no user has read permission on that file (including admin) and I can't see owner also (Windows 10 machine). Now error comes when I update all project bindings, Sonarlint tries to delete module folder and create new one. During delete process, it is not able to delete that particular file (I see similar files in some other folders like 1/f/  2/b not giving that issue). Another point to note is, when I close eclipse, that file automatically gets deleted.  Note that however, module delete operation during update bindings, deletes configuration.pb of that module. So after that every time automatic analysis runs, it says couldn't find configuration.pb file. And then I don't have any other option but to close eclipse and delete whole module folder and rebind project (without closing eclipse can't delete module folder).

Hope this helps in analysis.

Regards,
Alpesh

Janos Gyerik

unread,
Dec 6, 2016, 5:01:51 AM12/6/16
to alpe...@gmail.com, SonarLint, frank.re...@googlemail.com
Hi,

As you can see on the ticket I linked earlier in the thread (https://jira.sonarsource.com/browse/SLE-128), this fix is scheduled for the 2.5 release, coming up soon. Until then, if this happens, I'm afraid you have to close Eclipse and manually delete the problematic directory.

Janos


--
You received this message because you are subscribed to a topic in the Google Groups "SonarLint" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarlint/MDSTthrdB6c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/9cc14ec6-744d-457d-823e-5429733cf304%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Janos GYERIK | SonarSource

alpe...@gmail.com

unread,
Dec 6, 2016, 6:41:42 AM12/6/16
to SonarLint, alpe...@gmail.com, frank.re...@googlemail.com
yes fine. My point was just to provide additional information that this file which is not getting deleted, even admin has no read permission for that and couldn't see file owner information. So something related to file permission.

regards,
Alpesh
To unsubscribe from this group and all its topics, send an email to sonarlint+...@googlegroups.com.

Janos Gyerik

unread,
Dec 6, 2016, 6:52:24 AM12/6/16
to alpe...@gmail.com, SonarLint, frank.re...@googlemail.com
Hi Alpesh,

It's interesting that Windows gives a permission denied error in this situation. In fact the issue has nothing to do with filesystem permissions, the underlying problem is file locking. The problem is due to some leaked resources, file handles that were not closed correctly by SonarLint. Closing Eclipse closes those files, and then they can be deleted, by your own user, without permission issues. I hope this answers your question. The 2.5 release is coming very soon.

Cheers,
Janos

 

To unsubscribe from this group and all its topics, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/0764bfa4-5f21-40a6-ba40-03d959b7da24%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

alpe...@gmail.com

unread,
Dec 12, 2016, 6:50:01 AM12/12/16
to SonarLint, alpe...@gmail.com, frank.re...@googlemail.com
Thanks for your explanation.  Yes, I saw that 2.5 is released for feedback and it has already solved my issue. Thumbs up for that.

regards,
Alpesh
To unsubscribe from this group and all its topics, send an email to sonarlint+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages