Error 500 on loading the gitlab page when LDAP is enabled

Whenever I enable LDAP, I can visit the initial root password reset page, but everything after that page crashes with ‘error 500’.

I have to enable LDAP, because I can’t create users; creating a user also gives me an error 500.