Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import projects because BasicFileDetector could not scan dirs #2855

Closed
testforstephen opened this issue Sep 15, 2023 · 3 comments · Fixed by #2905
Closed

Failed to import projects because BasicFileDetector could not scan dirs #2855

testforstephen opened this issue Sep 15, 2023 · 3 comments · Fixed by #2905

Comments

@testforstephen
Copy link
Contributor

Failed to import projects
Failed to scan <REDACTED: user-file-path>
org.eclipse.core.runtime.CoreException: Failed to scan <REDACTED: user-file-path>
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:140)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:154)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:151)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:114)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:260)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.NoSuchFileException: <REDACTED: user-file-path>
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>$Basic.readAttributes(Unknown Source)
	at <REDACTED: user-file-path>$Basic.readAttributes(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:178)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:138)
	... 6 more
Failed to import projects
Failed to scan <REDACTED: user-file-path>
org.eclipse.core.runtime.CoreException: Failed to scan <REDACTED: user-file-path>
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:140)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:154)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:151)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:114)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:260)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.AccessDeniedException: <REDACTED: user-file-path>
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:178)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:138)
	... 6 more
Failed to import projects
Failed to scan <REDACTED: user-file-path>
org.eclipse.core.runtime.CoreException: Failed to scan <REDACTED: user-file-path>
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:140)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:154)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:151)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:114)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:260)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.FileSystemException: <REDACTED: user-file-path> <file>: Operation not permitted
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at <REDACTED: user-file-path>(Unknown Source)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:178)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:138)
	... 6 more

@jdneo
Copy link
Contributor

jdneo commented Oct 11, 2023

One related issue: redhat-developer/vscode-java#1156

@testforstephen
Copy link
Contributor Author

Another duplicated issue: redhat-developer/vscode-java#3137

@rgrunber rgrunber added this to the End October 2023 milestone Oct 11, 2023
@testforstephen
Copy link
Contributor Author

A reproducing step is to open a user home directory in VS Code, you probably get the scan error of AccessDeniedException due to some folder inaccessible. For example, on macOS, opening the home directory in VS Code, the language server scanner will throw error "Library.photoslibrary: Operation not permitted" and abort. Meanwhile, looking at the VS Code file explorer behavior, it just doesn't list the photo library tree if permission is not allowed. So In java language server, we can follow the same strategy and ignore the disallowed directory and continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants