Page 1 of 1

CLI commands return codes

PostPosted: Wed Jan 30, 2019 11:33 pm
by dsudar
Hi team,

We're extensively using CLI commands in bash scripts and in system calls from other languages to automate many tasks. However, I cannot find much about what return codes the various CLI commands return and what they mean. Is there a table somewhere with those return codes or other values that one may want/need to capture? We're currently using "omero export" a lot.

Thanks,
- Damir

Re: CLI commands return codes

PostPosted: Thu Jan 31, 2019 10:27 am
by jmoore
Hi Damir,

I cannot find much about what return codes the various CLI commands return and what they mean. Is there a table somewhere with those return codes or other values that one may want/need to capture?


There currently is not, no. It'd be fairly straight-forward to have each command print its error codes, but there isn't a lot of uniformity in the messaging at the moment. Do you have a feeling for the broad types of errors that you are trying to detect and respond to (other than just "non-zero")?

~Josh

Re: CLI commands return codes

PostPosted: Fri Feb 01, 2019 5:38 am
by dsudar
Hi Josh,

Right now we’re focused on export and are e.g. seeing a return value of 52 regularly. It appears to be related with a temporarily unavailable session and typically a re-try is successful. But return values indicating a permission problem or a request for a non-existent image would not benefit from a re-try. So it would be good to be able to tell which ones are transient returns and which are real dead-end errors. And of course some cli commands return actually usable values and a clear understanding what those are is critical.

Thanks,
Damir

Re: CLI commands return codes

PostPosted: Fri Feb 01, 2019 9:55 am
by jmoore
Hi Damir,

thanks for the explanation. We'll look into getting a description of these into the bin/omero help.

dsudar wrote:Right now we’re focused on export and are e.g. seeing a return value of 52 regularly. It appears to be related with a temporarily unavailable session and typically a re-try is successful.


The only error code of 52 I see is for a bad query:

Code: Select all
components/tools/OmeroPy/src/omero/plugins $git grep -e "die.*[^0-9]52[^0-9]"
hql.py:            self.ctx.die(52, "Bad query: %s" % qe.message)


have you seen that in your output?

And of course some cli commands return actually usable values and a clear understanding what those are is critical.


Do you mean useful return codes or more the standard out? If the latter, then agreed.

~J.

Re: CLI commands return codes

PostPosted: Thu Apr 11, 2019 3:14 pm
by jmoore