Menu

#1588 STAF fs copy fails with RC 18 for filesize >= 4GB

All
closed
5
2016-12-30
2016-10-21
asomers
No

STAF fails to copy files that are 4GB or greater in size. 4GB minus 1 byte is fine. Tested on 3.4.23 and 3.4.18 on FreeBSD 11. Steps to reproduce:

$ cd /tmp
$ mkdir src
$ mkdir dest
$ cd src/
$ truncate -s 4294967296 4gfile
$ truncate -s 4294967295 4gminus1file
$ staf local fs copy directory /tmp/src todirectory /tmp/dest recurse
Error submitting request, RC: 51
Additional info
---------------
Name            RC OS RC 
--------------- -- ------
/tmp/src/4gfile 18 <None>

Discussion

  • Sharon Lucas

    Sharon Lucas - 2016-10-22

    This is a duplicate of Feature Request #438 "Enhance FS COPY to accommodate files > 4GB" at https://sourceforge.net/p/staf/feature-requests/438/

     
  • Sharon Lucas

    Sharon Lucas - 2016-12-30

    Section "9.8.5.3 COPY DIRECTORY" in the STAF User's Guide at http://staf.sourceforge.net/current/STAFUG.htm#HDRFSSRV states in the "Notes" that there are some limitations when copying a directory including that it only supports copying files whose size < 4 GB:

    4. The FS service supports copying a file whose size is less than 4 GB on  most platforms, assuming the operating system supports the creation of large files, that is, files larger than 2 GB.
    

    If you submitted a FS COPY FILE request or FS GET FILE request (instead of a FS COPY DIRECTORY request), you get more information about the cause of the RC 18. For example:

    # STAF local FS COPY FILE /tmp/src/4G.txt TOFILE /tmp/src/4GCopy.txt
    Error submitting request, RC: 18
    Additional info
    ---------------
    File size exceeds the maximum size (4294967295) supported.  File name: /tmp/src/4G.txt
    

    I'll use this bug to update the help for RC 51 (Directory Copy Error) so that the "Note:" mentions that more details about why a specific file could not be copied may be provided by submitting a COPY FILE request instead of a COPY DIRECTORY request as this could be helpful in debugging if you didn't see the note in the STAF User's Guide about the size limitation when copying files. That is, change the output from:

    # STAF local HELP ERROR 51
    Response
    --------
    Description: Directory Copy Error
    Details    : This indicates that you have tried to copy a directory, but that errors occurred during the copy.
    
    Note: Additional information specifying the entries which could not be  copied may be provided in the result passed back from the submit call.
    

    to:

    # STAF local HELP ERROR 51
    Response
    --------
    Description: Directory Copy Error
    Details    : This indicates that you have tried to copy a directory, but
    that errors occurred during the copy.
    
    Note: Additional information specifying the entries which could not be copied may be provided in the result passed back from the submit call.  More details about why a specific file could not be copied may be provided by submitting a COPY FILE request instead of a COPY DIRECTORY request.
    
     

    Last edit: Sharon Lucas 2016-12-30
  • Sharon Lucas

    Sharon Lucas - 2016-12-30

    Here's a cvs diff of the changes:

    Index: stafproc/STAFHelpService.cpp
    ===================================================================
    RCS file: /cvsroot/staf/src/staf/stafproc/STAFHelpService.cpp,v
    retrieving revision 1.42
    diff -r1.42 STAFHelpService.cpp
    Index: stafproc/STAFHelpService.cpp
    ===================================================================
    RCS file: /cvsroot/staf/src/staf/stafproc/STAFHelpService.cpp,v
    retrieving revision 1.42
    diff -r1.42 STAFHelpService.cpp
    220c220
    <           "read may be provided in the result passed back "
    ---
    >           "read and why may be provided in the result passed back "
    444c444
    <           "errors{STAF/Config/Sep/Line}occurred during the copy."
    ---
    >           "errors occurred during the copy."
    447,448c447,450
    <           "copied may be provided in the result "
    <           "passed back from the submit call.{STAF/Config/Sep/Line}" },
    ---
    >           "copied and why may be provided in the result passed back from the "
    >           "submit call. More details about why a specific file could not be "
    >           "copied may be provided by submitting a COPY FILE request instead "
    >           "of a COPY DIRECTORY request.{STAF/Config/Sep/Line}" },
    
    Index: docs/userguide/ErrRef.script
    ===================================================================
    RCS file: /cvsroot/staf/src/staf/docs/userguide/ErrRef.script,v
    retrieving revision 1.32
    diff -r1.32 ErrRef.script
    184,185c184,185
    < :note.Additional information regarding which file could not be read from may be
    < provided in the result passed back from the submit call.
    ---
    > :note.Additional information regarding which file could not be read and why may
    > be provided in the result passed back from the submit call.
    443a444,445
    > More details about why a specific file could not be copied may be provided by
    > submitting a COPY FILE request instead of a COPY DIRECTORY request.
    
     

    Last edit: Sharon Lucas 2016-12-30
  • Sharon Lucas

    Sharon Lucas - 2016-12-30

    Closing this bug as the file size limitation for FS COPY requests is documented.

    When support for files >= 4GB is added, it will be implemented via Feature Request #438 "Enhance FS COPY to accommodate files > 4GB" at https://sourceforge.net/p/staf/feature-requests/438/

     
  • Sharon Lucas

    Sharon Lucas - 2016-12-30
    • labels: --> Service::Help
    • status: open --> closed
    • assigned_to: Sharon Lucas
     

Log in to post a comment.