Ivan, thanks for the report.  I just pushed this change to the master branch which should fix it:

commit 0b3deec34dabe6d34b1034620aa18096504d3c92
Author: Matt Domsch <matt@domsch.com>
Date:   Sat Mar 29 08:11:57 2014 -0500

    hardlink fix

    If we didn't record the hardlink md5 because the file size
    was zero, don't then fail to look it up later.

diff --git a/S3/FileDict.py b/S3/FileDict.py
index 2c21767..4f2ab6f 100644
--- a/S3/FileDict.py
+++ b/S3/FileDict.py
@@ -57,10 +57,10 @@ class FileDict(SortedDict):

     def get_hardlink_md5(self, relative_file):
         md5 = None
-        dev = self[relative_file]['dev']
-        inode = self[relative_file]['inode']
         try:
+            dev = self[relative_file]['dev']
+            inode = self[relative_file]['inode']
             md5 = self.hardlinks[dev][inode]['md5']
-        except:
+        except KeyError:
             pass
         return md5



On Sat, Mar 29, 2014 at 3:20 AM, Ivan <upravlenie.host@gmail.com> wrote:
Hello, I saw that report when I tried to sync my sites with S3. Total data size - about 250GB, and a lot of small files.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  If the error persists, please report the
  following lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /usr/bin/s3cmd sync -v www/ s3://blackhost/bunker/Problem: KeyError: 'dev'
S3cmd:   1.5.0-beta1
python:   2.6.6 (r266:84292, Jan 22 2014, 09:42:36) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
environment LANG=ru_RU.UTF-8

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 2422, in <module>
    main()
  File "/usr/bin/s3cmd", line 2344, in main
    cmd_func(args)
  File "/usr/bin/s3cmd", line 1414, in cmd_sync
    return cmd_sync_local2remote(args)
  File "/usr/bin/s3cmd", line 1398, in cmd_sync_local2remote
    destination_base_uri = _single_process(local_list)
  File "/usr/bin/s3cmd", line 1209, in _single_process
    _child(destination_base, local_list)
  File "/usr/bin/s3cmd", line 1295, in _child
    local_list, remote_list, update_list, copy_pairs = compare_filelists(local_list, remote_list, src_remote = False, dst_remote = True, delay_updates = cfg.delay_updates)
  File "/usr/lib/python2.6/site-packages/S3/FileLists.py", line 563, in compare_filelists
    md5 = src_list.get_md5(relative_file)
  File "/usr/lib/python2.6/site-packages/S3/FileDict.py", line 40, in get_md5
    md5 = self.get_hardlink_md5(relative_file)
  File "/usr/lib/python2.6/site-packages/S3/FileDict.py", line 60, in get_hardlink_md5
    dev = self[relative_file]['dev']
KeyError: 'dev'

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please try reproducing the error using
  the latest s3cmd code from the git master
  branch found at:
    https://github.com/s3tools/s3cmd
  If the error persists, please report the
  above lines (removing any private
  info as necessary) to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

------------------------------------------------------------------------------