Open nikhileshva opened 4 years ago
You should take a look at
LDAP_DEFAULT_SENTRY_ORGANIZATION = u'Sentry'
It might be that the name is incorrect. It's matched case-sensitive, so it might be that.
If you're using docker-compose
you can test with
docker-compose run --rm web shell
>>> from django.conf import settings
>>> from sentry.models import Organization
>>> Organization.objects.filter(name=settings.AUTH_LDAP_DEFAULT_SENTRY_ORGANIZATION)
If it shows an empty list, try different values for name
. When you manage to find the correct value, change it to that in your config.
I have the same problem. I checked @MrGreenTea 's suggestion but no luck. In logs it gives me the corresponding organization_id, but still user is not added. What is even weirder is that organization_id is correct after checking in the database! Anyone has a suggestion?
sentry-web | 15:35:35 [DEBUG] django_auth_ldap: search_s('cn=badr ibrahim,ou=internal,ou=user,ou=organization,dc=organization,dc=local', 0, '(objectClass=*)') returned 1 objects: cn=badr ibrahim,ou=internal,ou=user,ou=organization,dc=organization,dc=local
sentry-web | 15:35:35 [INFO] sentry.auth: user.auth.success (username=u'badr.ibrahim' organization_id=1L ip_address=u'172.24.0.23')
sentry-web | 16:38:10 [INFO] sentry.web.frontend.base: User is not a member of any organizations
Organization configurations are :
AUTH_LDAP_DEFAULT_SENTRY_ORGANIZATION = u'sentry'
AUTH_LDAP_SENTRY_ORGANIZATION_ROLE_TYPE = 'member'
AUTH_LDAP_SENTRY_ORGANIZATION_GLOBAL_ACCESS = True
AUTH_LDAP_SENTRY_SUBSCRIBE_BY_DEFAULT = True
I have tried with both 'sentry' and 'Sentry', but none works. Also, I tested whether the organization exists:
>>> from django.conf import settings
>>> from sentry.models import Organization
>>> Organization.objects.filter(name=settings.AUTH_LDAP_DEFAULT_SENTRY_ORGANIZATION)
<BaseQuerySet [<Organization at 0x7f29506156d0: id=1L, owner_id=None, name=u'Sentry', slug=u'sentry'>]>
>>>
We've had the same problem. In our case the issue was that we also had "django-auth-ldap" und "python-ldap" in our requirements.txt. After removing those requirements and doing a clean setup of the Python environment it worked. Maybe it's because of the new major version (2.x) of django-auth-ldap that gets installed when you have it in your requirements.txt?
From the logs, I can see that authentication is successful; but the user is not added to any organization.
This is the log:
Env variables set
Authentication backend is also correct:
I'm not sure if there's some issue with my configurations or it doesn't work in general.