title: ldapadd gives "no global superior knowledge" on default config
body: <h2>Background:</h2>
  
  <p>I'm installing a <a href="https://prosody.im/" rel="nofollow noreferrer">Prosody</a> XMPP server and <a href="http://getkaiwa.com/" rel="nofollow noreferrer">Kaiwa</a> webclient on a DigitalOcean droplet.</p>
  
  <p>Kaiwa has a one-click deploy-to-DO-droplet tool using Docker that I tried first, but it didn't work - probably because I'm using the 512MB minimum DO VPS and it ran out of memory with half of the Docker images started.</p>
  
  <p>I wiped all those images, made a 1GB swap file for my droplet and am now following (as suggested) the <a href="https://github.com/digicoop/kaiwa-server#installation-with-docker" rel="nofollow noreferrer">Kaiwa GitHub README</a> for "manual" install - which is essentially pulling and configuring four Docker images: <code>postgresql</code>, <code>slapd</code>, <code>kaiwa-server</code>, and <code>kaiwa</code>.  Setting up the PostgreSQL image went without a hitch, and I ran into trouble with the LDAP one.</p>
  
  <h2>Problem:</h2>
  
  <p>Here are the instructions for configuring the LDAP Docker image:</p>
  
  <pre><code>$ docker pull nickstenning/slapd
  $ docker run -d \
               --name ldap \
               -p 389:389 \
               -e LDAP_DOMAIN=myorga \
               -e LDAP_ORGANISATION=MyOrganisation \
               -e LDAP_ROOTPASS=mypassword \
               nickstenning/slapd
  $ wget https://raw.githubusercontent.com/digicoop/kaiwa-server/master/users.ldif
  $ ldapadd -h localhost -x -D cn=admin,dc=myorga -w mypassword -f users.ldif
  </code></pre>
  
  <p>(I've omitted a number of <code>sed</code> commands used to replace sample data in <a href="https://raw.githubusercontent.com/digicoop/kaiwa-server/master/users.ldif" rel="nofollow noreferrer"><code>users.ldif</code></a> with personal data; I get the same error with both datasets.)</p>
  
  <p>After running the <code>ldapadd</code> command, I get this:</p>
  
  <pre><code>adding new entry "ou=users,dc=example.com"
  ldap_add: Server is unwilling to perform (53)
      additional info: no global superior knowledge
  </code></pre>
  
  <p>Experimenting shows that if I call <code>ldapadd</code> with user <code>user1</code> and password <code>user1pass</code>, or if I call it with user <code>admin</code> but with the wrong admin password, I get a different error:</p>
  
  <pre><code>ldap_bind: Invalid credentials (49)
  </code></pre>
  
  <p>I assume this means that the second, <code>docker run</code> command worked and my LDAP server recognizes that the admin user and password passed to <code>ldapadd</code> are correct, but for some reason I'm asking it to attach users to places that don't exist in the tree.</p>
  
  <p>I've never used LDAP before and I'm probably making some silly mistake.  I've read this SO question (<a href="https://stackoverflow.com/questions/22168398/openldap-no-global-superior-knowledge">openldap &quot;no global superior knowledge&quot;</a>) and my problem is probably similar - but I wouldn't expect a typo to exist when I'm using the developers' default config file, and I haven't found one myself yet.</p>