Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12597 (closed)

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

Bug: sudo & ldap create user fails

Reported by: jamoore Owned by: bpindelski
Priority: minor Milestone: 5.1.0-m3
Component: Security Version: 5.0.5
Keywords: LDAP Cc: bpindelski
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: n.a.

Description

See: https://www.openmicroscopy.org/community/viewtopic.php?f=4&t=7656

omero login -s localhost -u jdoe --sudo=root

fails with the error below if the user has not yet logged in:

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
}

Change History (4)

comment:1 Changed 9 years ago by bpindelski

The best thing we can do here without bloating the logic of the login method in sessions.py is to catch this exception and present it in a saner fashion to the user. Bottom line - if a user doesn't exist in the OMERO DB, nothing will allow a login until this experimenter is created.

PR now open: https://github.com/openmicroscopy/openmicroscopy/pull/3106.

comment:2 Changed 9 years ago by bpindelski

  • Owner set to bpindelski
  • Status changed from new to accepted

comment:3 Changed 9 years ago by bpindelski

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:4 Changed 9 years ago by Josh Moore <josh.moore@…>

  • Remaining Time set to 0

(In [936272078fd2efa66943d59b575531c992e8c983/ome.git] on branch develop) Merge pull request #3106 from bpindelski/12597_error_msg

Fix #12597: Update the exception handling in "login".

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.66378 sec.)

We're Hiring!