Problems with LDAP synchronization and roles / department : seafile pro 7.1.4

Hello, I have several problems with LDAP synchronization and roles / department, Everything worked before…

Right now only the ELEVE category is OK

The rest is very random, where there is no quota displayed or a 5GB quota which is not yet defined anywhere (default quota force at 40Bg in seafile.conf but same result)!

The default category doesn’t work either.

The ./seafile-server-latest/pro/pro.py ldapsync command works well and modifies the role in function of the LDAP field

Same result with seafile pro 7.1.3 or 7.1.4

Do you have an idea ?

Thanks

seahub settings
cat seahub_settings.py

ENABLED_ROLE_PERMISSIONS = {
    'default': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': False,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '1g',
    },
    'guest': {
        'can_add_repo': False,
        'can_add_group': False,
        'can_view_org': False,
        'can_use_global_address_book': False,
        'can_generate_share_link': False,
        'can_generate_upload_link': False,
        'can_invite_guest': False,
        'can_connect_with_android_clients': False,
        'can_connect_with_ios_clients': False,
        'can_connect_with_desktop_clients': False,
        'role_quota': '1g',
    },
    'ADMIN': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': True,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '60g',
    },
    'ELEVE': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': False,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '10g',
    },
    'SMS': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': True,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '80g',
    },
    'SPIN': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': True,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '80g',
    },
    'CIS': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': True,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '80g',
    },
    'FAYOL': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': True,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '80g',
    },
    'CMP-GC': {
        'can_add_repo': True,
        'can_add_group': True,
        'can_view_org': True,
        'can_use_global_address_book': True,
        'can_generate_share_link': True,
        'can_generate_upload_link': True,
        'can_invite_guest': True,
        'can_connect_with_android_clients': True,
        'can_connect_with_ios_clients': True,
        'can_connect_with_desktop_clients': True,
        'role_quota': '80g',
    }
}

>
custom functions
#coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')

def ldap_role_mapping(role):
    if 'ADMIN' in role:
        return 'ADMIN'
    if 'ELEVE' in role:
        return 'ELEVE'
    if 'SMS' in role:
        return 'SMS'
    if 'SPIN' in role:
        return 'SPIN'
    if 'CIS' in role:
        return 'CIS'
    if 'FAYOL' in role:
        return 'FAYOL'
    if 'CMP-GC' in role:
        return 'CMP-GC'

[/details]

Dear Anthony_Ruiz,

as far as I know the role_names in seahub_settings.py must have names with small letters only. So don’t use ELEVE but ‘eleve’ (like default and guest).
If you want them to be shown in Seafile with capital letters you have to add these strings to the corresponding translation files of Seafile:
https://download.seafile.com/published/seafile-manual/develop/translation.md.

As soon as you use small latters it should work as described. If not please write me again.
Best regards
Christoph

Hello, please have a look at if there is any data in the ccnet.RoleQuota table.

I just tried, amazing but it worked once, then it passed me again the quota to 1 GB while I never defined that …
And I can no longer pass it while I have nothing to change except for the lower case …
The custom_functions.py must also be in lower case necessarily?

Hello,
We have tested everything upper case, lower case, and everything remains very random …
on 6 roles, 3 functions …
What about pyc files?
Should we delete them when we modify the corresponding py file?