Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete User which is deleted in LDAP #5577

Closed
ksteinb opened this issue Jun 30, 2017 · 5 comments
Closed

Cannot delete User which is deleted in LDAP #5577

ksteinb opened this issue Jun 30, 2017 · 5 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: ldap

Comments

@ksteinb
Copy link

ksteinb commented Jun 30, 2017

Steps to reproduce

  1. Create a user in LDAP
  2. Delete that User in LDAP
  3. Try occ user:delete

Expected behaviour

Tell us what should happen

All data of the user should be deleted

Actual behaviour

We get the following error message:
-bash-4.2$ php /var/www/html/owncloud/occ user:delete 78EEBA9E-3BAE-402B-D3B2-9EBAEE78AE3B

[OC\User\NoUserException]
78EEBA9E-3BAE-402B-D3B2-9EBAEE78AE3B is not a valid user anymore

Server configuration

Operating system: Linux dmz-sv-ownc01.physik.uni-muenchen.de 3.10.0-514.26.1.el7.x86_64 #1 SMP Wed Jun 28 15:10:01 CDT 2017 x86_64

Web server: Apache/2.4.6 (Scientific Linux) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.6.25 (apache2handler)

Database: mysql 5.5.52

PHP version: 5.6.25
Modules loaded: Core, date, ereg, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, ldap, exif, mysqlnd, PDO, Phar, posix, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlwriter, xsl, zip, mysql, mysqli, pdo_mysql, pdo_sqlite, wddx, xmlreader, json, memcache, redis, mhash, Zend OPcache

Nextcloud version: 12.0.0 - 12.0.0.29

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

Signing status
[]

List of activated apps:

App list ``` Enabled: - activity: 2.5.2 - admin_audit: 1.2.0 - bruteforcesettings: 1.0.2 - calendar: 1.5.3 - checksum: 0.3.4 - comments: 1.2.0 - contacts: 1.5.3 - dav: 1.3.0 - federatedfilesharing: 1.2.0 - federation: 1.2.0 - files: 1.7.2 - files_external: 1.3.0 - files_pdfviewer: 1.1.1 - files_reader: 1.0.4 - files_sharing: 1.4.0 - files_texteditor: 2.4.1 - files_trashbin: 1.2.0 - files_versions: 1.5.0 - files_videoplayer: 1.1.0 - firstrunwizard: 2.1 - gallery: 17.0.0 - issuetemplate: 0.2.1 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.1 - notes: 2.2.0 - notifications: 2.0.0 - oauth2: 1.0.5 - password_policy: 1.2.2 - provisioning_api: 1.2.0 - richdocuments: 1.12.31 - serverinfo: 1.2.0 - sharebymail: 1.2.0 - survey_client: 1.0.0 - systemtags: 1.2.0 - theming: 1.3.0 - twofactor_backupcodes: 1.1.1 - updatenotification: 1.2.0 - user_ldap: 1.2.1 - workflowengine: 1

Disabled:

  • encryption
  • user_external
</details>

**The content of config/config.php:**
<details>
	<summary>Config report</summary>

{
"passwordsalt": "REMOVED SENSITIVE VALUE",
"datadirectory": "/var/www/html/owncloud_data/data",
"dbtype": "mysql",
"version": "12.0.0.29",
"dbname": "owncloud_db",
"dbhost": "dmz-sv-owncdb.physik.uni-muenchen.de",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"mail_domain": "physik.uni-muenchen.de",
"mail_smtpmode": "smtp",
"mail_smtphost": "192.54.42.129",
"instanceid": "50a63d4b797ed",
"ldapIgnoreNamingRules": false,
"maintenance": false,
"forcessl": true,
"theme": "",
"trusted_domains": [
"dmz-sv-owncloud.physik.uni-muenchen.de",
"owncloud.physik.uni-muenchen.de",
"owncloud.physik.lmu.de",
"dmz-sv-ownc01.physik.uni-muenchen.de",
"192.54.42.238",
"192.54.42.142"
],
"mail_from_address": "noreply",
"enable_previews": true,
"preview_libreoffice_path": "/usr/bin/libreoffice",
"secret": "REMOVED SENSITIVE VALUE",
"logtimezone": "Europe/Berlin",
"loglevel": 1,
"filesystem_check_changes": 0,
"activity_expire_days": 31,
"memcache.local": "\OC\Memcache\Redis",
"redis": {
"host": "localhost",
"port": 6379
},
"memcache.locking": "\OC\Memcache\Redis",
"asset-pipeline.enabled": false,
"ldapProviderFactory": "\OCA\User_LDAP\LDAPProviderFactory",
"overwrite.cli.url": "https://owncloud.physik.lmu.de"
}

</details>

**Are you using external storage, if yes which one:** Array
(
    [0] => \OC\Files\Storage\Local
    [1] => \OCA\Files_External\Lib\Storage\FTP
    [2] => \OC\Files\Storage\DAV
    [3] => \OCA\Files_External\Lib\Storage\OwnCloud
    [4] => \OCA\Files_External\Lib\Storage\SFTP
    [5] => \OCA\Files_External\Lib\Storage\AmazonS3
    [6] => \OCA\Files_External\Lib\Storage\Dropbox
    [7] => \OCA\Files_External\Lib\Storage\Google
    [8] => \OCA\Files_External\Lib\Storage\Swift
    [9] => \OCA\Files_External\Lib\Storage\SFTP
    [10] => \OCA\Files_External\Lib\Storage\SMB
    [11] => \OCA\Files_External\Lib\Storage\SMB
)


**Are you using encryption:** no

**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...

#### LDAP configuration (delete this part if not used)
<details>
	<summary>LDAP config</summary>

	```
	With access to your command line run e.g.:
	sudo -u www-data php occ ldap:show-config
	from within your Nextcloud installation folder

