Unable to upload file to gcs using gsutil

Copying file: //InstreamImpression.csv.gz [Content-Type = application / octet-stream] ...

AccessDeniedException: 401 Login Requiredfe13d1e0fb408639_4 ...: 46.75 MB / 46.77 MB

CommandException: 1 file / objects cannot be transferred.

It seems that the whole object is being transferred, but in the end gives an error of 401. And this has been happening for some time.

Ran "gcloud auth login" a couple of times. But still the same error

I can download files from different computers.

Any idea?

+4
source share
2 answers

It was a strange case.

The file was located on a Windows server under the "D:" drive, and from there I ran gsutil.

. D: > gsutil -m cp xyz.csv gs:\somebucket\

D:

"C:",

.. C: > gsutil -m cp "D:\xyz.csv" gs:\somebucket\

+3

, gsutil/boto Windows, . sdk, :

Google- SDK\\GSUtil\THIRD_PARTY\\\pyami\config.py

:

for path in os.environ['BOTO_PATH'].split(':'):

:

for path in os.environ['BOTO_PATH'].split(os.path.pathsep):

, Google- SDK\Bin\\gsutil.py

, ':'

if boto_config:
      boto_path = ':'.join([boto_config, gsutil_path])
    elif boto_path:
      # this is ':' for windows as well, hardcoded into the boto source.
      boto_path = ':'.join([boto_path, gsutil_path])
    else:
      path_parts = ['/etc/boto.cfg',
                    os.path.expanduser(os.path.join('~', '.boto')),
                    gsutil_path]
      boto_path = ':'.join(path_parts)

if boto_config:
      boto_path = os.path.pathsep.join([boto_config, gsutil_path])
    elif boto_path:
      # this is ':' for windows as well, hardcoded into the boto source.
      boto_path = os.path.pathsep.join([boto_path, gsutil_path])
    else:
      path_parts = ['/etc/boto.cfg',
                    os.path.expanduser(os.path.join('~', '.boto')),
                    gsutil_path]
      boto_path = os.path.pathsep.join(path_parts)

cmd, .

0

Source: https://habr.com/ru/post/1548417/


All Articles