Cyberduck Mountain Duck CLI

#6410 closed defect (fixed)

Exception thrown on negative timestamp - "Transfer Incomplete"

Reported by: Yaoyao Owned by: dkocher
Priority: normal Milestone: 4.2.1
Component: core Version: 4.2
Severity: normal Keywords:
Cc: Architecture:
Platform:

Description

Hi,

I noticed that on downloading a folder (using FTP), Cyberduck shows "Transfer Incomplete" message. After turning on verbose logging, I noticed the following stack trace:

2011-11-30 11:22:21,952 [background-5] INFO ch.cyberduck.core.DownloadTransfer - Updating timestamp of C:\Users\Username\Desktop\FTP\FTP to -57600000 
2011-11-30 11:22:21,952 [background-5] DEBUG ch.cyberduck.core.Transfer - fireTransferDidEnd:ch.cyberduck.core.DownloadTransfer@f1591a 
2011-11-30 11:22:21,952 [background-5] DEBUG ch.cyberduck.core.TransferCollection - numberOfRunningTransfers:0 
2011-11-30 11:22:21,952 [Thread-0] DEBUG ch.cyberduck.core.TransferCollection - numberOfRunningTransfers:0 
2011-11-30 11:22:21,952 [Thread-0] DEBUG ch.cyberduck.core.TransferCollection - numberOfQueuedTransfers:0 
2011-11-30 11:22:21,952 [background-5] DEBUG ch.cyberduck.core.Transfer - poll 
2011-11-30 11:22:21,952 [background-5] ERROR ch.cyberduck.ui.AbstractController - Exception running background task:Negative time 
java.lang.IllegalArgumentException: Negative time 
at java.io.File.setLastModified(File.java:1272) 
at ch.cyberduck.core.Local.writeTimestamp(Local.java:449) 
at ch.cyberduck.core.DownloadTransfer$DownloadTransferFilter.complete(DownloadTransfer.java:239) 
at ch.cyberduck.core.Transfer.transfer(Transfer.java:492) 
at ch.cyberduck.core.Transfer.transfer(Transfer.java:600) 
at ch.cyberduck.core.Transfer.transfer(Transfer.java:565) 
at ch.cyberduck.core.Transfer.start(Transfer.java:705) 
at cli.Ch.Cyberduck.Ui.Controller.TransferController$TransferBackgroundAction.run(Unknown Source) 
at ch.cyberduck.core.threading.AbstractBackgroundAction.call(AbstractBackgroundAction.java:94) 
at ch.cyberduck.ui.AbstractController$1.call(AbstractController.java:94) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
at java.util.concurrent.FutureTask.run(FutureTask.java:167) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:604) 
at java.lang.Thread.run(Thread.java:883) 
at cli.System.Threading.ThreadHelper.ThreadStart_Context(Unknown Source) 
at cli.System.Threading.ExecutionContext.runTryCode(Unknown Source) 
at cli.System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(Unknown Source) 

Note how the timestamp was negative, which isn't valid. On closer inspection, the particular FTP server returns a 0 timestamp on all folders. I suspect that when Cyberduck tries to translate the 0 timestamp to local time, resulting in a negative timestamp.

One fix would be to reset a negative timestamp to 1s since epoch. Or, just set it to the current timestamp.

Thanks, Yao

Change History (2)

comment:1 Changed on Nov 30, 2011 at 11:42:43 PM by dkocher

  • Owner set to dkocher
  • Status changed from new to assigned

Thanks for the bug report. As a workaround, disable Preferences → Transfers → Timestamps → Downloads → Preserve modification date.

comment:2 Changed on Dec 1, 2011 at 10:36:24 AM by dkocher

  • Milestone set to 4.2.1
  • Resolution set to fixed
  • Status changed from assigned to closed

In r9328.

Note: See TracTickets for help on using tickets.
swiss made software