Error rendering page view for registerPatient - Logged-in user is not a Provider

How to reproduce

  • Login to demo.openmrs.org/openmrs as Admin (user: admin, password: Admin123)
  • Visit System Administration > Advanced Administration > Manage Users
  • Then under User Management click on 'Add User'

Provide user details such as name, password, role (Organizational: Registration Clerk) and save the user without selecting the checkbox "Create a Provider account for this user"

Eg:- Username: bob , Roles: Organizational: Registration Clerk , Provider

Then logged into the newly created users account and click on "Register a patient"

UI Framework Error
Root Error

java.lang.IllegalStateException: Logged-in user is not a Provider
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)


Full Error

org.openmrs.ui.framework.ViewException: Error rendering page view for registerPatient. Model properties:
sessionContext 
featureToggles 
patient 
primaryIdentifierType 
appId 


Caused by: java.lang.IllegalStateException: Logged-in user is not a Provider
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)

Full Error Log: https://gist.github.com/gayanW/0f22f8732334994ac2bd092283a0a763

Since you intentionally decided not to select the create a provider account for this user checkbox, it looks like you want to propose a way of how we should deal with such. What could that be? :slight_smile:

I only intended that ideally this should not happen. I’m not going to propose any solution though. :smiley: May be we could perform validation in the user creation page.

Just making sure that this is a bug, that need to be fixed… Right? :slight_smile:

Hi, I am also getting Error this my server log

https://hastebin.com/lihihowupi.sql

superAdmin unable to register Patient its giving Error.

Make sure the authenticated user has a provider account

hi , I am editing in regisrationapp_app.json

then after start tomcate server

and after i am hitting url localhost:8080/opemrs

i am getting Error

https://hastebin.com/cucigajoju.swift

From the error logs, it appears like there is something in your controller that makes a call to AtlasService from atlas module, you might want to look into it.

when i am start server that time I am getting Error i am unable to get login screen

https://hastebin.com/pokenenuba.vbs

this is broswer error https://hastebin.com/abajugimaf.vbs

What are you trying to do when you run into this? Is it when you try to access the login page or another page (which page) and you get redirected to the login page?