-bash-4.2$  php /var/www/html/nextcloud/occ ldap:show-config
+-------------------------------+----------------------------------------------+
| Configuration                 |                                              |
+-------------------------------+----------------------------------------------+
| hasMemberOfFilterSupport      |                                              |
| hasPagedResultSupport         |                                              |
| homeFolderNamingRule          |                                              |
| lastJpegPhotoLookup           | 0                                            |
| ldapAgentName                 | cn=xxxxxxx |
| ldapAgentPassword             | ***                                          |
| ldapAttributesForGroupSearch  |                                              |
| ldapAttributesForUserSearch   |                                              |
| ldapBackupHost                | xxxxx               |                                                                                                  
| ldapBackupPort                | 389                                          |                                                                                                  
| ldapBase                      | o=physik                                     |                                                                                                  
| ldapBaseGroups                | ou=Gruppen,o=physik                          |                                                                                                  
| ldapBaseUsers                 | ou=Personen,o=physik                         |                                                                                                  
| ldapCacheTTL                  | 1                                            |                                                                                                  
| ldapConfigurationActive       | 1                                            |                                                                                                  
| ldapDefaultPPolicyDN          |                                              |                                                                                                  
| ldapDynamicGroupMemberURL     |                                              |                                                                                                  
| ldapEmailAttribute            | mail                                         |                                                                                                  
| ldapExperiencedAdmin          | 0                                            |                                                                                                  
| ldapExpertUUIDGroupAttr       | guid                                         |                                                                                                  
| ldapExpertUUIDUserAttr        | guid                                         |                                                                                                  
| ldapExpertUsernameAttr        |                                              |                                                                                                  
| ldapGidNumber                 | gidNumber                                    |                                                                                                  
| ldapGroupDisplayName          | cn                                           |                                                                                                  
| ldapGroupFilter               | objectClass=posixGroup                       |                                                                                                  
| ldapGroupFilterGroups         |                                              |                                                                                                  
| ldapGroupFilterMode           | 0                                            |                                                                                                  
| ldapGroupFilterObjectclass    |                                              |                                                                                                  
| ldapGroupMemberAssocAttr      | memberUid                                    |                                                                                                  
| ldapHost                      | xxxxx       |                                                                                                  
| ldapIgnoreNamingRules         |                                              |                                                                                                  
| ldapLoginFilter               | (&(ownCloudEnabled=1)(uid=%uid))             |                                                                                                  
| ldapLoginFilterAttributes     |                                              |                                                                                                  
| ldapLoginFilterEmail          | 0                                            |
| ldapLoginFilterMode           | 1                                            |
| ldapLoginFilterUsername       | 1                                            |
| ldapNestedGroups              | 0                                            |
| ldapOverrideMainServer        | 0                                            |
| ldapPagingSize                | 500                                          |
| ldapPort                      | 389                                          |
| ldapQuotaAttribute            | ownCloudQuota                                |
| ldapQuotaDefault              | 1GB                                          |
| ldapTLS                       | 0                                            |
| ldapUserDisplayName           | uid                                          |
| ldapUserDisplayName2          |                                              |
| ldapUserFilter                | (&(objectclass=Person)(ownCloudEnabled=1))   |
| ldapUserFilterGroups          |                                              |
| ldapUserFilterMode            | 1                                            |
| ldapUserFilterObjectclass     |                                              |
| ldapUuidGroupAttribute        | auto                                         |
| ldapUuidUserAttribute         | auto                                         |
| turnOffCertCheck              | 0                                            |
| turnOnPasswordChange          | 0                                            |
| useMemberOfToDetectMembership | 1                                            |
+-------------------------------+----------------------------------------------+

	Without access to your command line download the data/owncloud.db to your local
	computer or access your SQL server remotely and run the select query:
	SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


	Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.
	```
</details>
### Client configuration
**Browser:** Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

**Operating system:**

### Logs
#### Web server error log
<details>
	<summary>Web server error log</summary>
	```
	Insert your webserver log here
	```
</details>

#### Nextcloud log (data/nextcloud.log)
<details>
	<summary>Nextcloud log</summary>
	```
	Insert your Nextcloud log here
	```
</details>

#### Browser log
<details>
	<summary>Browser log</summary>
	```
	Insert your browser log here, this could for example include:

	a) The javascript console log
	b) The network log
	c) ...
	```
</details>

@js94x
Copy link

js94x commented Jul 1, 2017

Try occ:check-user . In my case nextcloud said that the user doesn't exist anymore. After that I could delete the user with the same command that you tried.

P.S.
With occ ldap:show-remnants you can get a list of users which deleted in ldap. A background job regularly checks orphaned ldap users. See:
https://docs.nextcloud.com/server/10/admin_manual/configuration_user/user_auth_ldap_cleanup.html

@ksteinb
Copy link
Author

ksteinb commented Jul 2, 2017 via email

@mwries
Copy link

mwries commented Aug 15, 2017

I can confirm the user:delete does not work on NC12 for deleted LDAP users.

@MorrisJobke
Copy link
Member

cc @nextcloud/ldap

@MorrisJobke MorrisJobke added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 30, 2017
@blizzz
Copy link
Member

blizzz commented Aug 30, 2017

Duplicate of #4117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: ldap
Projects
None yet
Development

No branches or pull requests

5 participants