3

我有一个 .bat 文件,它进行以下 gsutil 调用以将文件推送到 Google Cloud:

python "C:\Program Files (x86)\gsutil\gsutil" -D -m cp -a public-read C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/

这是我的输出(为了晦涩而更改了一些名称):

----------------------------------------------------------
Copy to google  11:02:33 AM 11:02:34 AM 00:00:00:479    Failed (Ignored)
Collapse    Messages    
Messages                
Collapse        
Executing external process: C:\Windows\system32\cmd.exe

Starting Directory: C:\BuildScripts
Parameters: /c "c:\buildscripts\push_goog.bat"
Collapse        
Output from C:\Windows\system32\cmd.exe

The system cannot find the drive specified.

C:\BuildScripts>pushd c:\BuildScripts\ 

The system cannot find the drive specified.
Traceback (most recent call last):
  File "C:\Program Files (x86)\gsutil\gsutil", line 67, in <module>
    from gslib.util import UsingCrcmodExtension
  File "C:\Program Files (x86)\gsutil\gslib\util.py", line 121, in <module>
    os.path.join(CreateTrackerDirIfNeeded(), '.last_software_update_check'))
  File "C:\Program Files (x86)\gsutil\gslib\util.py", line 108, in CreateTrackerDirIfNeeded
    os.makedirs(tracker_dir)
  File "C:\Python27\lib\os.py", line 150, in makedirs
    makedirs(head, mode)
**C:\BuildScripts>python "C:\Program Files (x86)\gsutil\gsutil" -D -m cp -a public-read C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/**
  File "C:\Python27\lib\os.py", line 157, in makedirs
    mkdir(name, mode)
WindowsError: [Error 3] The system cannot find the path specified: 'H:\\\\'
Program returned code  : 1

它提到了一些关于 H:\\\\ 的内容,我们没有使用,也从未在 .bat 文件或 gsutil 的参数中提及。我不确定为什么它在从 FinalBuilder 应用程序运行时完美运行,然后当 FinalBuilder 网站运行相同的 FinalBuilder 应用程序文件但只是通过 FinalBuilder 服务器触发时出现此错误。

任何帮助都会很棒。

4

1 回答 1

3

根本原因是您的主目录设置为无效位置。

作为一种解决方法,您可以更改.boto配置文件中的跟踪器目录。这是相关部分:

[GSUtil]
# 'resumable_tracker_dir' specifies the base location where resumable
# transfer tracker files are saved. By default they're in ~/.gsutil
#resumable_tracker_dir = <file path>

取消注释该resumable_tracker_dir变量并将其设置为磁盘上确实存在的位置。

于 2013-11-27T17:59:36.587 回答