Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367283

Summary: [ssh] IFileStore.copy from local to remote fails
Product: [Tools] Target Management Reporter: George Dinkov <go6etobate>
Component: RSEAssignee: dsdp.tm.rse-inbox <tm.rse-inbox>
Status: NEW --- QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description George Dinkov CLA 2011-12-21 05:03:36 EST
Build Identifier: I20110613-1736

When doing IFileStore.copy with EFS.NONE flag the operation fails sometimes with:
Caused by: org.eclipse.core.runtime.CoreException: File already exists on disk: rse://remote-machine/home/ciuser/ci_workspace/OneFileProject/.project.
	at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
	at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:50)
	at org.eclipse.core.filesystem.provider.FileStore.copyFile(FileStore.java:208)
	at org.eclipse.core.filesystem.provider.FileStore.copy(FileStore.java:143)
	at org.eclipse.core.internal.filesystem.local.LocalFile.copy(LocalFile.java:111)
	at org.eclipse.core.filesystem.provider.FileStore.copyDirectory(FileStore.java:181)
	at org.eclipse.core.filesystem.provider.FileStore.copy(FileStore.java:141)
	at org.eclipse.core.internal.filesystem.local.LocalFile.copy(LocalFile.java:111)

As I tried to debug the problem, it seems that on some point the verification in org.eclipse.core.filesystem.provider.FileStore.copyFile(IFileInfo, IFileStore, int, IProgressMonitor) fails because it says that the remote file exists, but the file doesn't exist on the remote machine. The remote file is taken from org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem._cachedRemoteFiles.
This happens only on our CI machine for executing tests, but we cannot reproduce it on other machines.
An easy workaround for this is to copy the files with the EFS.OVERWRITE flag always.

Reproducible: Sometimes

Steps to Reproduce:
I can't provide easy steps to reproduce. It happens when copying from the local to a remote machine (Red Hat 5.5) using the ssh file service with IFileStore.copy. It only happens on our CI machine and I cannot reproduce it on other machines.