delta-rho / trelliscope

Detailed Visualization of Large Complex Data in R
Other
115 stars 34 forks source link

image files not always copied from temp directory to vdb directory #87

Open amwhite opened 9 years ago

amwhite commented 9 years ago

Specifically, when makeDisplay() calls file.rename() to move the files from temp directory to the vdb directory, it does not work correctly when the temp dir is on a different partition or drive from the vdb dir.

Error message:

> vdbConn("vdb_netflow", autoYes=TRUE)
vdb connection object: [name:none]; path=/people/d3l348/vdb_netflow
> makeDisplay(hostTimeAgg,
+             name = "hourly_count",
+             group = "inside_hosts",
+             desc = "time series plot of hourly counts of connections for each inside host",
+             panelFn = timePanel,
+             cogFn = timeCog,
+             width = 800, height = 400,
+             lims = list(x = "same", y = "same")
+ )
* Validating 'panelFn'...
* Testing cognostics function on a subset ... ok
* Precomputed limits not supplied.  Computing axis limits...
Testing 'prepanelFn' on a subset...
Using 'trellis' panelFn to determine limits... dx and dy will not be computed.
At least one of the variables is not numeric.  Casting as numeric for quantile calculation purposes.
* Storing display object...
* Plotting thumbnail...
* Updating displayList...
Error: Files needed for building trelliscope display were not correctly moved to '/people/d3l348/vdb_netflow/displays/inside_hosts/hourly_count'
In addition: Warning messages:
1: In file.rename(dir(tempPrefix, full.names = TRUE), file.path(displayPrefix,  :
  cannot rename file '/tmp/Rtmpvspqcq/file471234e32bc4/displayObj.Rdata' to '/people/d3l348/vdb_netflow/displays/inside_hosts/hourly_count/displayObj.Rdata', reason 'Invalid cross-device link'
2: In file.rename(dir(tempPrefix, full.names = TRUE), file.path(displayPrefix,  :
  cannot rename file '/tmp/Rtmpvspqcq/file471234e32bc4/thumb.png' to '/people/d3l348/vdb_netflow/displays/inside_hosts/hourly_count/thumb.png', reason 'Invalid cross-device link'
3: In file.rename(dir(tempPrefix, full.names = TRUE), file.path(displayPrefix,  :
  cannot rename file '/tmp/Rtmpvspqcq/file471234e32bc4/thumb_small.png' to '/people/d3l348/vdb_netflow/displays/inside_hosts/hourly_count/thumb_small.png', reason 'Invalid cross-device link'
lhsego commented 9 years ago

I'll figure it out...

amwhite commented 9 years ago

Work around: in the .Renviron file add a line like this, where the directory chosen is on the same drive/partition/device as the vdb directory.

TMPDIR=~/tmp

Restart R (this is necessary). Then it will use the directory you specify as the place for temporary files and won't have a problem copying them.

amwhite commented 9 years ago

Also: see the documentation for tempfile() to see why the above work around works.

lhsego commented 9 years ago

@amwhite, do you think this workaround is sufficient, or should we do something in the code?

amwhite commented 9 years ago

I think we should fix it in the code. Not a huge priority since we do have a workaround.

clintidau commented 9 years ago

I just encountered this bug on CentOS 7. The file.rename command fails because the /tmp folder is a different mount point. It works if I change file.rename to file.copy with overwrite=TRUE on line 326 of makeDisplay.R

amwhite commented 9 years ago

I think the merge @hafen did earlier today fixes this problem. Please reinstall the latest version of trelliscope and let us know if that doesn't fix it.

clintidau commented 9 years ago

Confirmed fixed on CentOS 7, thanks!