nodet / dowml

A library and command line client to use Decision Optimization on IBM Watson Machine Learning (WML). NOT SUPPORTED BY IBM.
Apache License 2.0
3 stars 0 forks source link

`KeyError: 'url'` when dumping a job from a CP4D cluster #52

Closed nodet closed 2 years ago

nodet commented 2 years ago

When dumping a job from a CP4D cluster, I got this:

dowml> dump
2022-02-21 09:41:32,266 Fetching output...
2022-02-21 09:41:32.267 GET https://[...].containers.appdomain.cloud/ml/v4/deployment_jobs/ca733e5e-cd39-4975-b49b-ac43443620c0?version=2021-06-24&space_id=f7ebaf57-67bd-4bef-aadf-1141a0c62b3b
2022-02-21 09:41:32.713 200
2022-02-21 09:41:32,716 Done.
2022-02-21 09:41:32,716 No 'input_data' structure available for this job.
2022-02-21 09:41:32,716 Found a CSV file named stats.csv.
2022-02-21 09:41:32,717 Found a regular file named log.txt.
Storing ca733e5e-cd39-4975-b49b-ac43443620c0/stats.csv
Storing ca733e5e-cd39-4975-b49b-ac43443620c0/log.txt
2022-02-21 09:41:32,719 Found a data asset named afiro.mps.
Storing ca733e5e-cd39-4975-b49b-ac43443620c0/afiro.mps
2022-02-21 09:41:32,719 Downloading asset 097cf6bd-5501-473e-8725-cce9bacf081a in ca733e5e-cd39-4975-b49b-ac43443620c0/afiro.mps...
Traceback (most recent call last):
  File "/Users/nodet/.pyenv/versions/3.9.10/bin/dowml", line 8, in <module>
    sys.exit(interactive())
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/dowml/interactive.py", line 571, in interactive
    main_loop(instance, args.commands, args.input)
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/dowml/interactive.py", line 455, in main_loop
    instance.cmdloop()
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/cmd.py", line 217, in onecmd
    return func(arg)
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/dowml/interactive.py", line 344, in do_dump
    download_data_assets(self.lib.get_input_asset_ids(details))
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/dowml/interactive.py", line 334, in download_data_assets
    self.lib.client_data_asset_download(asset_id, filename)
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/dowml/lib.py", line 408, in client_data_asset_download
    name = self._client.data_assets.download(asset_id, filename)
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/ibm_watson_machine_learning/assets.py", line 374, in download
    content = self.get_content(asset_uid)
  File "/Users/nodet/.pyenv/versions/3.9.10/lib/python3.9/site-packages/ibm_watson_machine_learning/assets.py", line 444, in get_content
    attachment_signed_url = response.json()["url"]
KeyError: 'url'
nodet commented 2 years ago

This was caused by an asset that has been incorrectly created.