3
votes

I'm trying to sync my local folder on google cloud nearline storage, but I get the following error:

"Caught non-retryable exception while listing file:///var/lib/..: 'ascii' codec can't encode character u'\xe9' in position 170: ordinal not in range(128)
CommandException: Caught non-retryable exception - aborting rsync
Caught ^C - exiting"

Is there any solution please? Thank you.

2
Change the names of your folders in A-Za-z0-9 and some special characters only also avoid using very large names for folders, as this may increase length of the path string resulting in the error.ZdaR
Thank you for your answer anmol_uppal, but I tried to sync also a file in an "A-Za-z0-9" folder name, but the error persist. I guess it regards the character encoding different from UTF-8.Francesco Pedrotti

2 Answers

1
votes

It looks like you have an accented e - é located in a filename that you are attempting to sync.

Using UTF-8 for all object names and filenames will ensure that gsutil doesn’t encounter character encoding errors while operating on the files. Unfortunately, it’s still possible that files uploaded / downloaded this way can have interoperability problems, for a number of reasons unrelated to gsutil; example: copying filenames across different platforms like Linux and Windows. If you are using the Windows console you can specify wildcards or folders (using the -R option) rather than explicitly named individual files in order to prevent this.

If you have too many files you can use a tool to convert the old character encoding to UTF-8. One such tool is native2ascii.

1
votes

Alternatively you can use https://github.com/minio/mc which supports Google Cloud Storage in S3 compatibility mode.

mc is fully UTF-8 , can upload and download with all known UTF-8 characters.

Get your AccessKeyID and SecretAccessKey by following Google Credentials Guide. Once you have them update your ~/./mc/config.json configuration file.

$ mc config host add storage.googleapis.com <your_access_key> <your_secret_key> S3v2

NOTE: Google Cloud Storage only supports Legacy Signature Version 2 :(, so you have to pick - S3v2