The provided service user id 'workflow-user' is not a known JCR system user id and therefore not allowed in the Sling Service User Mapper. | Community
Skip to main content
Level 4
December 27, 2023
Solved

The provided service user id 'workflow-user' is not a known JCR system user id and therefore not allowed in the Sling Service User Mapper.

  • December 27, 2023
  • 2 replies
  • 2670 views

Hi All,

I am facing an issue in my Local AEM instance where i am trying to run a existing asset archival Schedular from my develop branch. I am getting this Null pointer Exception  and "The provided service user id 'workflow-user' is not a known JCR system user id and therefore not allowed in the Sling Service User Mapper" errors in error.log. I have added the workflow-user to admin user also. Still i am facing the error. Because of this my resource is passing as null and my schedular fails to run the job. Please help me with this issue if you can. Thanks much in advance.

 

Regards,

Bhavani Bharanidharan.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

@bhavanibharani 

 

Please assure following:

  • the user is created as a Service user
  • ServiceUserMapperImpl config is available

 

The steps for setting up service user are detailed at 

https://sourcedcode.com/blog/aem/create-system-service-users-in-aem-6-5-with-code-configurations

2 replies

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
December 27, 2023

@bhavanibharani 

 

Please assure following:

  • the user is created as a Service user
  • ServiceUserMapperImpl config is available

 

The steps for setting up service user are detailed at 

https://sourcedcode.com/blog/aem/create-system-service-users-in-aem-6-5-with-code-configurations

Aanchal Sikka
Preetpal_Bindra
Community Advisor
Community Advisor
December 27, 2023

As pointed out, the issue does not seem to permissions related. To get resourceresolver object in the code, a user of type = "service-user", is needed.  

From the error posted in the original post, it seems that "workflow-user" is not of type "service-user".

Could you try creating a user with that type and name and give the user permissions to read/write as appropriate and give it another try.

You could also create a small workflow with just that 1 step to get the resourceresolver object and print it to the logs to save development and unit testing time.

 

thanks,

Preetpal

Level 4
January 3, 2024

Hi @preetpal_bindra , Apologies for the delayed response. I can see that the workflow-user is already created as a service-user. This code is working fine in the higher environments and in my local instance windows laptop. I am trying to run the archival workflow using the existing code in MAC now. Getting the error which i mentioned earlier. Could you please guide to resolve the issue if possible. Thanks in advance.

 

 

 

Regards,

Bhavani Bharanidharan

 

aanchal-sikka
Community Advisor
Community Advisor
January 3, 2024

@bhavanibharani 

 

The set-up from Screenshot doesn't seem right.

- Administrator is a user

- workflow-users is a group.

 

Could you possibly share the screenshot, how you have verified that a workflow-user is a service user? Also, how did you validate the permissions for this user?

Aanchal Sikka