LDAP User with new empty Data Folder

Nextcloud version (eg, 20.0.5): 23
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.52
PHP version (eg, 7.4): 7.4.3

The issue you are facing:
The User XY, Named “Dora” use the cloud
some day Dora logout
some other day Dora login and have empty data folder

In /data now i have 2 Folders of Dora:
dora
dora_1234

In “dora” i see all data.
In “dora_1234” no data stored

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

Move the User in LDAP or AD to another OU or migrate the LDAP/AD Server
Login with the Users
many empty new folders with username_number

The output of your Nextcloud log in Admin > Logging:

Nothing

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "IP 1",
            "IP 2"
        ],

        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "dbtype": "mysql",
        "version": "23.0.0.10",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "ldapIgnoreNamingRules": false,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "knowledgebaseenabled": false,
        "loglevel": 3,
        "theme": "",
        "maintenance": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.ttl": 3600,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "mysql.utf8mb4": true,
        "mail_sendmailmode": "smtp",
        "default_phone_region": "DE",
        "skeletondirectory": "",
        "app_install_overwrite": [
            "data_request"
        ],
        "data-fingerprint": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"

LDAP Config:

            "s01ldap_expert_username_attr": "sAMAccountName",
            "s01ldap_expert_uuid_group_attr": "sAMAccountName",
            "s01ldap_expert_uuid_user_attr": "sAMAccountName",
            "s01ldap_ext_storage_home_attribute": "",
            "s01ldap_gid_number": "gidNumber",
            "s01ldap_group_display_name": "sAMAccountName",
            "s01ldap_group_filter": "(&(|(objectclass=group))(|(cn=OwnCloud-User)(cn=OwnCloud-Admins)))",
            "s01ldap_group_filter_mode": "0",
            "s01ldap_group_member_assoc_attribute": "member",
            "s01ldap_groupfilter_groups": "OwnCloud-User\nOwnCloud-Admins",
            "s01ldap_groupfilter_objectclass": "group",
           "s01ldap_login_filter_mode": "0",
            "s01ldap_loginfilter_attributes": "",
            "s01ldap_loginfilter_email": "1",
            "s01ldap_loginfilter_username": "1",
            "s01ldap_matching_rule_in_chain_state": "available",
            "s01ldap_nested_groups": "1",
            "s01ldap_override_main_server": "",
            "s01ldap_paging_size": "1500",
            "s01ldap_port": "636",
            "s01ldap_quota_attr": "",
            "s01ldap_quota_def": "",
            "s01ldap_tls": "0",
            "s01ldap_turn_off_cert_check": "0",
            "s01ldap_turn_on_pwd_change": "0",
            "s01ldap_user_avatar_rule": "default",
            "s01ldap_user_display_name_2": "sn",
            "s01ldap_user_filter_mode": "0",
            "s01ldap_userfilter_groups": "OwnCloud-Admins\nOwnCloud-User",
            "s01ldap_userfilter_objectclass": "user",
            "s01ldap_userlist_filter": "(&(|(objectclass=user))(|(|(memberof=CN=OwnCloud-Admins,OU=SYS,OU=Groups,DC=domain,DC=tld)(primaryGroupID=9319))(|(memberof=CN=OwnCloud-User,OU=SYS,OU=Groups,DC=domain,DC=tld))(primaryGroupID=9329))))",

The output of your Apache/nginx/system log in /var/log/____:

Nothing

Nobody? hm

Did you ever resolve this? I setup a fresh LDAP server and now I’m creating the duplicate users and folders. Trying to see if I can remove the old user folders and rename the new users

No the Problem is not resolved. :expressionless:

I crudely restored my user in question but I’m guessing that their is an unique ID from the LDAP and Nextcloud’s mysql goes off that field to generate a new user internally. So I had to backup/rename the old user folder, find the old user in mysql, and delete that record. Then it generated the “new” original user folder in Nextcloud and I would copy the files over from the old user folder to the new one. Maybe there is a way just to alter the mysql user data to re-map the data folder but in my case I wasn’t bothering with that. So I’m guessing that anytime you move an LDAP record, maybe you edit the mysql record or drop it first. I didn’t test just droping the mysql record first to see if it would just create a new one and link back to the original user folder if it already exists.