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

Exception on a "strange" source jar #1304

Closed
Arthurm1 opened this issue Jan 14, 2020 · 8 comments · Fixed by #1331
Closed

Exception on a "strange" source jar #1304

Arthurm1 opened this issue Jan 14, 2020 · 8 comments · Fixed by #1331
Labels
improvement Not a bug or a feature, but something general we can improve
Milestone

Comments

@Arthurm1
Copy link
Contributor

I get an exception when importing a build in VSCode

To Reproduce

  1. Include this dependency in your build "com.vladsch.flexmark:flexmark-all:0.35.10"
  2. Import it using VSCode "Import build". Make sure source jars are included.
  3. An exception appears in the "Output" window
  4. Metals continues to work fine after this.
Click for Exception

WARN  jar error: C:\Users\ArthurM\.gradle\caches\modules-2\files-2.1\com.openhtmltopdf\openhtmltopdf-pdfbox\0.0.1-RC13\defc7aea267c6c07c6fc005eb059704bf2fc0675\openhtmltopdf-pdfbox-0.0.1-RC13-sources.jar
java.io.UncheckedIOException: java.nio.file.NoSuchFileException: /Users
	at java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:88)
	at java.nio.file.FileTreeIterator.hasNext(FileTreeIterator.java:104)
	at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
	at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
	at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
	at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:169)
	at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
	at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
	at scala.collection.convert.Wrappers$JIteratorWrapper.hasNext(Wrappers.scala:43)
	at geny.Generator$SelfClosing.generate(Generator.scala:228)
	at geny.Generator$Mapped.generate(Generator.scala:283)
	at geny.Generator.foreach(Generator.scala:49)
	at geny.Generator.foreach$(Generator.scala:49)
	at geny.Generator$Mapped.foreach(Generator.scala:281)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$2(OnDemandSymbolIndex.scala:72)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$2$adapted(OnDemandSymbolIndex.scala:71)
	at scala.meta.internal.io.PlatformFileIO$.withJarFileSystem(PlatformFileIO.scala:86)
	at scala.meta.internal.io.FileIO$.withJarFileSystem(FileIO.scala:43)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$1(OnDemandSymbolIndex.scala:71)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.tryRun(OnDemandSymbolIndex.scala:125)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.addSourceJar(OnDemandSymbolIndex.scala:69)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$addSourceJarSymbols$1(MetalsLanguageServer.scala:1764)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJarTopLevels$1(OnDemandSymbolIndex.scala:94)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.tryRun(OnDemandSymbolIndex.scala:125)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.addSourceJarTopLevels(OnDemandSymbolIndex.scala:93)
	at scala.meta.internal.metals.MetalsLanguageServer.addSourceJarSymbols(MetalsLanguageServer.scala:1753)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$5(MetalsLanguageServer.scala:1721)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$5$adapted(MetalsLanguageServer.scala:1712)
	at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:877)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:876)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$2(MetalsLanguageServer.scala:1712)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$2$adapted(MetalsLanguageServer.scala:1711)
	at scala.collection.Iterator.foreach(Iterator.scala:941)
	at scala.collection.Iterator.foreach$(Iterator.scala:941)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
	at scala.meta.internal.metals.MetalsLanguageServer.indexDependencySources(MetalsLanguageServer.scala:1711)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexWorkspace$9(MetalsLanguageServer.scala:1658)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.meta.internal.metals.MetalsLanguageServer.timedThunk(MetalsLanguageServer.scala:1542)
	at scala.meta.internal.metals.MetalsLanguageServer.indexWorkspace(MetalsLanguageServer.scala:1658)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$connectToNewBuildServer$10(MetalsLanguageServer.scala:1459)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$profiledIndexWorkspace$2(MetalsLanguageServer.scala:1570)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.meta.internal.metals.MetalsLanguageServer.timedThunk(MetalsLanguageServer.scala:1542)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$profiledIndexWorkspace$1(MetalsLanguageServer.scala:1570)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
	at scala.util.Success.$anonfun$map$1(Try.scala:255)
	at scala.util.Success.map(Try.scala:213)
	at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
	at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
	at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.NoSuchFileException: /Users
	at com.sun.nio.zipfs.ZipPath.getAttributes(ZipPath.java:666)
	at com.sun.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:294)
	at java.nio.file.Files.readAttributes(Files.java:1737)
	at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
	at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
	at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
	at java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:84)
	at java.nio.file.FileTreeIterator.hasNext(FileTreeIterator.java:104)
	at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
	at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
	at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
	at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:169)
	at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
	at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
	at scala.collection.convert.Wrappers$JIteratorWrapper.hasNext(Wrappers.scala:43)
	at geny.Generator$SelfClosing.generate(Generator.scala:228)
	at geny.Generator$Mapped.generate(Generator.scala:283)
	at geny.Generator.foreach(Generator.scala:49)
	at geny.Generator.foreach$(Generator.scala:49)
	at geny.Generator$Mapped.foreach(Generator.scala:281)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$2(OnDemandSymbolIndex.scala:72)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$2$adapted(OnDemandSymbolIndex.scala:71)
	at scala.meta.internal.io.PlatformFileIO$.withJarFileSystem(PlatformFileIO.scala:86)
	at scala.meta.internal.io.FileIO$.withJarFileSystem(FileIO.scala:43)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJar$1(OnDemandSymbolIndex.scala:71)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.tryRun(OnDemandSymbolIndex.scala:125)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.addSourceJar(OnDemandSymbolIndex.scala:69)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$addSourceJarSymbols$1(MetalsLanguageServer.scala:1764)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.$anonfun$addSourceJarTopLevels$1(OnDemandSymbolIndex.scala:94)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.tryRun(OnDemandSymbolIndex.scala:125)
	at scala.meta.internal.mtags.OnDemandSymbolIndex.addSourceJarTopLevels(OnDemandSymbolIndex.scala:93)
	at scala.meta.internal.metals.MetalsLanguageServer.addSourceJarSymbols(MetalsLanguageServer.scala:1753)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$5(MetalsLanguageServer.scala:1721)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$5$adapted(MetalsLanguageServer.scala:1712)
	at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:877)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:876)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$2(MetalsLanguageServer.scala:1712)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexDependencySources$2$adapted(MetalsLanguageServer.scala:1711)
	at scala.collection.Iterator.foreach(Iterator.scala:941)
	at scala.collection.Iterator.foreach$(Iterator.scala:941)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
	at scala.meta.internal.metals.MetalsLanguageServer.indexDependencySources(MetalsLanguageServer.scala:1711)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$indexWorkspace$9(MetalsLanguageServer.scala:1658)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.meta.internal.metals.MetalsLanguageServer.timedThunk(MetalsLanguageServer.scala:1542)
	at scala.meta.internal.metals.MetalsLanguageServer.indexWorkspace(MetalsLanguageServer.scala:1658)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$connectToNewBuildServer$10(MetalsLanguageServer.scala:1459)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$profiledIndexWorkspace$2(MetalsLanguageServer.scala:1570)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.meta.internal.metals.MetalsLanguageServer.timedThunk(MetalsLanguageServer.scala:1542)
	at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$profiledIndexWorkspace$1(MetalsLanguageServer.scala:1570)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
	at scala.util.Success.$anonfun$map$1(Try.scala:255)
	at scala.util.Success.map(Try.scala:213)
	at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
	at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
	at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

The jar structure is strange - it has a directory that has no name but 7zip can drill down into it and extract the files.

No other source jars show errors.

Installation:

  • Operating system: Windows
  • Editor: Visual Studio Code
  • Metals version: v0.8.0
@dpfeiffer
Copy link

I have seen the same exception with a couple of webjars as well, but also with different folders that have not been found: /Volumes

@tgodzik
Copy link
Contributor

tgodzik commented Jan 14, 2020

Thanks for reporting! The one @Arthurm1 is connected to openhtmltopdf-pdfbox-0.0.1-RC13-sources.jar - that jar contains a weird entry coming from the library author's computer. We are unable to read that properly, but it's not an issue for Metals. @dpfeiffer /Volumes might be the same case.

This is just a warning. We might need to change that to debug, since it is quite misleading.

@gabro
Copy link
Member

gabro commented Jan 14, 2020

There's not much we can do on our side, apart from maybe handling the error in a less scary way.

I've reported the issue in danfickle/openhtmltopdf#428

@olafurpg
Copy link
Member

Thank you for reporting! Metals should probably not log errors in cases like this. The error shouldn’t cause problems for metals functionality

@Arthurm1
Copy link
Contributor Author

Thanks for the info - I'll close as it's a valid warning.

@olafurpg
Copy link
Member

Reopening since I think Metals should not report such noisy logs for warnings like this.

@olafurpg olafurpg reopened this Jan 14, 2020
@ckipp01 ckipp01 added the improvement Not a bug or a feature, but something general we can improve label Jan 15, 2020
@tgodzik tgodzik added this to the Metals v0.8.1 milestone Feb 25, 2020
@tgodzik tgodzik reopened this Oct 4, 2021
@tgodzik
Copy link
Contributor

tgodzik commented Oct 4, 2021

I reopened it since we might be able to skip the wrong directory when listing everything recursively. Let's investigate this one.

@tgodzik
Copy link
Contributor

tgodzik commented Jul 7, 2022

I haven't seen issues with this recently and just checked again to see how much effort it would be to skip the directory and it seems that would be a bit more complex, so let's leave it a is.

@tgodzik tgodzik closed this as completed Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants