Running headless with --omero-credentials doesn't work


I have a problem with running CP headless when using it with OMERO.
If I run:

> python -r -c --omero-credentials host=localhost,port=4064,session-id=session_id --data-file=image_list.csv -p pipe.cppipe result.mat

CP starts the Display and fails to run in the server environment without a Display Server.

After adding this:

if '-c' in args:
    import cellprofiler.preferences as cpprefs

as the first 3 lines in main() in and this:

 import cellprofiler.preferences as cpprefs

as the first 2 lines in run_pipeline_headless() in it runs headless without calling display server.
As far as I can tell the first addition disables calls to the display from set_omero_credentials_from_string() (or in fact from bioformats/ when the first connection to OMERO happens and then the second addition disables it for all the subsequent calls. Since I’m not very familiar with the CP code I’m not sure whether it will not break something elsewhere.

Any thoughts?

Kind Regards,
Emil Rozbicki

Thanks Emil,
I’ve logged this as … ssues/1196 in our bug tracker. I’ll get around to fixing it within about a week (busy schedule) unless you feel uncomfortable with the patch you’ve added. Nice diagnosis - I think your patch won’t break anything. I’d like to review the initialization order of things before doing what you suggest.


Hi Lee,

thanks a lot. So far all worked fine for me so I’m happy to use the current fix for now.