Why does a batch file work on manual execution but fails on running it as WinSW service? - batch-file

I use WinSW for a Uvicorn service which basically provides an interface from which users can call certain SQL queries.
I have written a batch file which starts the program which works without a problem on manual execution with double clicking it. But if I run it as a service with WinSW and then start a query, there is output the error message:
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.
How can it be that the same .bat file works in standalone, but not as a service? And how do I fix it?
My service XML file with {Path_to_bat_directory} being a placeholder here in this post and being in real the hard coded directory path to the batch file containing the account name:
<configuration>
<id>X</id>
<name>X</name>
<description> XXX </description>
<executable>C:\Users\{Path_to_bat_directory}\StartUvicorn.bat</executable>
<onfailure delay="10 sec" action="restart"/>
<onfailure delay="20 sec" action="restart"/>
<onfailure action="none"/>
<resetfailure>1 hour</resetfailure>
<workingdirectory>C:\Users\{Path_to_bat_directory}</workingdirectory>
<priority>Normal</priority>
<stoptimeout>15 sec</stoptimeout>
<stopparentprocessfirst>true</stopparentprocessfirst>
<startmode>Automatic</startmode>
<waithint>15 sec</waithint>
<sleeptime>1 sec</sleeptime>
<logpath>C:\Users\{Path_to_bat_directory}\logs</logpath>
<log mode="roll"> </log>
</configuration>
The batch file StartUvicorn.bat:
call %~dp0win_env/Scripts/activate.bat
uvicorn main:app --port 8590 --host 0.0.0.0
The full error output as written into a log file is:
Exception in thread {X}:
Traceback (most recent call last):
File "{Path}\scoop\apps\anaconda3\current\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "{Path}\scoop\apps\anaconda3\current\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "{Path}\Sources\{Project}\.\populate_cache.py", line 25, in query_failures_from_db
df = pd.read_sql(statement, con, params=[date_from, date_to])
File "{Path}\Sources\{Project}\win_env\lib\site-packages\pandas\io\sql.py", line 563, in read_sql
pandas_sql = pandasSQL_builder(con)
File "{Path}\Sources\{Project}\win_env\lib\site-packages\pandas\io\sql.py", line 744, in pandasSQL_builder
import sqlite3
File "{Path}\scoop\apps\anaconda3\current\lib\sqlite3\__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "{Path}\scoop\apps\anaconda3\current\lib\sqlite3\dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.

Related

Kiwi TCMS Python API Connection SSL error

I'm getting following error when I try to run the tcms-api module but following the steps given,
https://tcms-api.readthedocs.io/en/latest/modules/tcms_api.html#module-tcms_api
I'm using python 3 in CentOS, applied our own domain and certificates by mounting the certificates to docker container.
Can you please tell how to solve the SSL Certificate verification failure error?
[root#KiwiTCMS-Testcase-Portal docker-compose]# python3 test-api.py
Traceback (most recent call last):
File "test-api.py", line 5, in <module>
rpc_client = TCMS()
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tcms_api/__init__.py", line 123, in __init__
config['tcms']['url']).server
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tcms_api/xmlrpc.py", line 124, in __init__
self.login(username, password, url)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tcms_api/xmlrpc.py", line 131, in login
self.server.Auth.login(username, password)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/xmlrpc/client.py", line 1112, in __call__
return self.__send(self.__name, args)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/xmlrpc/client.py", line 1452, in __request
verbose=self.__verbose
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/xmlrpc/client.py", line 1154, in request
return self.single_request(host, handler, request_body, verbose)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/xmlrpc/client.py", line 1166, in single_request
http_conn = self.send_request(host, handler, request_body, verbose)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/xmlrpc/client.py", line 1279, in send_request
self.send_content(connection, request_body)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/xmlrpc/client.py", line 1309, in send_content
connection.endheaders(request_body)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1282, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1042, in _send_output
self.send(msg)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 980, in send
self.connect()
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1448, in connect
server_hostname=server_hostname)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 817, in __init__
self.do_handshake()
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
Introducing the following line fix the issue,
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
# Legacy Python that doesn't verify HTTPS certificates by default
pass
else:
# Handle target environment that doesn't support HTTPS verification
ssl._create_default_https_context = _create_unverified_https_context
I see that you are using Python 3.6 from RedHat's SoftwareCollections. That version contains a bug (or arguably a security feature) which doesn't respect settings documented in upstream Python which allow you to accept untrusted SSL certificates. There are lots of these things reported on bugzilla.redhat.com but I don't think they will change it!
This is how we do it in our test suite:
https://github.com/kiwitcms/tcms-api/blob/master/tests/krb5/integration_test.py#L18

