Page 1 of 1

Adding Data to OMERO table

PostPosted: Tue Feb 19, 2013 7:25 pm
by icaoberg
i am trying to add data to the table (see columns.png) and i get the error in screenshot.png

i have never seen this error before. this method used to work with the old API (version 4.3). i am aware some changes have occurred in the newer versions. where can i find the docs regarding changes in omero.tables?

ivan

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 9:35 am
by manics
Hi Ivan

There shouldn't be any breaking changes to the public Tables API between 4.3 and 4.4. Are you creating a new table, or updating an existing one created under 4.3 (it shouldn't make a difference but would be useful to know)? Have you checked the OMERO logs to for more information: omero.server/var/log/{master.err,Tables-0.log,Blitz-0.log}? Which version of the 4.4 server are you using?

Also can you paste/link to your code?

Thanks

Simon

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 3:49 pm
by icaoberg
This is the code I am using for my test. I am using OMERO 4.4.6. Like I mentioned before the test

Code: Select all
execfile( 'login.py' )

did = 2
iids = pyslid.utilities.getListOfImages( connection, did )
iid=iids[0]
scale=1
set="slf33"
field=True
rid=None
pixels=0
channels=[0]
channel=channels[0]
zslice=0
timepoint=0
threshold=None
debug=True

print "iid:" + str(iid)
[fids,features,scale]=pyslid.features.calculate( connection, iid, scale, set, field, rid, pixels, channels, zslice, timepoint, threshold, debug )

columns = []
columns.append( omero.grid.LongColumn( 'pixels', 'Pixel Index', [] ))
columns.append( omero.grid.LongColumn( 'channel', 'Channel Index', [] ))
columns.append( omero.grid.LongColumn( 'zslice', 'zSlice Index', [] ))
columns.append( omero.grid.LongColumn( 'timepoint', 'Time Point Index', [] ))
columns.append( omero.grid.LongColumn( 'scale', 'Scale', [] ))

for fid in fids:
   columns.append( omero.grid.DoubleColumn( str(fid), str(fid), [] ))

[answer, result] = pyslid.features.hasTable( connection, iid, set, field )

table = connection.getSharedResources().newTable( 1, 'table.h5' )

#create file link
flink = omero.model.ImageAnnotationLinkI()
#create annotation
annotation = omero.model.FileAnnotationI()
#link table to annotation object
annotation.file = table.getOriginalFile()
#create an annotation link between image and table
flink.link( omero.model.ImageI(iid, False), annotation )
connection.getUpdateService().saveObject(flink)

# append the new data
columns[0].values.append( long(pixels) )
columns[1].values.append( long(channel) )
columns[2].values.append( long(zslice) )
columns[3].values.append( long(timepoint) )

#icaoberg april 20, 2012
columns[4].values.append( float(scale) )
for i in range(5, len(fids)+5):
    columns[i].values.append( float(features[i-5]) )

table.addData( columns )


The OMERO diagnostics show
Code: Select all
================================================================================
OMERO Diagnostics 4.4.6-ice34-b102
================================================================================
       
Commands:   java -version                  1.7.0     (/usr/bin/java)
Commands:   python -V                      2.7.3     (/usr/bin/python)
Commands:   icegridnode --version          3.4.2     (/usr/bin/icegridnode)
Commands:   icegridadmin --version         3.4.2     (/usr/bin/icegridadmin)
Commands:   psql --version                 9.1.8     (/usr/bin/psql -- 2 others)

Server:     icegridnode                    running
Server:     Blitz-0                        active (pid = 2110, enabled)
Server:     DropBox                        active (pid = 2486, enabled)
Server:     FileServer                     active (pid = 2124, enabled)
Server:     Indexer-0                      active (pid = 2113, enabled)
Server:     MonitorServer                  active (pid = 2123, enabled)
Server:     OMERO.Glacier2                 active (pid = 2116, enabled)
Server:     OMERO.IceStorm                 active (pid = 2128, enabled)
Server:     PixelData-0                    active (pid = 2126, enabled)
Server:     Processor-0                    active (pid = 2395, enabled)
Server:     Tables-0                       active (pid = 2659, enabled)
Server:     TestDropBox                    inactive (enabled)

