We're Hiring!

CLI command "omero login" crashes on LDAP user

General user discussion about using the OMERO platform to its fullest. Please ask 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

There are workflow guides for various OMERO functions on our help site - http://help.openmicroscopy.org

You should find answers to any basic questions about using the clients there.

CLI command "omero login" crashes on LDAP user

Postby Sethur » Mon Oct 13, 2014 3:26 pm

Hi,

when I try to login with an existing LDAP user that has not yet been (automatically) imported into omero, i.e. the user hasn't logged in yet and I want to do that for him/her on the command line so that his account gets created, Java crashes. The command I am trying to use is:

Code: Select all
omero login -s localhost -u jdoe --sudo=root


The crash looks like this:

Code: Select all
InternalException: Failed to connect: exception ::omero::RemovedSessionException
{
    serverStackTrace = ome.conditions.RemovedSessionException: Cannot find a user with name jdoe
        at ome.services.sessions.SessionManagerImpl.executeLookupUser(SessionManagerImpl.java:1239)
        at ome.services.sessions.SessionManagerImpl.access$100(SessionManagerImpl.java:87)
        at ome.services.sessions.SessionManagerImpl$2.doWork(SessionManagerImpl.java:314)
        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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.services.util.Executor$Impl$Interceptor.invoke(Executor.java:576)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at ome.security.basic.EventHandler.invoke(EventHandler.java:154)
        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:241)
        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 com.sun.proxy.$Proxy69.doWork(Unknown Source)
        at ome.services.util.Executor$Impl.execute(Executor.java:457)
        at ome.services.sessions.SessionManagerImpl.createSession(SessionManagerImpl.java:306)
        at ome.services.sessions.SessionManagerImpl.createWithAgent(SessionManagerImpl.java:254)
        at ome.services.sessions.SessionBean$2.call(SessionBean.java:112)
        at ome.services.sessions.SessionBean$2.call(SessionBean.java:110)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

    serverExceptionClass = ome.conditions.RemovedSessionException
    message = Cannot find a user with name jdoe
}


So it is apparantly not possible to login via the CLI when using --sudo=root in case the LDAP user is not yet in the OMERO db.

What would be the proper way to do this?

Cheers,

Tristan
Sethur
 
Posts: 112
Joined: Thu Jan 16, 2014 11:34 pm

Re: CLI command "omero login" crashes on LDAP user

Postby jmoore » Mon Oct 13, 2014 6:41 pm

Hi Tristan,

thanks for the bug report. I certainly haven't seen nor tried this before. See https://trac.openmicroscopy.org.uk/ome/ticket/12597

If you know the user is in LDAP, though, you can workaround this by logging in as the root user and calling `ldap create`:

Code: Select all
bin/omero login root@localhost
bin/omero ldap create jdoe


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


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest