Unable to Add OOTB groups | Community
Skip to main content
Adobe Employee
June 19, 2024
Solved

Unable to Add OOTB groups

  • June 19, 2024
  • 2 replies
  • 869 views

Hi @1905403,

 

I'm tring to add my custom "Public-Offshore-Author" group to "DAM Users[OOTB]", but Im always getting build failure with following error:

{
  "scripts": [
    "create group \"Public-Offshore-Author\"",
    "set ACL for \"Public-Offshore-Author\"\n  allow jcr:read on /content/mysite/en/Products-and-Services/offshore-energy\n  allow jcr:modifyProperties on /content/mysite/en/Products-and-Services/offshore-energy\n  allow jcr:addChildNodes on /content/mysite/en/Products-and-Services/offshore-energy\n  allow jcr:removeNode on /content/mysite/en/Products-and-Services/offshore-energy\n",
"add \"Public-Offshore-Author\" to group \"DAM Users\"nend"
   ]
}
 
Error:
 
[ERROR] [repoinit] repoinit: Parsing error in repoinit from extension : Encountered " "add" "add "". 
 
Can someone give a fix for this. Please refrain from giving refernces as i have already gone through no. of experience league references.
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 Jagadeesh_Prakash

@avi-adobe  

 

The error message indicates a parsing error due to an unexpected token in the JSON script. Specifically, the error points to the "add" command, which seems to have a typo at the end of the script. The typo is the unexpected "nend" at the end of the last command, which should likely be "end". However, "end" is not necessary unless it's part of a specific syntax required by the system processing these scripts, which doesn't seem to be the case here based on the provided context. The corrected JSON should remove the typo and ensure proper JSON formatting:

 
 
{
"scripts": [
"create group \"Public-Offshore-Author\"",
"set ACL for \"Public-Offshore-Author\" allow jcr:read on /content/mysite/en/Products-and-Services/offshore-energy allow jcr:modifyProperties on /content/mysite/en/Products-and-Services/offshore-energy allow jcr:addChildNodes on /content/mysite/en/Products-and-Services/offshore-energy allow jcr:removeNode on /content/mysite/en/Products-and-Services/offshore-energy",
"add \"Public-Offshore-Author\" to group \"DAM Users\""
]
}

2 replies

Jagadeesh_Prakash
Community Advisor
Jagadeesh_PrakashCommunity AdvisorAccepted solution
Community Advisor
June 19, 2024

@avi-adobe  

 

The error message indicates a parsing error due to an unexpected token in the JSON script. Specifically, the error points to the "add" command, which seems to have a typo at the end of the script. The typo is the unexpected "nend" at the end of the last command, which should likely be "end". However, "end" is not necessary unless it's part of a specific syntax required by the system processing these scripts, which doesn't seem to be the case here based on the provided context. The corrected JSON should remove the typo and ensure proper JSON formatting:

 
 
{
"scripts": [
"create group \"Public-Offshore-Author\"",
"set ACL for \"Public-Offshore-Author\" allow jcr:read on /content/mysite/en/Products-and-Services/offshore-energy allow jcr:modifyProperties on /content/mysite/en/Products-and-Services/offshore-energy allow jcr:addChildNodes on /content/mysite/en/Products-and-Services/offshore-energy allow jcr:removeNode on /content/mysite/en/Products-and-Services/offshore-energy",
"add \"Public-Offshore-Author\" to group \"DAM Users\""
]
}
h_kataria
Community Advisor
Community Advisor
June 19, 2024

end would still be required for the set ACL block I believe. Without it the syntax would still be probably broken. So, it should be something like 

{ "scripts": [ "create group \"Public-Offshore-Author\"", "set ACL for \"Public-Offshore-Author\"\n allow jcr:read on /content/mysite/en/Products-and-Services/offshore-energy\n allow jcr:modifyProperties on /content/mysite/en/Products-and-Services/offshore-energy\n allow jcr:addChildNodes on /content/mysite/en/Products-and-Services/offshore-energy\n allow jcr:removeNode on /content/mysite/en/Products-and-Services/offshore-energy\nend", "add \"Public-Offshore-Author\" to group \"DAM Users\"" ] }

 

arunpatidar
Community Advisor
Community Advisor
June 19, 2024

 

https://sling.apache.org/documentation/bundles/repository-initialization.html

 

 

 

{ "scripts": [ "create group \"Public-Offshore-Author\"", "set ACL for \"Public-Offshore-Author\"\n allow jcr:read on /content/mysite/en/Products-and-Services/offshore-energy\n allow jcr:modifyProperties on /content/mysite/en/Products-and-Services/offshore-energy\n allow jcr:addChildNodes on /content/mysite/en/Products-and-Services/offshore-energy\n allow jcr:removeNode on /content/mysite/en/Products-and-Services/offshore-energy\nend", "add \"Public-Offshore-Author\" to group \"DAM Users\"" ] }

 

 

You can try XML way as well:

https://www.nextrow.com/blog/adobe-experience-manager/getting-started-with-apache-sling-repo-init 

 

 

Arun Patidar