Extract some basic data with beautiful soup

Recently I tried to start web-scraping with python, in order to extract some basic informations in instagram using beautiful soup.
I wrote a simple code which is showed below:
from bs4 import BeautifulSoup
import selenium.webdriver as webdriver
url = 'http://instagram.com/umnpics/'
driver = webdriver.Firefox()
driver.get(url)
soup = BeautifulSoup(driver.page_source)
for x in soup.findAll('li', {'class':'photo'}):
print (x)
but after run it, some exceptions occured:
Traceback (most recent call last):
File "C:\Users\Mhdn\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\common\service.py", line 76, in start
stdin=PIPE)
File "C:\Program Files (x86)\Python37-32\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "C:\Program Files (x86)\Python37-32\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mhdn\Desktop\test2.py", line 5, in <module>
driver = webdriver.Firefox()
File "C:\Users\Mhdn\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "C:\Users\Mhdn\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\common\service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
You need to download geckodriver to your local system from here
In your code you need to provide executable_path for the geckodriver
Adding executable_path to your code:
from bs4 import BeautifulSoup
import selenium.webdriver as webdriver
url = 'http://instagram.com/umnpics/'
driver = webdriver.Firefox(executable_path= 'path/to/geckodriver') #<---Add path to your geckodriver
#example: driver = webdriver.Firefox(executable_path= 'home/downloads/geckodriver')
driver.get(url)
soup = BeautifulSoup(driver.page_source)
for x in soup.findAll('li', {'class':'photo'}):
print (x)

Problem with with setting proxy variables in .bat file (Results differing outputs in cmd and batch)

