0

I'm uploading a static website to cloud storage using the command

gsutil cp -v -R -c * gs://www.gennadiy-dolzhenko.ru

mid process it fails with the following output

...SNIP...
Copying file://tourism_studies/models/articles/54-moskva/slideshow/resized/sk576.jpg [Content-Type=image/jpeg]...
Created: gs://www.gennadiy-dolzhenko.ru/tourism_studies/models/articles/54-moskva/slideshow/resized/sk576.jpg#1403352412336000
Copying file://tourism_studies/models/articles/54-moskva/slideshow/resized/7.jpg [Content-Type=image/jpeg]...
Created: gs://www.gennadiy-dolzhenko.ru/tourism_studies/models/articles/54-moskva/slideshow/resized/7.jpg#1403352412725000
'ascii' codec can't decode byte 0xdd in position 1: ordinal not in range(128)

Its unclear which file is faulty and -c flag doesn't make the tool continue upload as described. How can I determine what is causing the error or at least make the tool upload as many files as possible?

UPDATE: using the -D switch I was able to trace it down to the following error

Comparing local vs cloud md5-checksum for tourism_studies/models/articles/54-moskva/slideshow/resized/7.jpg. (O8RgYfpRe8ylUbJh4UPfWg==/O8RgYfpRe8ylUbJh4UPfWg==)
Created: gs://www.gennadiy-dolzhenko.ru/tourism_studies/models/articles/54-moskva/slideshow/resized/7.jpg#1403367381161000
'ascii' codec can't decode byte 0xdd in position 1: ordinal not in range(128)


Encountered exception while copying:
Traceback (most recent call last):
  File "/home/evgeniy/gsutil/gslib/command.py", line 1105, in _SequentialApply
    args = args_iterator.next()
  File "/home/evgeniy/gsutil/gslib/plurality_checkable_iterator.py", line 57, in _PopulateHead
    e = self.base_iterator.next()
  File "/home/evgeniy/gsutil/gslib/name_expansion.py", line 294, in __iter__
    for (names_container, blr) in post_step3_iter:
  File "/home/evgeniy/gsutil/gslib/plurality_checkable_iterator.py", line 57, in _PopulateHead
    e = self.base_iterator.next()
  File "/home/evgeniy/gsutil/gslib/name_expansion.py", line 521, in __iter__
    for (names_container, blr) in self.tuple_iter:
  File "/home/evgeniy/gsutil/gslib/plurality_checkable_iterator.py", line 57, in _PopulateHead
    e = self.base_iterator.next()
  File "/home/evgeniy/gsutil/gslib/name_expansion.py", line 580, in __iter__
    for exp_blr in implicit_subdir_iterator:
  File "/home/evgeniy/gsutil/gslib/plurality_checkable_iterator.py", line 57, in _PopulateHead
    e = self.base_iterator.next()
  File "/home/evgeniy/gsutil/gslib/wildcard_iterator.py", line 560, in IterAll
    for bucket_listing_ref in self.__iter__():
  File "/home/evgeniy/gsutil/gslib/wildcard_iterator.py", line 519, in __iter__
    for filepath in filepaths:
  File "/home/evgeniy/gsutil/gslib/wildcard_iterator.py", line 530, in _IterDir
    for dirpath, unused_dirnames, filenames in os.walk(directory):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 284, in walk
    if isdir(join(top, name)):
  File "/usr/lib/python2.7/posixpath.py", line 80, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdd in position 1: ordinal not in range(128)
dolzenko
  • 5,664
  • 5
  • 35
  • 27
  • Hi - can you please send the output of the following to gs-team@google.com (and strip out Authorization headers when you do so): gsutil -D cp -v -R -c * gs://www.gennadiy-dolzhenko.ru – Mike Schwartz Jun 21 '14 at 14:42
  • Hi @MikeSchwartz , sent the email with attached logs, would be cool if somebody can take a look. Also updated the question with the stacktrace of the failure. – dolzenko Jun 21 '14 at 17:21

1 Answers1

1

The problem here was a file name containing invalid Unicode chars. We have changed gsutil to provide a more helpful error message for this case. This change will be included in gsutil 4.4.

Mike Schwartz
  • 9,306
  • 23
  • 28
  • Also documented in https://github.com/GoogleCloudPlatform/gsutil/commit/f97c58ce834d58e430cd7c9aca7e5df306ca8572 . Thanks for looking into this! – dolzenko Jun 25 '14 at 16:59