Problem installing ODKv2 Sync on Ubuntu with Custom LDAP (AD) - yaml: line 98: did not find expected key


I am trying to install ODKv2 Sync on Ubuntu Server v18.09, Docker and Swarm Mode has already been enabled.

I got up to Step 10 in the PDF without any issues, and from that point on the document is extremely vague almost to expect you are some super saavy developer that has in depth knowledge of the source code, which I don’t, so it is very intimidating.

It says to but I found 3 versions:

I assume it is the first one and added (yes added because none of the following 3 were actually in the first file):

I did not touch the other 2 files.

Next it says to edit the ports on docker-compose.yml under sync, so the only thing that came close was under nginx: so I put the following:

image: nginx:1.13
- sync-network
- “880:80”:~/sync-endpoint-default-setup#
- “7443:443”

For Custom LDAP I exported by Active Directory Root CA Certificate as a base64 and placed it into a cer file and ran

docker config create org.opendatakit.sync.ldapcert ~/sync-endpoint-default-setup/ca_cert.cer

and it returned a hex value.

It also shows up in “docker config ls”
root@vc-forms2:~/sync-endpoint-default-setup# docker config ls
60u4j8x0tiqbz39ouvc68gopu org.opendatakit.sync.ldapcert About an hour ago About an hour ago

Then I uncomment the “relevant” lines in docker-compose.yml which I assume should look like this

- sync.env
# uncomment these after uncommenting the ones below in the root level configs
# configs:
- org.opendatakit.sync.ldapcert
# -


uncomment this to import a CA certificate into the Sync service

external: true

Next, I removed the ldap-service and phpldapadmin under the sevices section, and then modified ./config/sync-endpoint/ to enter my LDAP AD Properties while leaving the other alone.

Finally I try to start the server with:

docker stack deploy -c docker-compose.yml syncldap

And get this error:

yaml: line 98: did not find expected key

Which refers to these lines under docker-compose.yml:


uncomment this to import a CA certificate into the Sync service

external: true <<======= Line 98

What did I do wrong here? The documentation is too vague and provides no example so that I end up guessing a lot of things which is not good.

Please advise.


Found the problem, turns out that docker is very picky about extra spaces when it parses docker-compose.yml

However even with the services running, the system fails to contact the external LDAP Server. Wireshark captures to the ODKv2 system keeps on showing it is trying to query a DNS A Record named “sync”, and "docker logs " keeps showing it cannot connect to my external LDAP Server. AFAIK “sync” is a system available on the docker internal overlay network so no idea why it is trying to query externally, and the system cannot access the external LDAP probably because the internal container has issues accessing the external network i.e. it has no routes. The sync DNS Queries start happening the moment I switch the config file to “activeDirectory”.

This looks like a major bug in the system, and I doubt that any one has ever gotten to work with an external AD or LDAP.

Even the install at “mvn clean install” has issues even with all the prerequisites met. It got stuck testing mysql at the end and kept saying it cannot login using ‘odk_unit’@‘’ just after it gets stuck at “writing large dataset” and I had to manually using another terminal do a “docker exec -it mysql -uroot -pmysqlPassword” and manually grant access! There is a script that does this in the mysql-test folder, but it looks like it is another HUGE bug in the code!! Even with all this effor the mysql test fails at the end >.<’’ and this is following exactly step by step the instructions.

Docker just makes everything THAT much more complex!

For now I got it to run under POSTGRES Sql using the integrated OpenLDAP and im using a 3rd party tool to sync my Active Directory Users to OpenLDAP and exposing ports 389 and 686 by adding this do docker-compose.yml:

image: odk/openldap
replicas: 1
ports: <<—This
- “389:389” <<—This
- “636:636” <<—And This Line

The reason why AD didn’t work is because these 2 lines were not set properly,


As an example, if my AD domain is


If your domain has more levels, you will need to modify these instead


The default value for these 3 fields are configured to infer from ldapDomainDClevel1 and ldapDomainDClevel2.

On the LDAP/AD CA,
The certificate needs to be importable using Java keytool

The Active Directory Domain Controller must have Domain Services enabled. This is required for Sync Endpoint to query the AD using LDAP.