Evan's picture

I am having trouble getting active directory integration working with my mayan edms turnkey setup, i followed the instructions on this forum to upgrade to 2.7.3  and i am using the following config file as the local.py file https://gitlab.com/mayan-edms/mayan-edms/blob/development/contrib/settin... i either end up with an "internal server error" or I get the login screen but no credentials I use work, AD or the default login. 

Jeremy Davis's picture

Unfortunately, I don't know much about Mayan-EDMS and even less about LDAP, so I'm not sure how useful I'll be here... OTOH, I have a solid understanding of TurnKey so hopefully we might get somewhere... :)

After doing a quick google, I'm not sure, but my guess is that there are missing dependencies. I could be wrong, but in my experience, it's often the cause of something not working as it should, especially when others report it working fine.

That guess would also be consistent with the "internal server error" message. The Mayan appliance uses Nginx as a reverse proxy, so as a general rule the "internal server error" means that Mayan has crashed (which would be expected behaviour if a needed python library was missing).

According to this you'll need to install a few packages via pip. So the steps should look something like this:

cd /usr/share
virtualenv mayan-edms
source /usr/share/mayan-edms/bin/activate
pip install ldap
pip install python-ldap
pip install django-auth-ldap
I haven't tested it, so I have no idea if it'll work, or not. If you have content in Mayan already though, please test on a VM and/or make a backup first!

If you've already tried the above and/or something similar, I'm not really sure, but please share some further info about exactly what you have tried and also give some info from your logs (you may need to tweak Mayan settings to get explicit logs?).

Actually, perhaps that's even worth doing first? Rather than just trying random steps in the hope it works! Either way, I'd love to hear how you get on. Good luck.

Jeremy Davis's picture

Because we have significantly refactored how we install Mayan in v15.x, I'm almost certain that the steps would need a tweak. I haven't tested, but I expect the steps would be somewhat similar, but not quite the same... So something like this should (hopefully) work:

supervisorctl stop all
su - mayan -c ". $ENV && $BIN/pip install ldap"
su - mayan -c ". $ENV && $BIN/pip install python-ldap"
su - mayan -c ". $ENV && $BIN/pip install django-auth-ldap"
supervisorctl start all

Please note though that I haven't tested it and am not intimately familiar with Mayan-EDMS. If that doesn't work, it's probably worth consulting the Mayan-EDMS docs as perhaps they have some suggestion there?

Also I've found the developers quite responsive, so worst case, it's probably worth trying to contact them.

In case you haven't noticed, the way to run pip commands specifically for Mayan on the TurnKey v15.x appliance goes like this; as a general rule whenever anyone says run:


Instead run:

su - mayan -c ". $ENV && $BIN/pip PIP_COMMANDS_HERE"

Having said that, using the default pip may still work ok (that should install the python libraries globally, so Mayan should still be able to use them) although it's probably best practice to install to Mayan's "virtual environment".

Perhaps we should include a convenience script for "mayan-pip" in a future release to save a bit of typing and make it a bit easier?! Perhaps turnkey-mayan-pip PIP_COMMANDS_HERE?!

Add new comment