We're Hiring!

Database-guest account

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.

Database-guest account

Postby Manz » Mon Dec 12, 2011 7:18 am

Hey Guys,

So we changed the guest account password... which broke webclient. So we found this
http://lists.openmicroscopy.org.uk/pipe ... 02714.html
and attempted to change the password back. Which meant we could get to webadmin and thru that to webclient but not to webclient directly. We realised that the guest account was no longer given the role of 'guest' and we had to have a group assigned to it.

So then I went into the db and in the most hubris mood, altered the groupexperimentermap table, removing the line
703 -103 FALSE 0 1 "blank" 103 0

and deleted the password next to 1 in the password file (this is what was in my sandpit set)

Which broke webadmin thouroughly.

Below is my error. I tried to put in the exact same line, with no help. I am totally lost. Help? Would it be possible to organise a time to skype you or google chat or something to walk through this with you guys tonight as my deadline is thursday.

I can access
http://omero.rcs.griffith.edu.au/webadm ... er/edit/1/
if that helps

Thank you again

Code: Select all
Traceback (most recent call last):

  File "/opt/OmeroServer/lib/python/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/opt/OmeroServer/lib/python/omeroweb/webadmin/views.py", line 154, in wrapped
    return f(request, *args, **kwargs)

  File "/opt/OmeroServer/lib/python/omeroweb/webadmin/views.py", line 223, in wrapped
    return f(request, *args, **kwargs)

  File "/opt/OmeroServer/lib/python/omeroweb/webadmin/views.py", line 379, in experimenters
    controller = BaseExperimenters(conn)

  File "/opt/OmeroServer/lib/python/omeroweb/webadmin/controller/experimenter.py", line 38, in __init__
    self.experimentersList = list(self.conn.listExperimenters())

  File "/opt/OmeroServer/lib/python/omero/gateway/__init__.py", line 2080, in listExperimenters
    for exp in admin_serv.lookupExperimenters():

  File "/opt/OmeroServer/lib/python/omero/gateway/__init__.py", line 2980, in wrapped
    return inner(*args, **kwargs)

  File "/opt/OmeroServer/lib/python/omero/gateway/__init__.py", line 2885, in inner
    return f(*args, **kwargs)

  File "/opt/OmeroServer/lib/python/omero_api_IAdmin_ice.py", line 141, in lookupExperimenters
    return _M_omero.api.IAdmin._op_lookupExperimenters.invoke(self, ((), _ctx))

InternalException: exception ::omero::InternalException
{
    serverStackTrace = ome.conditions.InternalException:  Wrapped Exception: (java.lang.ArrayIndexOutOfBoundsException):
-1
   at java.util.ArrayList.set(ArrayList.java:339)
   at org.hibernate.collection.PersistentList.readFrom(PersistentList.java:409)
   at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1072)
   at org.hibernate.loader.Loader.readCollectionElements(Loader.java:690)
   at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:630)
   at org.hibernate.loader.Loader.doQuery(Loader.java:745)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
   at org.hibernate.loader.Loader.doList(Loader.java:2449)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192)
   at org.hibernate.loader.Loader.list(Loader.java:2187)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1260)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
   at ome.services.query.Query.doInHibernate(Query.java:244)
   at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
   at ome.logic.QueryImpl.execute(QueryImpl.java:142)
   at ome.logic.QueryImpl.findAllByQuery(QueryImpl.java:392)
   at ome.logic.AdminImpl.lookupExperimenters(AdminImpl.java:311)
   at sun.reflect.GeneratedMethodAccessor776.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at ome.security.basic.EventHandler.invoke(EventHandler.java:150)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:231)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy75.lookupExperimenters(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor776.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:83)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:43)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy75.lookupExperimenters(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor777.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:179)
   at ome.services.throttling.Callback.run(Callback.java:56)
   at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:56)
   at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:136)
   at ome.services.blitz.impl.AdminI.lookupExperimenters_async(AdminI.java:242)
   at omero.api._IAdminTie.lookupExperimenters_async(_IAdminTie.java:260)
   at omero.api._IAdminDisp.___lookupExperimenters(_IAdminDisp.java:466)
   at omero.api._IAdminDisp.__dispatch(_IAdminDisp.java:1603)
   at IceInternal.Incoming.invoke(Incoming.java:159)
   at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
   at Ice.ConnectionI.message(ConnectionI.java:972)
   at IceInternal.ThreadPool.run(ThreadPool.java:577)
   at IceInternal.ThreadPool.access$100(ThreadPool.java:12)
   at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)

    serverExceptionClass = ome.conditions.InternalException
    message =  Wrapped Exception: (java.lang.ArrayIndexOutOfBoundsException):
-1
}


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'dActual': 'desktop',
'dVice': 'desktop',
'sessionid': '450795100aac8e1e450629ea365638be',
'setSSO': ''},
META:{'DOCUMENT_ROOT': '/var/www/html',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch',
'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_COOKIE': 'dVice=desktop; dActual=desktop; setSSO=; sessionid=450795100aac8e1e450629ea365638be',
'HTTP_HOST': 'omero.rcs.griffith.edu.au',
'HTTP_REFERER': 'http://omero.rcs.griffith.edu.au/webadmin/experimenters/',
'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.835.202 Chrome/14.0.835.202 Safari/535.1',
'PATH': '/sbin:/usr/sbin:/bin:/usr/bin',
'PATH_INFO': u'/webadmin/experimenters/',
'PATH_TRANSLATED': '/opt/OmeroServer/var/omero.fcgi/webadmin/experimenters/',
'QUERY_STRING': '',
'REMOTE_ADDR': '132.234.220.105',
'REMOTE_PORT': '48958',
'REQUEST_METHOD': 'GET',
'REQUEST_URI': '/webadmin/experimenters/',
'SCRIPT_FILENAME': '/opt/OmeroServer/var/omero.fcgi',
'SCRIPT_NAME': u'',
'SERVER_ADDR': '132.234.221.194',
'SERVER_ADMIN': 'root@localhost',
'SERVER_NAME': 'omero.rcs.griffith.edu.au',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SIGNATURE': '<address>Apache/2.2.3 (CentOS) Server at omero.rcs.griffith.edu.au Port 80</address>\n',
'SERVER_SOFTWARE': 'Apache/2.2.3 (CentOS)',
'wsgi.errors': <flup.server.fcgi_base.TeeOutputStream object at 0xd9efe50>,
'wsgi.input': <flup.server.fcgi_base.InputStream object at 0xda110d0>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>
Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: Database-guest account

Postby Manz » Mon Dec 12, 2011 7:25 am

Actually, i played around a bit and i can't access the root 0 but i can access all other people's experimenter editor

http://omero.rcs.griffith.edu.au/webadm ... er/edit/0/

but i can access all other peoples experimenter accounts (changing the 0) including the 1
http://omero.rcs.griffith.edu.au/webadm ... er/edit/1/
Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: Database-guest account

Postby Manz » Mon Dec 12, 2011 7:46 am

I noticed that in groupexperimentermap

there was a -1?


1 -35 FALSE 0 0 1 1
3 -103 TRUE 0 0 3 7
4 -103 FALSE 0 2 3 0
7 -103 FALSE 0 3 3 3
8 -103 FALSE 0 3 1 2
9 -103 TRUE 0 0 4 -1 <====
10 -103 TRUE 0 4 4 2
11 -103 FALSE 0 4 1 1
Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: Database-guest account

Postby atarkowska » Mon Dec 12, 2011 10:34 am

Hi,

Could you please give more detail how did you change guest password before?

Referring to you groupexperimetermap table, could you run the following query:

Code: Select all
select e.id, e.omename, g.id, g.name from groupexperimentermap as gem, experimenter as e, experimentergroup as g where gem.parent=g.id and gem.child=e.id order by e.omename ASC


In my table I have the following entries:
table: groupexperimetermap
0;-35;TRUE;0;0;;0;0 <- root in system group
1;-35;FALSE;0;0;;1;1 <- root in user group
2;-35;FALSE;0;1;;2;0 <- guest in guest group

Thanks
Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: Database-guest account

Postby Manz » Mon Dec 12, 2011 10:40 am

the sql is below

We used the webadmin interface the first time. The second time, we went straight to
http://omero.rcs.griffith.edu.au/webadm ... er/edit/1/

When I noticed the -1, i tried to change it to a 1 to see what would happen, then i got the following, so i left it alone.

Code: Select all
5      "Anwar"      5      "Adrians Projects_public"
5      "Anwar"      4      "Adrians Projects_private"
5      "Anwar"      1      "user"
2      "Chief Investigator"      3      "Test group_private"
202      "delete"      5      "Adrians Projects_public"
1      "guest"      103      "not used"
0      "root"      3      "Test group_private"
0      "root"      1      "user"
0      "root"      153      "Amandas Test Group_private"
0      "root"      4      "Adrians Projects_private"
0      "root"      154      "Amandas Test Group_public"
0      "root"      5      "Adrians Projects_public"
0      "root"      0      "system"
0      "root"      53      "Test group_public"
52      "s1174959"      53      "Test group_public"
52      "s1174959"      3      "Test group_private"
52      "s1174959"      1      "user"
153      "s2097884"      5      "Adrians Projects_public"
153      "s2097884"      1      "user"
153      "s2097884"      4      "Adrians Projects_private"
152      "s2172046"      5      "Adrians Projects_public"
152      "s2172046"      4      "Adrians Projects_private"
152      "s2172046"      1      "user"
3      "s2174555"      0      "system"
3      "s2174555"      3      "Test group_private"
3      "s2174555"      53      "Test group_public"
3      "s2174555"      154      "Amandas Test Group_public"
3      "s2174555"      1      "user"
3      "s2174555"      153      "Amandas Test Group_private"
3      "s2174555"      4      "Adrians Projects_private"
3      "s2174555"      5      "Adrians Projects_public"
4      "s2571328"      0      "system"
4      "s2571328"      1      "user"
4      "s2571328"      5      "Adrians Projects_public"
4      "s2571328"      4      "Adrians Projects_private"
102      "s2686739"      0      "system"
102      "s2686739"      53      "Test group_public"
102      "s2686739"      1      "user"
102      "s2686739"      153      "Amandas Test Group_private"
102      "s2686739"      3      "Test group_private"
102      "s2686739"      5      "Adrians Projects_public"
102      "s2686739"      4      "Adrians Projects_private"
102      "s2686739"      154      "Amandas Test Group_public"


my groupexperimentermap table
Code: Select all

0      -35      TRUE      0      0            0      5
1      -35      FALSE      0      0            1      -2   <==== changed on its own
3      -103      TRUE      0      0            3      7
4      -103      FALSE      0      2            3      0
7      -103      FALSE      0      3            3      3
8      -103      FALSE      0      3            1      2
9      -103      TRUE      0      0            4      -1  <== i changed to 1 and the above line altered
10      -103      TRUE      0      4            4      2
11      -103      FALSE      0      4            1      1
12      -103      TRUE      0      4            5      0
13      -103      FALSE      0      5            4      0
14      -103      FALSE      0      5            1      1
15      -103      FALSE      0      5            5      2
53      -103      FALSE      0      52            3      0
54      -103      FALSE      0      52            1      1
103      -103      TRUE      0      102            5      0
105      -103      TRUE      0      3            4      0     
153      -103      FALSE      0      3            53      1
203      -103      TRUE      0      102            4      3
254      -103      TRUE      0      0            5      4
303      -103      TRUE      0      102            154      4
304      -103      TRUE      0      102            153      2
305      -103      FALSE      0      102            0      5
353      -7      TRUE      0      3            5      5
403      -7      FALSE      0      3            153      6
404      -7      FALSE      0      3            154      4
405      -7      TRUE      0      0            153      6
406      -7      TRUE      0      0            154      3
407      -7      TRUE      0      0            53      2
453      -103      FALSE      0      52            53      2
503      -103      FALSE      0      152            5      0
504      -103      FALSE      0      152            1      1
505      -103      FALSE      0      4            0      3
506      -103      FALSE      0      153            4      0
507      -103      FALSE      0      153            1      1
508      -103      FALSE      0      153            5      2
509      -103      FALSE      0      152            4      2
510      -103      FALSE      0      102            3      1
511      -103      FALSE      0      102            53      6
512      -103      FALSE      0      3            0      7
553      -103      FALSE      0      102            1      7
605      -103      FALSE      0      202            5      0
703      -103      FALSE      0      1            103      0

Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: Database-guest account

Postby jmoore » Mon Dec 12, 2011 10:52 am

Amanda,

the important thing is that the column with the negative values (the child_index) should form the values of an array, like 0,1,2,3. The first value is considered the default group. There's a trigger in place that will enforce the uniqueness of the array, which is why you are seeing odd changes happen by themselves. I'll try to write out a script in just a bit which will correct the situation.

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

Re: Database-guest account

Postby jmoore » Mon Dec 12, 2011 11:56 am

Hi Amanda,

It looks like just the root user has been de-grouped, so to speak, though we also need to fix the the name of the "guest" users group (previously "guest"). The following script should fix up your issues. Be sure to capture the output in case things aren't completely corrected afterwards.

Cheers,
~Josh.

Code: Select all

-- Current groups for root
-- 0      -35      TRUE        0      0            0      5
-- 1      -35      FALSE       0      0            1      -2   <==== changed on its own
-- 3      -103      TRUE       0      0            3      7
-- 9      -103      TRUE       0      0            4      -1  <== i changed to 1 and the above line altered

BEGIN;
-- Print everything just in case.
copy groupexperimentermap to stdout;
copy experimentergroup to stdout;

-- This changes the "not used" group back to "guest"
update experimentergroup set name = 'guest' where id = 103;

-- Now we fix up root.
update groupexperimentermap set child_index = 0 where id = 0 and child = 0 and parent = 0;
update groupexperimentermap set child_index = 1 where id = 1 and child = 0 and parent = 1;
update groupexperimentermap set child_index = 2 where id = 3 and child = 0 and parent = 3;
update groupexperimentermap set child_index = 3 where id = 9 and child = 0 and parent = 4;

copy groupexperimentermap to stdout;

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

Re: Database-guest account

Postby Manz » Mon Dec 12, 2011 12:03 pm

update experimentergroup set name = 'guest' where id = 103;
ERROR: duplicate key value violates unique constraint "experimentergroup_name_key"
Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: Database-guest account

Postby Manz » Mon Dec 12, 2011 12:09 pm

Ive got

103 "" -7 "not used" 0;
2;"";-103;"guest";0
in there.....

so "DELETE experimentergroup WHERE id=2"

?
Last edited by Manz on Mon Dec 12, 2011 12:33 pm, edited 1 time in total.
Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Re: Database-guest account

Postby Manz » Mon Dec 12, 2011 12:13 pm

Actually i'll show you my table

Code: Select all
0       ""       -103       "system"       0
1       ""       -35       "user"       0
2       ""       -103       "guest"       0
3       ""       -103       "Test group_private"       0
4       "Private"       -103       "Adrians Projects_private"       0
5       "public"       -7       "Adrians Projects_public"       0
53       ""       -7       "Test group_public"       0
103       ""       -7       "not used"       0
153       ""       -103       "Amandas Test Group_private"       0
154       ""       -7       "Amandas Test Group_public"       0

Manz
 
Posts: 72
Joined: Wed Jun 29, 2011 11:48 pm

Next

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest