Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hello I Was Trying To Download The Task Log Using Api In Python I'M Using

Hello
I was trying to download the task log using API in Python
I'm using client.events.download_task_log(task="task_id_string") but for some reason I always get an error:
ValueError: Missing meta section in response payload
Am I missing something obvious?

PS. I'm using http://app.clear.ml with self-hosted compute cluster

  
  
Posted 2 years ago
Votes Newest

Answers 26


Perhaps it is connected with the issue mentioned here (since I authenticate with the same credentials)
https://clearml.slack.com/archives/CTK20V944/p1652351085434649

  
  
Posted 2 years ago

Hi CrabbyKoala94
I am working on your issue, I will update you asap. Thanks

  
  
Posted 2 years ago

If the AWS machine has an ssh key installed, it should work - I assume it's possible to either use a custom AMI for that, or you can use the autoscaler instance startup bash script

  
  
Posted 2 years ago

I'm not sure I got it, sorry

I'm actually running the script from my local PC with clearml-init initialized using credentials generated on ClearML settings webpage (where you generate app credentials)

  
  
Posted 2 years ago

oups please pardon me I made a confusion, this answer is not related to your issue. my fault 🙏

  
  
Posted 2 years ago

Ah, I was actually going to ask whether this is for sure related to my issue but I figured - nah, it must me be who is not getting it 😄

  
  
Posted 2 years ago

🙂
here is a bit of code that seems to do the job. have a look
`
wrapper = Task.get_task(project_name="***", task_name="***")

req_obj = events.DownloadTaskLogRequest(wrapper.id)
res = wrapper.session.send_request(
service=req_obj._service,
action=req_obj._action,
version=req_obj._version,
json=req_obj.to_dict(),
method=req_obj._method,
async_enable=False,
headers=None,
)
print(res.json()) `

  
  
Posted 2 years ago

For some reason it does not work for me 😕
req_obj = client.events.DownloadTaskLogRequest(clearml_task.id) AttributeError: 'Events' object has no attribute 'DownloadTaskLogRequest'

  
  
Posted 2 years ago

Hi CrabbyKoala94 , the download log request actually returns a different payload and is meant for the browser to intercept

  
  
Posted 2 years ago

I suggest using cURL and figuring out how to store the plain text response into a file

  
  
Posted 2 years ago

For some reason it does not work for me

req_obj = client.events.DownloadTaskLogRequest(clearml_task.id) AttributeError: 'Events' object has no attribute 'DownloadTaskLogRequest'SweetBadger76 I think you missed the events import - this is not client.events

  
  
Posted 2 years ago

Yep sorry I have not pasted the import line. You should add something like this :

from clearml.backend_api.services import events

🙏

  
  
Posted 2 years ago

After fixing imports I was able to successfully run the code
Thanks a lot!

However I'm still curious why the first option I pasted in the original message did not work + do you have any update about the issue when downloading logs from the UI?

  
  
Posted 2 years ago

The first thing you tried didn't work since the APIclient is not designed to receive plain text response, just Jason response

  
  
Posted 2 years ago

JSON

  
  
Posted 2 years ago

This is actually one of the only endpoints that returns this kind of output

  
  
Posted 2 years ago

I see
Thanks for explanation!

And are there any updates about downloading logs from UI bug? 🙂

  
  
Posted 2 years ago

You mean downloading logs from an experiment in a workspace you've been invited to?

  
  
Posted 2 years ago

yes

  
  
Posted 2 years ago

Already in the pipeline, should be available in the next server update 🙂

  
  
Posted 2 years ago

(undergoing tests)

  
  
Posted 2 years ago

Amazing! 🤩
Thank you for the info!

  
  
Posted 2 years ago

Hi SuccessfulKoala55 !
Any update regarding pushing new version with a fix? 🙂

  
  
Posted 2 years ago

it should be released ub about two weeks, I think

  
  
Posted 2 years ago

Any update regarding pushing new version with a fix?

CrabbyKoala94 a patch fixing this was deployed today - please take a look and see if your issue was resolved :)

  
  
Posted 2 years ago

SuccessfulKoala55 it's working!
Thank you very much for letting me know 😄

  
  
Posted 2 years ago