Expand my Community achievements bar.

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.

Avatar

Level 4

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.

BhavaniBharani_0-1703673165068.png

 

Regards,

Bhavani Bharanidharan.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

@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

Avatar

Community Advisor

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

Avatar

Level 4

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.

BhavaniBharani_1-1704265807098.png

 

 

 

Regards,

Bhavani Bharanidharan

 

Avatar

Community Advisor

@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

Avatar

Community Advisor

Hello @BhavaniBharani ,

I have experienced sometimes that deleting and recreating the service user in AEM, resolved the issue. I could see the user in AEM, but it just did not work for me when I had a similar experience.

 

If you want to give it a try to rule that out.

 

Another way could be create a brand new service-user with a different random name and use that in your script. The error should change or give us more data points to work with.

 

Yet another way could be spin up another AEM instance on a different port, create a service-user and load up your script and test. We could try other methods before this one.

 

thanks,

Preetpal

Hi @Preetpal_Bindra  / @aanchal-sikka ,

Thanks for your suggestion, i have created a new service user and mapped that to my bundle. It is working fine now. 

 

Regards,

Bhavani Bharanidharan