Describing the problem
I am trying to create a conda environment from .yml file in a .bat file. Since I am doing this within my company, it is needed to configure proxy. When I do it in command window, the environment is successfully created. However, when in the .bat file, an exceptions occurs and conda provides an error report to be sent.
This .bat file I am composing is very needed, so my questions are:
Are there any import differences between running this process on batch and cmd that unable me from getting this from the .bat file? What do I need to do to run this process on .bat file?
Code examples to reproduce the problem:
1. On Command Window
On cmd, if I run the following commands, I can get my result, which is creating the environment specific in the .yml file (samples only):
set https_proxy=https://username:password#proxy:port
conda env create -f environment-sample.yml
2. On .bat file
On .bat, running the file containing the following code, I get an error message, which will be presented below:
REM Using Delayed Expansion because this code will be inside an IF statement on .bat
setlocal EnableDelayedExpansion
set /p login="Login: "
set /p password="Password: "
set https_proxy=https://!login!:!password!#proxy:port
conda env create -f environment.yml
ERROR MESSAGE RETURNED:
Collecting package metadata: failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\requests\adapters.py", line 412, in send
conn = self.get_connection(request.url, proxies)
File "C:\Anaconda3\lib\site-packages\requests\adapters.py", line 305, in get_connection
proxy_url = parse_url(proxy)
File "C:\Anaconda3\lib\site-packages\urllib3\util\url.py", line 199, in parse_url
raise LocationParseError(url)
urllib3.exceptions.LocationParseError: Failed to parse: lnx237in.sjk.emb:9090
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\conda\exceptions.py", line 1002, in __call__
return func(*args, **kwargs)
File "C:\Anaconda3\lib\site-packages\conda_env\cli\main.py", line 73, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "C:\Anaconda3\lib\site-packages\conda_env\cli\main_create.py", line 106, in execute
installer.install(prefix, pkg_specs, args, env)
File "C:\Anaconda3\lib\site-packages\conda_env\installers\conda.py", line 27, in install
unlink_link_transaction = solver.solve_for_transaction(prune=getattr(args, 'prune', False))
File "C:\Anaconda3\lib\site-packages\conda\core\solve.py", line 107, in solve_for_transaction
force_remove, force_reinstall)
File "C:\Anaconda3\lib\site-packages\conda\core\solve.py", line 145, in solve_for_diff
force_remove)
File "C:\Anaconda3\lib\site-packages\conda\core\solve.py", line 235, in solve_final_state
ssc = self._collect_all_metadata(ssc)
File "C:\Anaconda3\lib\site-packages\conda\common\io.py", line 85, in decorated
return f(*args, **kwds)
File "C:\Anaconda3\lib\site-packages\conda\core\solve.py", line 286, in _collect_all_metadata
index, r = self._prepare(prepared_specs)
File "C:\Anaconda3\lib\site-packages\conda\core\solve.py", line 678, in _prepare
self.subdirs, prepared_specs)
File "C:\Anaconda3\lib\site-packages\conda\core\index.py", line 213, in get_reduced_index
new_records = query_all(spec)
File "C:\Anaconda3\lib\site-packages\conda\core\index.py", line 176, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "C:\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 93, in query
self.load()
File "C:\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 147, in load
_internal_state = self._load()
File "C:\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 218, in _load
mod_etag_headers.get('_mod'))
File "C:\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 429, in fetch_repodata_remote_request
timeout=timeout)
File "C:\Anaconda3\lib\site-packages\requests\sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "C:\Anaconda3\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Anaconda3\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Anaconda3\lib\site-packages\requests\adapters.py", line 414, in send
raise InvalidURL(e, request=request)
requests.exceptions.InvalidURL: Failed to parse: lnx237in.sjk.emb:9090
`$ C:\Anaconda3\Scripts\conda-env-script.py create -f environment.yml`
environment variables:
CIO_TEST=<not set>
CLASSPATH=C:\Program Files\Java\jdk1.8.0_51\lib\tools.jar
CONDA_AUTO_UPDATE_CONDA=false
CONDA_EXE=C:\Anaconda3\Scripts\conda.exe
CONDA_ROOT=C:\Anaconda3
CONDA_SHLVL=0
HOMEPATH=\Users\MFINACI
HTTPS_PROXY=<set>
MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared
Libraries\compiler\lib\mic
PATH=C:\Anaconda3\;C:\Anaconda3\Library\mingw-w64\bin;C:\Anaconda3\Library\
usr\bin;C:\Anaconda3\Library\bin;C:\Anaconda3\Scripts;C:\Anaconda3\bin
;C:\Anaconda3\condabin;C:\Anaconda3;C:\Anaconda3\Library\mingw-w64\bin
;C:\Anaconda3\Library\usr\bin;C:\Anaconda3\Library\bin;C:\Anaconda3\Sc
ripts;C:\ProgramData\Oracle\Java\javapath;C:\Program Files
(x86)\VNI\imsl\fnl710\winin140x64\lib;C:\Program Files (x86)\Common
Files\Microsoft Shared\VSA\10.0\VsaEnv;C:\Program Files (x86)\Common
Files\Intel\Shared Libraries\redist\intel64\mpirt;C:\Program Files
(x86)\Common Files\Intel\Shared
Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common
Files\Intel\Shared Libraries\redist\ia32\mpirt;C:\Program Files
(x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Orac
le\product\11.2.0\client_32\bin;C:\Oracle\product\11.2.0\client_64\bin
;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Win
dows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R)
Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R)
Management Engine Components\DAL;C:\Program Files\Intel\Intel(R)
Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R)
Management Engine Components\IPT;c:\Program Files (x86)\Microsoft SQL
Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL
Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL
Server\100\DTS\Binn\;C:\Program Files\Microsoft Windows Performance
Toolkit\;C:\Program Files\Java\jdk1.8.0_51\bin;C:\Program Files\Tortoi
seSVN\bin;C:\Users\MFINACI\AppData\Local\Programs\Microsoft VS
Code\bin;C:\Users\MFINACI\AppData\Local\Programs\Git\cmd
PSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PYTHONIOENCODING=1252
REQUESTS_CA_BUNDLE=<not set>
SSF_LIBRARY_PATH=C:\Program Files (x86)\SAP\FrontEnd\SecureLogin\lib\sapcrypto.dll
SSL_CERT_FILE=<not set>
active environment : None
shell level : 0
user config file : C:\Users\MFINACI\.condarc
populated config files : C:\Users\MFINACI\.condarc
conda version : 4.6.7
conda-build version : 3.10.5
python version : 3.7.2.final.0
base environment : C:\Anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Anaconda3\pkgs
C:\Users\MFINACI\.conda\pkgs
C:\Users\MFINACI\AppData\Local\conda\conda\pkgs
envs directories : C:\Anaconda3\envs
C:\Users\MFINACI\.conda\envs
C:\Users\MFINACI\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.6.7 requests/2.21.0 CPython/3.7.2 Windows/7 Windows/6.1.7601
administrator : False
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
[y/N]:
Attempts to understand the problem
I checked if the variables are being correctly assigned and they are. I did that basically "echoing" the variables. The screen result I got commenting the first line of the code (REM #echo off) are (Changing full path to make it cleaner):
C:\Users\MFINACI>set /p login="Login: "
Login: userexample
C:\Users\MFINACI>echo !login!
userexample
C:\Users\MFINACI>set /p password="Password: "
Password: passwordexample
C:\Users\MFINACI>echo !password!
passwordexample
C:\Users\MFINACI>set https_proxy=https://!login!:!password!#lnx237in.sjk.emb:9090
C:\Users\MFINACI>echo !https_proxy!
https://userexample:passwordexample#lnx237in.sjk.emb:9090
Also tried to find similar problems at the community, however, none of them present the problem of getting the results successfully on cmd and not on .bat file. Could you please help me?
This is my first question here, I really tried not to ask a duplicate and respect the rules of the community. Sorry if I made
anything wrong.

gcloud deploy error: Image with tag google/docker-registry was not found

I'm trying to deploy this project https://github.com/GoogleCloudPlatform/appengine-nodejs-quickstart by using this command
gcloud --project poised-graph-758 preview app deploy --server preview.appengine.google.com .
but i get this error:
Updating module [default] from file [/Users/kannix/Desktop/tmp/appengine-nodejs-quickstart/app.yaml]
11:36 PM Host: preview.appengine.google.com
{bucket: vm-containers.poised-graph-758.appspot.com, path: /containers}
Traceback (most recent call last):
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 153, in <module>
main()
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 149, in main
_cli.Execute()
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 381, in Execute
post_run_hooks=self.__post_run_hooks, kwargs=kwargs)
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute
pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 887, in Run
result = command_instance.Run(args)
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/calliope/exceptions.py", line 78, in TryFunc
return func(*args, **kwargs)
File "/Users/kannix/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 154, in Run
self.__Run(args, project, deployables)
File "/Users/kannix/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 207, in __Run
info.runtime, path, bucket)
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/push.py", line 134, in BuildAndPushDockerImage
boto_path=config.BOTO_PATH)) as r:
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/registry.py", line 148, in __enter__
self.Start()
File "/Users/kannix/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/registry.py", line 97, in Start
self._registry.Start()
File "/Users/kannix/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 480, in Start
self._image.Build()
File "/Users/kannix/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 309, in Build
raise ImageError('Image with tag %s was not found' % self.tag)
google.appengine.tools.docker.containers.ImageError: Image with tag google/docker-registry was not found
I tried to omit the --server preview.appengine.google.com parameter but it results in the same error
You need to pull the google/docker-registry image to resolve this error:
docker pull google/docker-registry
Note: if you receive the following error when trying to redeploy:
docker.docker.errors.APIError: 500 Server Error: Internal Server Error ("Invalid registry endpoint https://192.168.59.103:49153/v1/: Get https://192.168.59.103:49153/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.59.103:49153` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.59.103:49153/ca.crt")
Ensure that your docker daemon has been setup with the 'insecure registry' option (you will need to re-pull the google/docker-registry after the following steps) . You can do this with the following, (which was an answer on https://github.com/docker/docker/issues/8887):
$ boot2docker delete #removes old image
$ rm -f ~/.ssh/id_boot2docker* # remove old keys
$ boot2docker init #generates new keys, cert
$ boot2docker up
$ boot2docker ssh
$ # add EXTRA_ARGS="--insecure-registry <YOUR INSECURE HOST>"
$ # to /var/lib/boot2docker/profile
$ sudo /etc/init.d/docker restart
Try running this first:
gcloud preview app setup-managed-vms
Also make sure you're running Docker 1.3.0, not 1.3.1.
Docker 1.4.0 also doesn't work at this moment.
Deploying with --server preview.appengine.google.com did it for me.

Why does this gsutil call not work from FinalBuilder website but works when run in FinalBuilder application?

I have a .bat file that makes the following gsutil call to push a file to the 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/
Here is my output(with a few names changed for obscurity):
----------------------------------------------------------
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
It is mentioning something about H:\\\\ which we don't use and never mentioned in the .bat file or in the params to gsutil. I'm not sure why it works perfectly when run from the FinalBuilder application and then it gets this error when the FinalBuilder website runs the same FinalBuilder application file but is just triggered through the FinalBuilder Server.
Any help would be great.
The root cause for this is that your home directory is set to an invalid location.
As a workaround, you can change the tracker directory in your .boto configuration file. Here's the relevant section:
[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>
Uncomment the resumable_tracker_dir variable and set it to a location on disk that does exist.

Resources