# Cmd('git') failed due to: exit code(128)

**URL:** <https://forum.ecmwf.int/t/cmd-git-failed-due-to-exit-code-128/1466>\
**Category:** API\
**Tags:** api, c3s, toolbox\
**Created:** [17 April 2023 22:23 UTC](https://forum.ecmwf.int/t/cmd-git-failed-due-to-exit-code-128/1466 "2023-04-17T22:23:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brent\_McDaniel](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/b/4bbf92/32.png) [@Brent\_McDaniel](https://forum.ecmwf.int/u/Brent_McDaniel)\
**Post date:** [17 April 2023 22:23 UTC](https://forum.ecmwf.int/t/cmd-git-failed-due-to-exit-code-128/1466/1 "2023-04-17T22:23:31Z")

</div>

I'm trying to download daily averaged data using the toolbox. &nbsp;The code I'm using is at the bottom of the post. &nbsp;As a side note, I can use the api to get hourly data, it's when I use the toolbox that things break. &nbsp;

Thanks for any help! &nbsp;

--Brent

After I start the code it tells me that things are queued and then it fails with:

2023-04-17 18:31:07,036 INFO Welcome to the CDS

2023-04-17 18:31:07,037 INFO Sending request to [https://cds.climate.copernicus.eu/api/v2/tasks/services/tool/toolbox/orchestrator/workflow/clientid-805d8a96edb44aa7b209f7dfd30eda68](https://cds.climate.copernicus.eu/api/v2/tasks/services/tool/toolbox/orchestrator/workflow/clientid-805d8a96edb44aa7b209f7dfd30eda68)

2023-04-17 18:31:07,215 INFO Request is queued

2023-04-17 18:31:58,379 INFO Request is failed

2023-04-17 18:31:58,379 ERROR Message: an internal error occurred processing your request

2023-04-17 18:31:58,379 ERROR Reason:&nbsp; Cmd('git') failed due to: exit code(128)

&nbsp; cmdline: git clone git@gitrepo:c3s/era5.git /home/cds/compute\_workflows/c3s/era5/master

&nbsp; stdout: 'Cloning into '/home/cds/compute\_workflows/c3s/era5/master'...'

&nbsp; stderr: 'Warning: Permanently added the RSA host key for IP address '192.168.0.248' to the list of known hosts.

GitLab: The project you were looking for could not be found.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.'

2023-04-17 18:31:58,379 ERROR &nbsp; Traceback (most recent call last):

2023-04-17 18:31:58,379 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 59, in handle\_request

2023-04-17 18:31:58,379 ERROR &nbsp; &nbsp; &nbsp; result = cached(context.method, proc, context, context.args, context.kwargs)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; result = proc(context, \*context.args, \*\*context.kwargs)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 124, in \_\_call\_\_

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; return p(\*args, \*\*kwargs)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 60, in \_\_call\_\_

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; return self.proc(context, \*args, \*\*kwargs)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/home/cds/cdsservices/services/workflow.py", line 26, in execute

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; cacheurl=cacheurl)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/workflow.py", line 56, in submit

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; gitcache.ensure\_repo\_version(local\_repos\_path, remote\_repo\_url, params['version'])

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/gitcache.py", line 38, in ensure\_repo\_version

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; fetch\_repo\_version(remote\_repo\_url, local\_repo\_path, version)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/opt/cdstoolbox/cdscompute/cdscompute/gitcache.py", line 20, in fetch\_repo\_version

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; git.Git().clone(remote\_repo\_url, local\_repo\_path)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 548, in \<lambda\>

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; return lambda \*args, \*\*kwargs: self.\_call\_process(name, \*args, \*\*kwargs)

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 1014, in \_call\_process

2023-04-17 18:31:58,380 ERROR &nbsp; &nbsp; &nbsp; return self.execute(call, \*\*exec\_kwargs)

2023-04-17 18:31:58,381 ERROR &nbsp; &nbsp; File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 825, in execute

2023-04-17 18:31:58,381 ERROR &nbsp; &nbsp; &nbsp; raise GitCommandError(command, status, stderr\_value, stdout\_value)

2023-04-17 18:31:58,381 ERROR &nbsp; git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)

2023-04-17 18:31:58,381 ERROR &nbsp; &nbsp; cmdline: git clone git@gitrepo:c3s/era5.git /home/cds/compute\_workflows/c3s/era5/master

2023-04-17 18:31:58,381 ERROR &nbsp; &nbsp; stdout: 'Cloning into '/home/cds/compute\_workflows/c3s/era5/master'...'

2023-04-17 18:31:58,381 ERROR &nbsp; &nbsp; stderr: 'Warning: Permanently added the RSA host key for IP address '192.168.0.248' to the list of known hosts.

2023-04-17 18:31:58,381 ERROR &nbsp; GitLab: The project you were looking for could not be found.

2023-04-17 18:31:58,381 ERROR &nbsp; fatal: Could not read from remote repository.

Traceback (most recent call last):

&nbsp; File "/Users/data/era5/get\_daily\_data.py", line 5, in \<module\>

&nbsp; &nbsp; result = c.service("tool.toolbox.orchestrator.workflow",

&nbsp; File "/usr/local/lib/python3.9/site-packages/cdsapi/api.py", line 382, in service

&nbsp; &nbsp; result = self.\_api(

&nbsp; File "/usr/local/lib/python3.9/site-packages/cdsapi/api.py", line 519, in \_api

&nbsp; &nbsp; raise Exception(

Exception: an internal error occurred processing your request. Cmd('git') failed due to: exit code(128)

&nbsp; cmdline: git clone git@gitrepo:c3s/era5.git /home/cds/compute\_workflows/c3s/era5/master

&nbsp; stdout: 'Cloning into '/home/cds/compute\_workflows/c3s/era5/master'...'

&nbsp; stderr: 'Warning: Permanently added the RSA host key for IP address '192.168.0.248' to the list of known hosts.

GitLab: The project you were looking for could not be found.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.'.

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ My code below \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Using the following code:

import cdsapi  
 c = cdsapi.Client()

MONTHS = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

for month in MONTHS:  
 &nbsp; &nbsp; result = c.service("tool.toolbox.orchestrator.workflow",  
 &nbsp; &nbsp; params= {"realm": "c3s", "project": "era5", "version": "master",  
 &nbsp; &nbsp; "kwargs": {"dataset": "reanalysis-era5-single-levels", "product\_type": "reanalysis","variable": "2m\_temperature","statistic": "daily\_mean","year": "2020","month": month,"time\_zone": "UTC+00:0","frequency": "1-hourly","grid": "2.5/2.5","area": {"lat": [-90, 90], "lon": [-180, 180]}  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "workflow\_name": "application"  
 &nbsp; &nbsp; })  
 &nbsp; &nbsp; c.download(result)

---

<div class="post-metadata">

**Author:** ![Kevin\_Marsh](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/kevin_marsh/32/368_2.png) [@Kevin\_Marsh](https://forum.ecmwf.int/u/Kevin_Marsh)\
**Post date:** [18 April 2023 15:24 UTC](https://forum.ecmwf.int/t/cmd-git-failed-due-to-exit-code-128/1466/2 "2023-04-18T15:24:40Z")

</div>

Hi Brent,

The values for "realm" and &nbsp;"project" were changed after the documentation was produced, so you just need to change the values for "realm" and &nbsp;"project" in your script i.e.:

import cdsapi

c = cdsapi.Client()

MONTHS = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

for month in MONTHS:

&nbsp; &nbsp; result = c.service("tool.toolbox.orchestrator.workflow",

&nbsp; &nbsp; params= {"realm": "user-apps", "project": "app-c3s-daily-era5-statistics", "version": "master",

&nbsp; &nbsp; "kwargs": {"dataset": "reanalysis-era5-single-levels", "product\_type": "reanalysis","variable": "2m\_temperature","statistic": "daily\_mean","year": "2020","month": month,"time\_zone": "UTC+00:0","frequency": "1-hourly","grid": "2.5/2.5","area": {"lat": [-90, 90], "lon": [-180, 180]}

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "workflow\_name": "application"

&nbsp; &nbsp; })

&nbsp; &nbsp; c.download(result)

% python3 era5\_daily\_via\_cdsapi\_forum\_180423.py

2023-04-18 16:10:07,271 INFO Welcome to the CDS

2023-04-18 16:10:07,271 INFO Sending request to [https://cds.climate.copernicus.eu/api/v2/tasks/services/tool/toolbox/orchestrator/workflow/clientid-fbb3f759881246c08d9f9ef64416cbd4](https://cds.climate.copernicus.eu/api/v2/tasks/services/tool/toolbox/orchestrator/workflow/clientid-fbb3f759881246c08d9f9ef64416cbd4)

2023-04-18 16:10:07,390 INFO Request is queued

2023-04-18 16:18:26,966 INFO Request is completed

2023-04-18 16:18:26,970 INFO Downloading [https://download-0019.copernicus-climate.eu/cache-compute-0019/cache/data8/052b32c4-cf41-424c-9f79-e01fd6dec194.nc](https://download-0019.copernicus-climate.eu/cache-compute-0019/cache/data8/052b32c4-cf41-424c-9f79-e01fd6dec194.nc) to [052b32c4-cf41-424c-9f79-e01fd6dec194.nc](http://052b32c4-cf41-424c-9f79-e01fd6dec194.nc) (1.3M)

2023-04-18 16:18:27,680 INFO Download rate 1.8M/s

&nbsp;% ncdump -h [052b32c4-cf41-424c-9f79-e01fd6dec194.nc](http://052b32c4-cf41-424c-9f79-e01fd6dec194.nc)

netcdf \052b32c4-cf41-424c-9f79-e01fd6dec194 {

dimensions:

time = 31 ;

lat = 73 ;

lon = 144 ;

variables:

int64 time(time) ;

time:long\_name = "time" ;

time:standard\_name = "time" ;

time:axis = "T" ;

time:stored\_direction = "increasing" ;

time:type = "double" ;

time:units = "days since 2020-01-01" ;

time:calendar = "proleptic\_gregorian" ;

int64 realization ;

realization:long\_name = "realization" ;

realization:units = "1" ;

realization:standard\_name = "realization" ;

realization:stored\_direction = "increasing" ;

realization:type = "integer" ;

double lat(lat) ;

lat:\_FillValue = NaN ;

lat:units = "degrees\_north" ;

lat:standard\_name = "latitude" ;

lat:long\_name = "latitude" ;

lat:stored\_direction = "decreasing" ;

lat:axis = "Y" ;

lat:positive = "up" ;

lat:type = "double" ;

lat:valid\_max = 90. ;

lat:valid\_min = -90. ;

double lon(lon) ;

lon:\_FillValue = NaN ;

lon:units = "degrees\_east" ;

lon:standard\_name = "longitude" ;

lon:long\_name = "longitude" ;

lon:axis = "X" ;

lon:positive = "up" ;

lon:type = "double" ;

lon:valid\_max = 360. ;

lon:valid\_min = -180. ;

float t2m(time, lat, lon) ;

t2m:\_FillValue = NaNf ;

t2m:long\_name = "2 metre temperature" ;

t2m:units = "K" ;

t2m:standard\_name = "air\_temperature" ;

t2m:comment = "near-surface (usually, 2 meter) air temperature" ;

t2m:cds\_magics\_style\_name = "near-surface-air-temperature" ;

t2m:type = "real" ;

t2m:coordinates = "realization" ;

// global attributes:

:Conventions = "CF-1.7" ;

:institution = "European Centre for Medium-Range Weather Forecasts" ;

:history = "2023-04-18T15:18 GRIB to CDM+CF via cfgrib-0.9.9.1/ecCodes-2.27.0 with {\"source\": \"/nfs/compute-0019/data1/adaptor.mars.internal-1681831066.585602-8010-6-cc816243-dc94-442d-9747-037c4ce046e3.grib\", \"filter\_by\_keys\": {}, \"encode\_cf\": [\"parameter\", \"time\", \"geography\", \"vertical\"]}" ;

:source = "ECMWF" ;

}

This page has more information and examples:

# [Retrieve daily ERA5/ERA5-Land data using the CDS API](https://prod.ecmwf-forum-prod.compute.cci2.ecmwf.int/t/retrieve-daily-era5-era5-land-data-using-the-cds-api/1150)

Thanks,

Kevin

---

<div class="post-metadata">

**Author:** ![Brent\_McDaniel](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/b/4bbf92/32.png) [@Brent\_McDaniel](https://forum.ecmwf.int/u/Brent_McDaniel)\
**Post date:** [19 April 2023 04:30 UTC](https://forum.ecmwf.int/t/cmd-git-failed-due-to-exit-code-128/1466/3 "2023-04-19T04:30:44Z")

</div>

Hi Kevin,

Thanks for your reply. &nbsp;Changing those parameters fixed the issue.

Are there updated docs for the API that show all the available parameters and functions in the API? &nbsp;I was trying to specify the output filename and thought there would be an easy way but wasn't able to do so using the toolbox. &nbsp;I was able to do it using some code (yours?) that I copied below but it seems cludgy and like I'm missing some obvious way to do it.

Thanks again!

--Brent

location=result[0]['location']  
 res = requests.get(location, stream = True)  
 print("Writing data to " + file\_name)  
 with open(file\_name,'wb') as fh:  
 &nbsp; &nbsp; for r in res.iter\_content(chunk\_size = 1024):  
 &nbsp; &nbsp; &nbsp; &nbsp; fh.write(r)  
 fh.close()

---

<div class="post-metadata">

**Author:** ![Kevin\_Marsh](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/kevin_marsh/32/368_2.png) [@Kevin\_Marsh](https://forum.ecmwf.int/u/Kevin_Marsh)\
**Post date:** [19 April 2023 11:16 UTC](https://forum.ecmwf.int/t/cmd-git-failed-due-to-exit-code-128/1466/4 "2023-04-19T11:16:15Z")

</div>

Hi Brent,

re: API functions and parameters - i believe that currently the best reference is the code itself [https://github.com/ecmwf/cdsapi](https://github.com/ecmwf/cdsapi)

I don't think it's possible to directly specify the Toolbox output filename in the current version of the Toolbox, but this is something that may be possible in the future as the CDS develops.

Thanks,

Kevin
