fflewddur / archivo

A cross-platform app for saving recordings from a TiVo to your computer.
http://straylightlabs.net/archivo/
GNU General Public License v3.0
27 stars 7 forks source link

If you change the folder name during the archive process, you get an IOException #29

Closed wanderlust79 closed 8 years ago

wanderlust79 commented 9 years ago

Steps to reproduce on OS X El Capitan:

Archivo will fail with the following stacktrace:

09:21:56.650 [pool-3-thread-1] INFO net.straylightlabs.archivo.Archivo - URL: http://192.168.29.121/download/Quantico.TiVo?Container=%2FNowPlaying&id=47150&Format=video/x-tivo-mpeg-ts 09:21:56.650 [pool-3-thread-1] INFO net.straylightlabs.archivo.Archivo - Saving file to /Users/rchavez/Movies/untitled folder/Quantico - S01E07 - Go.download.ts 09:21:56.671 [JavaFX Application Thread] INFO net.straylightlabs.archivo.Archivo - Setting status to 'Archiving Quantico — Go...' 09:21:57.254 [pool-3-thread-1] INFO net.straylightlabs.archivo.Archivo - Status line: HTTP/1.1 200 File Follows 09:21:57.254 [pool-3-thread-1] INFO net.straylightlabs.archivo.Archivo - decrypt = true 09:21:57.260 [pool-3-thread-1] ERROR net.straylightlabs.archivo.Archivo - IOException while downloading recording: java.nio.file.NoSuchFileException: /Users/rchavez/Movies/untitled folder/Quantico - S01E07 - Go.download.ts at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) ~[na:1.8.0_65] at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_65] at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_65] at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[na:1.8.0_65] at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[na:1.8.0_65] at java.nio.file.Files.newOutputStream(Files.java:216) ~[na:1.8.0_65] at net.straylightlabs.archivo.controller.ArchiveTask.handleResponse(ArchiveTask.java:196) [Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.getRecording(ArchiveTask.java:162) [Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.archive(ArchiveTask.java:108) [Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.call(ArchiveTask.java:86) [Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.call(ArchiveTask.java:59) [Archivo.jar:na] at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) [jfxrt.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_65] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_65] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65] 09:21:57.261 [JavaFX Application Thread] ERROR net.straylightlabs.archivo.Archivo - ArchiveTask failed for Quantico — Go: net.straylightlabs.archivo.controller.ArchiveTaskException: Problem downloading recording at net.straylightlabs.archivo.controller.ArchiveTask.handleResponse(ArchiveTask.java:266) ~[Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.getRecording(ArchiveTask.java:162) ~[Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.archive(ArchiveTask.java:108) ~[Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.call(ArchiveTask.java:86) ~[Archivo.jar:na] at net.straylightlabs.archivo.controller.ArchiveTask.call(ArchiveTask.java:59) ~[Archivo.jar:na] at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) ~[jfxrt.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_65] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_65] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_65] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_65] net.straylightlabs.archivo.controller.ArchiveTaskException: Problem downloading recording at net.straylightlabs.archivo.controller.ArchiveTask.handleResponse(ArchiveTask.java:266) at net.straylightlabs.archivo.controller.ArchiveTask.getRecording(ArchiveTask.java:162) at net.straylightlabs.archivo.controller.ArchiveTask.archive(ArchiveTask.java:108) at net.straylightlabs.archivo.controller.ArchiveTask.call(ArchiveTask.java:86) at net.straylightlabs.archivo.controller.ArchiveTask.call(ArchiveTask.java:59) at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 09:21:57.262 [JavaFX Application Thread] INFO net.straylightlabs.archivo.Archivo - TaskStatus cleared 09:28:28.604 [JavaFX Application Thread] INFO net.straylightlabs.archivo.Archivo - Setting extension filter: Standard H.264 Files 09:28:28.608 [JavaFX Application Thread] INFO net.straylightlabs.archivo.Archivo - Last folder = /Users/rchavez/Movies/untitled folder Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774) at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Node.fireEvent(Node.java:8411) at javafx.scene.control.Button.fire(Button.java:185) at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182) at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96) at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$MouseHandler.process(Scene.java:3757) at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387) at com.sun.glass.ui.View.handleMouseEvent(View.java:555) at com.sun.glass.ui.View.notifyMouse(View.java:937) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769) ... 45 more Caused by: java.lang.IllegalArgumentException: Folder parameter must be a valid folder at com.sun.glass.ui.CommonDialogs.convertFolder(CommonDialogs.java:238) at com.sun.glass.ui.CommonDialogs.showFileChooser(CommonDialogs.java:190) at com.sun.javafx.tk.quantum.QuantumToolkit.showFileChooser(QuantumToolkit.java:1496) at javafx.stage.FileChooser.showDialog(FileChooser.java:416) at javafx.stage.FileChooser.showSaveDialog(FileChooser.java:392) at net.straylightlabs.archivo.view.RecordingDetailsController.showSaveDialog(RecordingDetailsController.java:146) at net.straylightlabs.archivo.view.RecordingDetailsController.archive(RecordingDetailsController.java:111) ... 55 more 09:28:33.587 [JavaFX Application Thread] INFO net.straylightlabs.archivo.Archivo - Setting extension filter: Standard H.264 Files 09:28:33.587 [JavaFX Application Thread] INFO net.straylightlabs.archivo.Archivo - Last folder = /Users/rchavez/Movies/untitled folder Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774) at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Node.fireEvent(Node.java:8411) at javafx.scene.control.Button.fire(Button.java:185) at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182) at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96) at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$MouseHandler.process(Scene.java:3757) at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387) at com.sun.glass.ui.View.handleMouseEvent(View.java:555) at com.sun.glass.ui.View.notifyMouse(View.java:937) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769) ... 45 more Caused by: java.lang.IllegalArgumentException: Folder parameter must be a valid folder at com.sun.glass.ui.CommonDialogs.convertFolder(CommonDialogs.java:238) at com.sun.glass.ui.CommonDialogs.showFileChooser(CommonDialogs.java:190) at com.sun.javafx.tk.quantum.QuantumToolkit.showFileChooser(QuantumToolkit.java:1496) at javafx.stage.FileChooser.showDialog(FileChooser.java:416) at javafx.stage.FileChooser.showSaveDialog(FileChooser.java:392) at net.straylightlabs.archivo.view.RecordingDetailsController.showSaveDialog(RecordingDetailsController.java:146) at net.straylightlabs.archivo.view.RecordingDetailsController.archive(RecordingDetailsController.java:111) ... 55 more

Once this happens though it seems the concept of the "Last Folder" doesn't ever get reset and it still thinks it should be pointing at "untitled folder".

Even quitting the app and restarting it doesn't fix it it seems.

wanderlust79 commented 9 years ago

It seems to be this plist entry that gets hung up and unable to be reset: NSNavLastCurrentDirectory. And the lastFolder tag in /net/straylightlabs/archivo/knownTivos/. Editing the second property lastFolder seems to have fixed it. Updating NSNavLastCurrentDirectory didn't have any impact on this particular problem.

Maybe in the next revision, you can add a simple control panel that exposes properties like this so they can be quickly reset without navigating a plist editor?

Nice interface though! Testing it out now.

fflewddur commented 9 years ago

I've fixed the problem with Archivo getting stuck trying to use a non-existant folder as its default folder, but I haven't been able to replicate the exception. Just to verify, when you talk about creating a folder and renaming it, are you doing this through the Save dialog from Archivo, or a standard Finder window? On my system, renaming the folder causes the Save dialog to go up a directory in the hierarchy, and from there I can see the renamed folder and save to it correctly.

fflewddur commented 8 years ago

Haven't been able to reproduce this; closing.