We're Hiring!

CLI commands return codes

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

CLI commands return codes

Postby dsudar » Wed Jan 30, 2019 11:33 pm

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
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA

Re: CLI commands return codes

Postby jmoore » Thu Jan 31, 2019 10:27 am

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
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: CLI commands return codes

Postby dsudar » Fri Feb 01, 2019 5:38 am

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
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA

Re: CLI commands return codes

Postby jmoore » Fri Feb 01, 2019 9:55 am

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.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: CLI commands return codes

Postby jmoore » Thu Apr 11, 2019 3:14 pm

User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest