4

正在复制文件://InstreamImpression.csv.gz [Content-Type=application/octet-stream]...

AccessDeniedException:401 需要登录fe13d1e0fb408639_4...:46.75 MB/46.77 MB

CommandException: 1 个文件/对象无法传输。

似乎整个对象正在传输,但最后给出 401 错误。它已经发生了一段时间。

运行“gcloud auth login”几次。但仍然是同样的错误

我可以从不同的机器上传文件。

任何想法?

4

2 回答 2

3

这是一个奇怪的案例。

该文件位于“D:”驱动器下的 Windows 服务器上,我正在从那里运行 gsutil 工具。

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

我在 D: 驱动器上没有足够的权限

但是,一旦我从“C:”驱动器运行相同的命令,它就可以正常工作

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

于 2014-07-24T23:28:32.650 回答
0

这可能是 gsutil/boto 如何处理 Windows 上的操作系统路径分隔符的问题,如在此处引用的那样。这最终应该被合并到 sdk 工具中,但在此之前,以下应该可以工作:

转到
google-cloud-sdk\platform\gsutil\third_party\boto\boto\pyami\config.py

并替换该行:

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

和:

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

接下来,转到
google-cloud-sdk\bin\bootstrapping\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 并且错误应该消失。

于 2015-04-21T16:22:28.930 回答