Menu

#86 KeyErr: 'dest_name' during s3cmd globbing mv operation

Malfunction
closed-fixed
nobody
s3cmd (120)
5
2015-02-09
2011-05-08
No

When attempting to use s3cmd to move many files from a bucket base directory to a sub-folder, this error was encountered.

Example command, output, and error:

$ s3cmd mv s3://my-bucket/BundledAmi* s3://my-bucket/BundledAmiFolder/

Output: File s3://my-bucket/BundledAmi.manifest.xml moved to s3://my-bucket/BundledAmiFolder/BundledAmi.manifest.xml

Note that this first file _does_ get moved properly but no other files get moved after the error below. Each successive command execution transfers one file before throwing the KeyErr: 'dest_name' error - the error output of this command is below:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the following lines to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Problem: KeyErr: 'dest_name'
S3cmd: 1.0.0

Traceback (most recent call last):
File "/usr/bin/s3cmd", line 2006, in ?
main()
File "/usr/bin/s3cmd", line 1950, in main
cmd_func(args)
File "/usr/bin/s3cmd", line 618, in cmd_mv
subcmd_cp_mv(args, s3.object_move, "move", "File %(src)s moved to %(dst)s")
File "/usr/bin/s3cmd", line 604, in subcmd_cp_mv
dst_uri = S3Uri(item['dest_name'])
KeyError: 'dest_name'

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please report the above lines to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

===

Also note that simulating globbing using a series of bash for loops with an incrementing loop counter is a useable, if somewhat tedious workaround; example below:

for N in {0..9} ; do s3cmd mv s3://my-bucket/BundledAmi.part.00${N} s3://my-bucket/BundledAmiFolder/

Discussion

  • Mohan Kartha

    Mohan Kartha - 2011-05-08

    Note that this error was also report in Bug ID: 3091912 occurring in the prior version of S3cmd: v0.9.9.91

     
  • Matt Domsch

    Matt Domsch - 2015-02-09

    Fixed in newer releases such as 1.5.0.

     
  • Matt Domsch

    Matt Domsch - 2015-02-09
    • status: open --> closed-fixed
     

Log in to post a comment.