tacitknowledge / aem-cookbook

Chef cookbook for Adobe AEM
79 stars 64 forks source link

Issue creating user with group #30

Closed tmaier closed 9 years ago

tmaier commented 9 years ago

AEM 6 with SP2.

Fails to add user

Error message:

javax.jcr.RepositoryException: Cannot remove 'peterpan' from group everyone

Fix:

Add membership to group everyone to curl command.

  :add_user => {
    :aem55 => 'curl -u <%= admin_user %>:<%= admin_password %> -FcreateUser= -FauthorizableId=<%= user %> -Frep:password=<%= password %> -Fmembership=<%= group %> -Fmembership=everyone http://localhost:<%= port %>/libs/granite/security/post/authorizables'
  }

Original code

        aem_user user['name'] do
          password user['password']

          # port node[:aem][:author][:port]
          port '3000'
          admin_user node[:aem][:author][:admin_user]
          admin_password node[:aem][:author][:admin_password]

          aem_version node[:aem][:version]
          group user['group']

          action :add
        end

HTTP request & response

C-13-#000000 -> [POST /libs/granite/security/post/authorizables HTTP/1.1 ]
C-13-#000057 -> [Authorization: Basic YWRtaW46YWRtaW4= ]
C-13-#000096 -> [User-Agent: curl/7.29.0 ]
C-13-#000121 -> [Host: localhost:3000 ]
C-13-#000143 -> [Accept: */* ]
C-13-#000156 -> [Content-Length: 477 ]
C-13-#000177 -> [Expect: 100-continue ]
C-13-#000199 -> [Content-Type: multipart/form-data; boundary=----------------------------db5bcbd7b9f2 ]
C-13-#000285 -> [ ]
S-13-#000000 -> [HTTP/1.1 100 Continue ]
S-13-#000023 -> [ ]
C-13-#000287 -> [------------------------------db5bcbd7b9f2 ]
C-13-#000331 -> [Content-Disposition: form-data; name="createUser" ]
C-13-#000382 -> [ ]
C-13-#000384 -> [ ]
C-13-#000386 -> [------------------------------db5bcbd7b9f2 ]
C-13-#000430 -> [Content-Disposition: form-data; name="authorizableId" ]
C-13-#000485 -> [ ]
C-13-#000487 -> [peterpan ]
C-13-#000497 -> [------------------------------db5bcbd7b9f2 ]
C-13-#000541 -> [Content-Disposition: form-data; name="rep:password" ]
C-13-#000594 -> [ ]
C-13-#000596 -> [12341234 ]
C-13-#000606 -> [------------------------------db5bcbd7b9f2 ]
C-13-#000650 -> [Content-Disposition: form-data; name="membership" ]
C-13-#000701 -> [ ]
C-13-#000703 -> [eon-de-admins ]
C-13-#000718 -> [------------------------------db5bcbd7b9f2-- ]
S-13-#000025 -> [HTTP/1.1 500 Server Error ]
S-13-#000052 -> [Date: Thu, 23 Apr 2015 23:40:52 GMT ]
S-13-#000089 -> [X-Content-Type-Options: nosniff ]
S-13-#000122 -> [Set-Cookie: cq-authoring-mode=TOUCH;Path=/ ]
S-13-#000166 -> [Expires: Thu, 01 Jan 1970 00:00:00 GMT ]
S-13-#000206 -> [Content-Type: text/html;charset=UTF-8 ]
S-13-#000245 -> [Transfer-Encoding: chunked ]
S-13-#000273 -> [Server: Jetty(8.1.14.v20131031) ]
S-13-#000306 -> [ ]
S-13-#000308 -> [8C7 ]
S-13-#000313 -> [<html>]
S-13-#000320 -> [<head>]
S-13-#000327 -> [    <title>Error while processing null</title>]
S-13-#000374 -> [</head>]
S-13-#000382 -> [    <body>]
S-13-#000393 -> [    <h1>Error while processing null</h1>]
S-13-#000434 -> [    <table>]
S-13-#000446 -> [        <tbody>]
S-13-#000462 -> [            <tr>]
S-13-#000479 -> [                <td>Status</td>]
S-13-#000511 -> [                <td><div id="Status">500</div></td>]
S-13-#000563 -> [            </tr>]
S-13-#000581 -> [            <tr>]
S-13-#000598 -> [                <td>Message</td>]
S-13-#000631 -> [                <td><div id="Message">javax.jcr.RepositoryException: Cannot remove &apos;peterpan&apos; from group everyone</div></td>]
S-13-#000766 -> [            </tr>]
S-13-#000784 -> [            <tr>]
S-13-#000801 -> [                <td>Location</td>]
S-13-#000835 -> [                <td><img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: " title="invalid link: " border="0"><img src=]
S-13-#000976 -> ["/libs/cq/linkchecker/resources/linkcheck_c.gif" border="0"></td>]
S-13-#001043 -> [            </tr>]
S-13-#001061 -> [            <tr>]
S-13-#001078 -> [                <td>Parent Location</td>]
S-13-#001119 -> [                <td><img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: " title="invalid link: " border="0"><img src=]
S-13-#001260 -> ["/libs/cq/linkchecker/resources/linkcheck_c.gif" border="0"></td>]
S-13-#001327 -> [            </tr>]
S-13-#001345 -> [            <tr>]
S-13-#001362 -> [                <td>Path</td>]
S-13-#001392 -> [                <td><div id="Path"></div></td>]
S-13-#001439 -> [            </tr>]
S-13-#001457 -> [            <tr>]
S-13-#001474 -> [                <td>Referer</td>]
S-13-#001507 -> [                <td><img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: " title="invalid link: " border="0"><img src=]
S-13-#001648 -> ["/libs/cq/linkchecker/resources/linkcheck_c.gif" border="0"></td>]
S-13-#001715 -> [            </tr>]
S-13-#001733 -> [            <tr>]
S-13-#001750 -> [                <td>ChangeLog</td>]
S-13-#001785 -> [                <td><div id="ChangeLog">&lt;pre&gt;&lt;/pre&gt;</div></td>]
S-13-#001860 -> [            </tr>]
S-13-#001878 -> [        </tbody>]
S-13-#001895 -> [    </table>]
S-13-#001908 -> [    <p><img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: " title="invalid link: " border="0">Go Back<img src="/libs]
S-13-#002049 -> [/cq/linkchecker/resources/linkcheck_c.gif" border="0"></p>]
S-13-#002109 -> [    <p><img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: " title="invalid link: " border="0">Modified Resource<img ]
S-13-#002250 -> [src="/libs/cq/linkchecker/resources/linkcheck_c.gif" border="0"></p>]
S-13-#002320 -> [    <p><img src="/libs/cq/linkchecker/resources/linkcheck_o.gif" alt="invalid link: " title="invalid link: " border="0">Parent of Modified Res]
S-13-#002461 -> [ource<img src="/libs/cq/linkchecker/resources/linkcheck_c.gif" border="0"></p>]
S-13-#002541 -> [    </body>]
S-13-#002553 -> [</html> ]
tmaier commented 9 years ago

The group was not correctly set up. It should be member of everyone.

Closing this issue