Task #12115 (closed)
Opened 10 years ago
Closed 10 years ago
omero hql 'from Job' fails because it attempts to read script parameters
Reported by: | spli | Owned by: | spli |
---|---|---|---|
Priority: | minor | Milestone: | 5.0.1 |
Component: | OmeroPy | Version: | 5.0.0 |
Keywords: | n.a. | Cc: | python-team@…, khgillen |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
$ bin/omero hql 'from Job order by id desc' # Or $ bin/omero hql --limit LARGE_NUMBER 'from Job' Using session 450b8675-e31d-432a-a7c6-588afc611d16 (test1@localhost:4064). Idle timeout: 10.0 min. Current group: test-read-annotate Traceback (most recent call last): File "bin/omero", line 125, in <module> rv = omero.cli.argv() File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/cli.py", line 1195, in argv cli.invoke(args[1:]) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/cli.py", line 745, in invoke stop = self.onecmd(line, previous_args) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/cli.py", line 814, in onecmd self.execute(line, previous_args) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/cli.py", line 894, in execute args.func(args) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/plugins/hql.py", line 44, in __call__ self.hql(args) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/plugins/hql.py", line 67, in hql has_details = self.display(rv) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/plugins/hql.py", line 159, in display self.ctx.out(str(tb.build())) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/util/text.py", line 61, in build columns.append(Column(x, self.results[i])) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/util/text.py", line 77, in __init__ self.width = max(len(str(x).decode("utf-8")) for x in data + [name]) File "/Users/simon/omero-test/OMERO.server-5.0.0-ice35-b19/lib/python/omero/util/text.py", line 77, in <genexpr> self.width = max(len(str(x).decode("utf-8")) for x in data + [name]) File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte
Poking around with %pdb suggests it's because the binary data from the parsejob table may be fetched, which obviously can't be converted to unicode:
%pdb c=omero.cli.CLI() c.loadplugins() c.invoke(['hql','from Job order by id desc']) ... <Traceback> ... ipdb> p input "\xff\xff\xff\xff\x01\x01\x00\x00\x00\x00\x18::omero::grid::JobParams\x16\x01\x00\x00\x11Pychrm_Predict.py\x050.0.1/Tag images based on their classification result%ome-users@lists.openmicroscopy.org.uk\x02\x08Simon Li\x08OME Team\x01\x14University of Dundee\x00\x06\x0eComment_Images\xfe\xff\xff\xff\nTag_Images\xfd\xff\xff\xff\tData_Type\xfc\xff\xff\xff\x0cContext_Name\xfb\xff\xff\xff\x03IDs\xfa\xff\xff\xff\x13Training_Project_ID\xf9\xff\xff\xff\x00\ntext/plain\ntext/plain\x00\x00\x11::omero::Internal\x04\x00\x00\x00\x00\r::Ice::Object\x05\x00\x00\x00\x00\x06\x02\x00\x00\x00\x00\x14::omero::grid::Param;\x00\x00\x00!Add predictions as image comments\x00\x01\xf8\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x013\x00\x01\x03\x05\x00\x00\x00\x00\x03\x00\x00\x00\x01\x045\x00\x00\x00\x1bTag images with predictions\x00\x01\xf8\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x014\x00\x01\x03\x05\x00\x00\x00\x00\x06\x00\x00\x00\x01\x04=\x00\x00\x00#List of Dataset IDs to be predicted\x00\x00\xf7\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x011\x00\x01\x03\x05\x00\x00\x00\x00\x05\x00\x00\x00\x01\x04A\x00\x00\x00'The name of the classification context.\x00\x01\xf6\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x015\x00\x01\x03\x05\x00\x00\x00\x00\x07\x00\x00\x00\x01\x046\x00\x00\x00\x1cProject ID used for training\x00\x00\xf5\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x012\x00\x01\x03\x05\x00\x00\x00\x00\x04\x00\x00\x00\x01\x04:\x00\x00\x00 The source data to be predicted.\x00\x01\xf4\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf3\xff\xff\xff\x011\x00\x01\x03\x05\x00\x00\x00\x00\x06\n\x00\x00\x00\x00\x10::omero::RString\x0c\x00\x00\x00\x07Example\x00\x0e::omero::RType\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x0e::omero::RLong\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\r\x00\x00\x00\x00\x0e::omero::RList\x04\x00\x00\x00\x00\x14::omero::RCollection\r\x00\x00\x00\x02\xf2\xff\xff\xff\xf1\xff\xff\xff\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\t\x00\x00\x00\x01\x08\x04\x00\x00\x00\x01\t\t\x00\x00\x00\x01\xf5\xff\xff\xff\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\x08\x00\x00\x00\x00\x0e::omero::RBool\x05\x00\x00\x00\x01\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\x0c\x00\x00\x00\x01\x05\x0c\x00\x00\x00\x07Dataset\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\x02\x0e\x00\x00\x00\x01\x05\x0c\x00\x00\x00\x07Project\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\x0f\x00\x00\x00\x01\x05\x0c\x00\x00\x00\x07Dataset\x01\x06\x04\x00\x00\x00\x01\x03\x05\x00\x00\x00\x00\x00"
Change History (4)
comment:1 Changed 10 years ago by spli
- Summary changed from omero hql fails because it attempts to read script parameters to omero hql 'from Job' fails because it attempts to read script parameters
comment:2 Changed 10 years ago by jamoore
comment:3 Changed 10 years ago by spli
- Owner set to spli
- Status changed from new to accepted
comment:4 Changed 10 years ago by spli
- Milestone changed from Unscheduled to 5.0.1
- Resolution set to fixed
- Status changed from accepted to closed
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
If you want to unroll this, it's fine to replace the value with "(invalid)" or similar if str(x).decode("utf-8") throws a UnicodeDecodeError.