Expand my Community achievements bar.

Unable to Add OOTB groups

Avatar

Employee

Hi @All,

 

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.
3 Replies

Avatar

Community Advisor

@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\""
]
}

Avatar

Level 4

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\""
   ]
}

 

Avatar

Community Advisor

 

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