OMERO:      SSL port                       4064
OMERO:      TCP port                       4063

Log dir:    /home/omero/bin/omero.server/var/log exists

Log files:  Blitz-0.log                    31.0 MB       errors=13   warnings=225
Log files:  DropBox.log                    11.0 KB       errors=12   warnings=6   
Log files:  FileServer.log                 0.0 KB       
Log files:  Indexer-0.log                  1.0 MB        errors=227  warnings=135
Log files:  MonitorServer.log              2.0 KB       
Log files:  OMEROweb.log                   0.0 KB       
Log files:  OMEROweb_request.log           0.0 KB       
Log files:  PixelData-0.log                13.0 KB       errors=22   warnings=24 
Log files:  Processor-0.log                29.0 KB       errors=3    warnings=14 
Log files:  Tables-0.log                   122.0 KB      errors=6    warnings=188
Log files:  TestDropBox.log                n/a
Log files:  master.err                     0.0 KB       
Log files:  master.out                     0.0 KB       
Log files:  Total size                     33.39 MB

Parsing Blitz-0.log:[line:119] => Server restarted <=
Parsing Blitz-0.log:[line:329] => Server restarted <=
Parsing Blitz-0.log:[line:201764] => Server restarted <=

Environment:OMERO_HOME=/home/omero/bin/omero.server
Environment:OMERO_NODE=(unset)             
Environment:OMERO_MASTER=(unset)           
Environment:PATH=/home/omero/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-6-openjdk/bin:/usr/lib/jvm/java-6-openjdk/bin:/usr/lib/debug/usr/bin/bin:/usr/lib/postgresql/9.1//bin:/home/omero/bin/omero.server/bin:/usr/lib/jvm/java-6-openjdk/bin:/usr/lib/jvm/java-6-openjdk/bin:/usr/lib/debug/usr/bin/bin:/usr/lib/postgresql/9.1//bin:/home/omero/bin/omero.server/bin
Environment:ICE_HOME=/usr/lib/debug/usr/bin
Environment:LD_LIBRARY_PATH=/usr/share/java:/usr/lib:
Environment:DYLD_LIBRARY_PATH=/usr/share/java:/usr/lib:/usr/share/java:/usr/lib:

OMERO data dir: '/OMERO.searcher'   Exists? True   Is writable? True
OMERO.web status... [NOT STARTED]

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 3:55 pm
by icaoberg
I attached the log files. They seem to mention problems with Ice. I am running Ice 3.4 on OMERO 4.4.6. Other than that I have no idea what else to do. According to the diagnostics there is nothing wrong with Ice neither OMERO tables.

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 4:22 pm
by manics
Would you mind uploading (or email me directly) the whole of the logs directory? Is this a completely fresh installation, or an upgrade of an older OMERO 4.3 server?

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 5:58 pm
by icaoberg
fresh installation in an ubuntu virtual machine. i could send you vm if you wanted also. ill email you the logs in the meantime.

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 6:03 pm
by manics
I'll have a look at the logs first, if that doesn't help I'll take a look at your VM- let me know how to download it.

Re: Adding Data to OMERO table

PostPosted: Wed Feb 20, 2013 6:16 pm
by icaoberg
already sent you the logs.

Re: Adding Data to OMERO table

PostPosted: Thu Feb 21, 2013 12:12 am
by manics
Hi Ivan

Code: Select all
table = connection.getSharedResources().newTable( 1, 'table.h5' )
....
table.addData( columns )

You need a call to table.initialize(columns) in between creating the table and adding data.

The server should have detected this and returned an informative message instead of an InternalException. The fact that it didn't is a bug, so I've created a ticket for it (#10432).

I also had a look through your logs and as you say there's seems to be an abnormal number of Ice related warnings/errors, I don't know what's causing them though.

Hope this helps

Simon