marian-m12l / studio

STUdio - Story Teller Unleashed
https://marian-m12l.github.io/studio-website/
Mozilla Public License 2.0
710 stars 132 forks source link

Failed to add pack to device #466

Closed kralimah23 closed 4 months ago

kralimah23 commented 4 months ago

Description

When drag-and-drop library to device, error message "Failed to add pack to device" appears

To Reproduce

Last time this operation worked I was using Studio 0.3.1. Recently I wanted to add new stories, saw that there was an update available (0.4.0) and updated. Since then I didn't manage manage to upload a pack, even after switching back to 0.3.1.

The issue appeared with my custom library, but also with the example library (Alice and Bob).

Logs

2024-07-20 08:07:30,942 [DEBUG] [s.d.f.FsStoryTellerAsyncDriver]: Number of packs in index: 2
2024-07-20 08:07:30,943 [DEBUG] [s.d.f.FsStoryTellerAsyncDriver]: Pack UUID: c4139d59-872a-4d15-8cf1-76d34cdf38c6
2024-07-20 08:07:30,943 [DEBUG] [s.d.f.FsStoryTellerAsyncDriver]: Pack version: 2
2024-07-20 08:07:30,949 [DEBUG] [s.d.f.FsStoryTellerAsyncDriver]: Pack UUID: d489f67b-0e51-4669-b1e1-1555f3c18541
2024-07-20 08:07:30,950 [DEBUG] [s.d.f.FsStoryTellerAsyncDriver]: Pack version: 1
2024-07-20 08:07:30,951 [INFO ] [s.w.s.StoryTellerService]: Transferring pack folder to device: C:\Users\Seb\.studio\library\1fb4f5c7-150d-4ed4-bd37-1d86fcc41170.converted_1721455566126
2024-07-20 08:07:30,957 [DEBUG] [s.d.f.FsStoryTellerAsyncDriver]: Uploading pack to folder: D:\\.content\FCC41170
2024-07-20 08:07:30,963 [TRACE] [s.d.f.FsStoryTellerAsyncDriver]: Copying file C:\Users\Seb\.studio\library\1fb4f5c7-150d-4ed4-bd37-1d86fcc41170.converted_1721455566126\li to D:\.content\FCC41170\li (108 bytes)
2024-07-20 08:07:30,964 [ERROR] [s.w.s.StoryTellerService]: Failed to add pack to device
java.util.concurrent.CompletionException: studio.driver.StoryTellerException: Failed to copy pack folder
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1841)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: studio.driver.StoryTellerException: Failed to copy pack folder
        at studio.driver.fs.FsStoryTellerAsyncDriver.lambda$copyPackFolder$20(FsStoryTellerAsyncDriver.java:495)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at studio.driver.fs.FsStoryTellerAsyncDriver.copyPackFolder(FsStoryTellerAsyncDriver.java:465)
        at studio.driver.fs.FsStoryTellerAsyncDriver.lambda$uploadPack$12(FsStoryTellerAsyncDriver.java:405)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        ... 6 more
Caused by: java.nio.file.FileAlreadyExistsException: D:\.content\FCC41170\li
        at java.base/sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:124)
        at java.base/sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:284)
        at java.base/java.nio.file.Files.copy(Files.java:1304)
        at studio.driver.fs.FsStoryTellerAsyncDriver.lambda$copyPackFolder$20(FsStoryTellerAsyncDriver.java:476)
        ... 19 more

Desktop and environment (please complete the following information):

Vivaldi 6.8.3381.46 (Stable channel) (64-bit) Revision fc048ddc979dd4b5812491cce07da57059e0bbae OS Windows 10 Version 22H2 (Build 19045.4651) JavaScript V8 12.6.228.21 User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Lunii FW version: 2.7

marian-m12l commented 4 months ago

Thanks for the feedback. Sounds like you already have a folder for the same pack id on your device (D:\.content\FCC41170). Could be residual from a failed transfer. Can you move it out of the device partition (or rename it) and try again? I think STUdio could handle this situation better, though...

kralimah23 commented 4 months ago

Thanks, somehow I missed this line in the log... I deleted the folder FCC41170 and I'm now able to add the pack to device without issues. Thanks for the quick support and the great work you did on STUdio!