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 thrown on negative timestamp - "Transfer Incomplete" #6410

Closed
cyberduck opened this issue Nov 30, 2011 · 2 comments
Closed

Exception thrown on negative timestamp - "Transfer Incomplete" #6410

cyberduck opened this issue Nov 30, 2011 · 2 comments
Assignees
Milestone

Comments

@cyberduck
Copy link
Collaborator

@cyberduck cyberduck commented Nov 30, 2011

Yaoyao created the issue

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

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Dec 1, 2011

@dkocher commented

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

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Dec 1, 2011

@dkocher commented

In 1e9f203.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants