What roles should the scheduler user have?

We are running 2.1 modules with some on core 1.10

We are consistently getting this error in the logs:

INFO - HibernateContextDAO.authenticate(181) |2015-04-12 08:11:03,393| Failed login attempt (login=scheduler) - Invalid username and/or password: scheduler
ERROR - AbstractAddressHierarchyTask.authenticate(59) |2015-04-12 08:11:03,394| Error authenticating user. Please ensure you scheduler username and password are configured correctly in your global properties
org.openmrs.api.context.ContextAuthenticationException: Invalid username and/or password: scheduler
        at org.openmrs.api.db.hibernate.HibernateContextDAO.authenticate(HibernateContextDAO.java:182)
        at sun.reflect.GeneratedMethodAccessor1223.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:309)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at com.sun.proxy.$Proxy269.authenticate(Unknown Source)
        at org.openmrs.api.context.UserContext.authenticate(UserContext.java:103)
        at org.openmrs.api.context.Context.authenticate(Context.java:296)
        at org.openmrs.module.addresshierarchy.scheduler.AbstractAddressHierarchyTask.authenticate(AbstractAddressHierarchyTask.java:56)
        at org.openmrs.module.addresshierarchy.scheduler.AbstractAddressHierarchyTask.run(AbstractAddressHierarchyTask.java:34)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

I believe this is because there is no user named scheduler in our system. This seems to be associated with the Scheduler process.

This line in Advanced Settings (see attached JPG) sets this username and password.

So my question is, when we set up the scheduler user, what ROLEs should this user have so that the user has proper permissions to do it’s work?

Thanks, Adam

Dear @soddoadam,

I’m sorry you haven’t received an answer to your question yet. In my experience, I have always used the Super User role for the scheduler. I assume you could have a more limited role, depending on what you ask the scheduler to do, but this may change over time, and cause you problems in the future.

Hope this helps!

Thanks, James

1 Like