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

Stdout not available on stats.py #27

Open
pwalczysko opened this issue Sep 24, 2020 · 2 comments · Fixed by ome/omero-py#256 or IDR/deployment#282
Open

Stdout not available on stats.py #27

pwalczysko opened this issue Sep 24, 2020 · 2 comments · Fixed by ome/omero-py#256 or IDR/deployment#282

Comments

@pwalczysko
Copy link
Contributor

See https://github.com/IDR/SubmissionWorkflow/pull/32#issuecomment-698356122 and the follow-up comments and the output below for the bckgr.

Synopsis: If you are not logged in to OMERO and start the stats.py script as per the doc, there will be a wait and no output or warning. The script will not start executing, instead waiting for you to log in, but giving you no indication of that.

[pwalczysko@pilot-idr0072-omeroreadwrite ~]$ /opt/omero/server/venv3/bin/python ~/idr-utils/scripts/stats.py --release prod86 idr0048-abdeladim-chroms -vv >> /tmp/prod86-pw-test.tsv
2020-09-24 14:20:58,264 DEBUG Added file /home/pwalczysko/omero/tmp/.lock_testm_q4hncj.tmp
2020-09-24 14:20:58,264 DEBUG Chose global tmpdir: /home/pwalczysko/omero/tmp
2020-09-24 14:20:58,267 DEBUG Using temp dir: /home/pwalczysko/omero/tmp/omero_pwalczysko/26849
2020-09-24 14:20:59,102 DEBUG Removed /home/pwalczysko/omero/sessions/localhost/demo/02fe74da-ca37-4635-9cf7-d79b1f395e61
2020-09-24 14:20:59,102 DEBUG Removed /home/pwalczysko/omero/sessions/localhost/demo/._LASTSESS_

Long wait

Then, in another terminal, a new ssh and

[pwalczysko@pilot-idr0072-omeroreadwrite ~]$ vi /tmp/prod86-pw-test.tsv

which shows

Previous session expired for demo on localhost:4064
Server: [localhost:4064]
~                                                                               
~                                                                               
~                 

cc @manics @sbesson

@manics
Copy link
Contributor

manics commented Sep 24, 2020

An easy way around this is to add a --output <filename> or --append <filename> argument to the script instead of relying on stdout.

@joshmoore
Copy link
Member

from https://github.com/IDR/SubmissionWorkflow/pull/32#issuecomment-698402503 should ome/omero-py@1657d14 not be updated to also check stdout for tty-ness?

>>> import sys
>>> sys.stdout.isatty()
True
>>>
(base) ~ $python -c "import sys; print(sys.stdout.isatty())" | cat
False

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