Skip to content

fix(amazonq): Files.move will throw if src / dest are in different volumes #5733

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

Merged
merged 3 commits into from
May 19, 2025

Conversation

Will-ShaoHua
Copy link
Contributor

@Will-ShaoHua Will-ShaoHua commented May 19, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Failed to download/move LSP artifacts on attempt 1

[backend] java.lang.IllegalStateException: Failed to move files from /tmp/lsp-dl2895875964183621038 to /home/richali/.cache/aws/toolkits/language-servers/AmazonQ-JetBrains-temp/1.3.0
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.LspUtilsKt.moveFilesFromSourceToDestination(LspUtils.kt:73)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.ArtifactHelper$tryDownloadLspArtifacts$3.invokeSuspend(ArtifactHelper.kt:123)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.ArtifactHelper$tryDownloadLspArtifacts$3.invoke(ArtifactHelper.kt)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.ArtifactHelper$tryDownloadLspArtifacts$3.invoke(ArtifactHelper.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.platform.util.progress.ProgressPipeImpl.collectProgressUpdates(ProgressPipe.kt:43)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2$2.invokeSuspend(PlatformTaskSupport.kt:109)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2$2.invoke(PlatformTaskSupport.kt)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2$2.invoke(PlatformTaskSupport.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:155)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2.invokeSuspend(PlatformTaskSupport.kt:108)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2.invoke(PlatformTaskSupport.kt)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport$withBackgroundProgressInternal$2.invoke(PlatformTaskSupport.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
	at com.intellij.openapi.progress.impl.PlatformTaskSupport.withBackgroundProgressInternal(PlatformTaskSupport.kt:93)
	at com.intellij.platform.ide.progress.TasksKt.withBackgroundProgress(tasks.kt:79)
	at com.intellij.platform.ide.progress.TasksKt.withBackgroundProgress(tasks.kt:32)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.ArtifactHelper.tryDownloadLspArtifacts(ArtifactHelper.kt:117)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.ArtifactManager$fetchArtifact$4$1$1.invokeSuspend(ArtifactManager.kt:82)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Caused by: [backend] java.nio.file.DirectoryNotEmptyException: /tmp/lsp-dl2895875964183621038
	at java.base@21.0.6/sun.nio.fs.UnixFileSystem.ensureEmptyDir(UnixFileSystem.java:839)
	at java.base@21.0.6/sun.nio.fs.UnixFileSystem.move(UnixFileSystem.java:945)
	at java.base@21.0.6/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:309)
	at java.base@21.0.6/java.nio.file.Files.move(Files.java:1431)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.LspUtilsKt.moveFilesFromSourceToDestination(LspUtils.kt:71)
	... 29 more

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Will-ShaoHua Will-ShaoHua requested a review from a team as a code owner May 19, 2025 19:19
@Will-ShaoHua Will-ShaoHua changed the title file fix(amazonq): Files.move will threw if src / dest are different volumes May 19, 2025
…olkits/jetbrains/services/amazonq/lsp/artifacts/LspUtils.kt

Co-authored-by: Richard Li <742829+rli@users.noreply.github.com>
@Will-ShaoHua
Copy link
Contributor Author

/retryBuilds

@Will-ShaoHua Will-ShaoHua changed the title fix(amazonq): Files.move will threw if src / dest are different volumes fix(amazonq): Files.move will throw if src / dest are different volumes May 19, 2025
@Will-ShaoHua Will-ShaoHua changed the title fix(amazonq): Files.move will throw if src / dest are different volumes fix(amazonq): Files.move will throw if src / dest are in different volumes May 19, 2025
@Will-ShaoHua Will-ShaoHua merged commit b57c9d6 into aws:feature/q-lsp-chat May 19, 2025
11 of 12 checks passed
@Will-ShaoHua Will-ShaoHua deleted the mv branch May 19, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants