我有一个.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的params中提到过。我不确定为什么它在从FinalBuilder应用程序运行时运行良好,然后当FinalBuilder网站运行相同的FinalBuilder应用程序文件但只是通过FinalBuilder服务器触发时会出现此错误。
任何帮助都会很棒。
答案 0 :(得分: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
变量并将其设置为磁盘上确实存在的位置。