Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get update on request #122

Open
e5k opened this issue Sep 26, 2024 · 5 comments
Open

Get update on request #122

e5k opened this issue Sep 26, 2024 · 5 comments

Comments

@e5k
Copy link

e5k commented Sep 26, 2024

What maintenance does this project need?

I used to be able to programatically check the update of a request using this:

  reply = dict(request_id=df.iloc[i]['r']) # Get ID
  new_client = cdsapi.Client(wait_until_complete=False, delete=False)
  result = cdsapi.api.Result(new_client, reply)
  result.update()
  reply = result.reply

After updating to the new cdsapi, result.update() returns:

HTTPError: 404 Client Error: Not Found for url: https://cds.climate.copernicus.eu/api/tasks/2fbb3fcc-e2d9-47c7-aef0-0c9a6a143402

Am I doing something wrong or is the cdsapi still requires updating?

Organisation

UNIGE

@GhislainViguierEdf
Copy link

I got the same issue

@YYC54
Copy link

YYC54 commented Sep 28, 2024

I have a similar problem. I am getting this error while downloading data from ERA5 via API (with the latest version of cdsapi)

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://cds.climate.copernicus.eu/resources/reanalysis-era5-pressure-levels

I found out that the correct URL is

https://cds.climate.copernicus.eu/dataset/reanalysis-era5-pressure-levels

Among them,

 https://cds.climate.copernicus.eu

is ERA5 key $HOME /. Cdsapir file url
Therefore, the problem is that the location of data stored in the ERA5 website has changed from

resources/reanalysis-era5-pressure-levels

to

dataset/reanalysis-era5-pressure-levels

But the api in this package has not changed
I'm not sure if that's the reason

@e5k
Copy link
Author

e5k commented Sep 30, 2024

In your case, if the problem is only on downloading data, I think you can change this function of api.py from:

    def retrieve(self, name, request, target=None):
        result = self._api("%s/resources/%s" % (self.url, name), request, "POST")
        if target is not None:
            result.download(target)
        return result

to

    def retrieve(self, name, request, target=None):
        result = self._api("%s/dataset/%s" % (self.url, name), request, "POST")
        if target is not None:
            result.download(target)
        return result

In my case, I am trying to first get an update on the task before downloading.

@valpesendorfer
Copy link

I'm getting the same issue, the /api/tasks route if cds.climate.copernicus.eu returns a 404 since the migration.

The release notes of 0.7.2 state

Technical/code issues related to the cdsapi applicable to the new system only, may be raised in the [cads-api-client](https://github.com/ecmwf-projects/cads-api-client repository or alternatively using the ECMWF Support Portal. Any other issues raised here or in the cads-api-client will be ignored.
Any other issues, requirements and suggestions for improvement to the cdsapi e.g. issues related to datasets should be raised with our Support team via the ECMWF Support Portal or alternatively shared with other users on the forum.

so I'm unsure if we'll get feedback here

@e5k
Copy link
Author

e5k commented Oct 1, 2024

@valpesendorfer see https://forum.ecmwf.int/t/programatically-get-request-status-error-with-new-cdsapi/6379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants