Koozali.org formerly Contribs.org

Error when adding/deleting user or group

Error when adding/deleting user or group
« on: August 05, 2019, 03:47:34 AM »
I just recently starting getting this error when adding or deleting a user or group from the server-manager on one of my SMEs

Operation status report
An error occurred creating the user.

Operation status report
An error occurred while trying to delete the user.

I did find this phraze here
grep -rs 'An error occurred creating the user' /etc/
/etc/e-smith/locale/en-us/etc/e-smith/web/functions/useraccounts:        <trans>An error occurred creating the user.</trans>

I noticed the user is created and I can change the password.

I also get
Remove user account
You are about to remove the user account "testman" (Test Person)
Operation status report
An error occurred while trying to delete the user.

then If I try to add testman back in - I get

Operation status report
Error: the account "testman" can't be created because there is already a user-deleted account of that name.

I started looking
/home/e-smith/db
grep -irs testman accounts
testman=user-deleted|City

I also tested with lat-users with the same type of results adding/deleting using different user names.

I looked through the bugs and the closest thing I could find:
Bug 8504 - stopping lazy admin tools with "CTRL+C" leaves SME db buggy
I tried
db accounts settype user user-deleted   (of course testman was already set to delete status)
signal-event user-delete user
db accounts delete user
I also noticed that I needed to run
signal-event ldap-update
to remove the user from ldap.

Has anyone seen this type of thing ?
What log files might hold a clue?

SME Server 9.2 64bit server gateway

Offline janet

  • ****
  • 4,782
Re: Error when adding/deleting user or group
« Reply #1 on: August 05, 2019, 06:52:30 AM »
Catton

It is a known issue. There are commands listed in the Wiki to fully delete users etc.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • ****
  • 4,782
Re: Error when adding/deleting user or group
« Reply #2 on: August 05, 2019, 12:24:31 PM »
Catton

This in the FAQ

https://wiki.contribs.org/SME_Server:Documentation:FAQ:Section01

I can't delete & create a user for some reason. What do I do now?

If for some reason you can't delete & create a user, then first do:

signal-event user-delete <username>
db accounts delete <username>

I can't delete & create a ibay for some reason. What do I do now?

If for some reason you can't delete & create a ibay, then first do:

signal-event ibay-delete <ibayname>
db accounts delete <ibayname>

I can't delete & create a group for some reason. What do I do now?
If for some reason you can't delete & create a group, then first do:

signal-event group-delete <groupname>
db accounts delete <groupname>

« Last Edit: August 05, 2019, 12:26:36 PM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Re: Error when adding/deleting user or group
« Reply #3 on: August 05, 2019, 01:52:00 PM »
Hi Janet,
   This error is happening with any/all users or groups I create or delete, including new names that have not previously been in the database. So I think something else is going on.
Is there a log file that tracks the creation of a user or group?
 

Offline janet

  • ****
  • 4,782
Re: Error when adding/deleting user or group
« Reply #4 on: August 06, 2019, 12:31:52 AM »
Catton

What happens if you do

signal-event user-delete testman
db accounts delete testman

Does this resolve issues with testman ?
ie creating & deleting with the server manager GUI.


Doing the above & observing response will help identify the causative factors.

Note that the messages log file typically lists actions such as creating & deleting users.

I think your problems are related to using lat.

Please provide outcome of above commands & what happens when you subsequently try to recreate the testman user in server manager User panel.
« Last Edit: August 06, 2019, 01:51:08 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline ReetP

  • *
  • 2,189
Re: Error when adding/deleting user or group
« Reply #5 on: August 06, 2019, 02:11:07 PM »
When you run it have another terminal open with this running:

Code: [Select]
tail -f /var/log/messages
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Re: Error when adding/deleting user or group
« Reply #6 on: August 06, 2019, 07:24:05 PM »
server01 db]# grep delete accounts # listed user or group set in delete status
db accounts delete user or group # worked OK
signal-event ldap-update #to remove them from LDAP - OK


Now I add new user with the GUI and monitor var/log/messeges.
Gui gave me error when adding testman.
Two complaints I see below -  PHP memory - and possible nextcloud error - which is the newest contrib.


[root@server01 ~]# tail -f /var/log/messages |egrep -w -v 'arpwatch|dhcpd|tftpd' # to filter out these services
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: OLD testman=(undefined)
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: NEW testman=
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: OLD testman=
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: NEW testman=user|City|Fremont|Company|Client Company|Dept|Sales|EmailForward|local|FirstName|Test|ForwardAddress||LastName|Person|PasswordSet|no|Phone|510-657-6600|Street|5600 Cushing Parkway|VPNClientAccess|no
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: OLD test.person=(undefined)
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: NEW test.person=pseudonym|Account|testman
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: OLD test_person=(undefined)
Aug  6 09:43:51 server01 /etc/e-smith/web/panels/manager/cgi-bin/useraccounts[6692]: /home/e-smith/db/accounts: NEW test_person=pseudonym|Account|testman
Aug  6 09:43:51 server01 esmith::event[6693]: Processing event: user-create testman
Aug  6 09:43:51 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S04user-create-unix
Aug  6 09:43:51 server01 /etc/e-smith/events/user-create/S04user-create-unix[6694]: /home/e-smith/db/configuration: OLD MinUid=5436
Aug  6 09:43:51 server01 /etc/e-smith/events/user-create/S04user-create-unix[6694]: /home/e-smith/db/configuration: NEW MinUid=5437
Aug  6 09:43:51 server01 /etc/e-smith/events/user-create/S04user-create-unix[6694]: /home/e-smith/db/accounts: OLD testman=user|City|Fremont|Company|Client Company|Dept|Sales|EmailForward|local|FirstName|Test|ForwardAddress||LastName|Person|PasswordSet|no|Phone|510-657-6600|Street|5600 Cushing Parkway|VPNClientAccess|no
Aug  6 09:43:51 server01 /etc/e-smith/events/user-create/S04user-create-unix[6694]: /home/e-smith/db/accounts: NEW testman=user|City|Fremont|Company|Client Company|Dept|Sales|EmailForward|local|FirstName|Test|ForwardAddress||LastName|Person|PasswordSet|no|Phone|510-657-6600|Street|5600 Cushing Parkway|Uid|5436|VPNClientAccess|no
Aug  6 09:43:52 server01 esmith::event[6693]: Group testman successfully added!
Aug  6 09:43:53 server01 esmith::event[6693]: User testman successfully added!
Aug  6 09:43:54 server01 esmith::event[6693]: Locking password for user testman.
Aug  6 09:43:54 server01 esmith::event[6693]: passwd: Success
Aug  6 09:43:54 server01 esmith::event[6693]: User testman successfully modified!
Aug  6 09:43:54 server01 esmith::event[6693]: Added user testman.
Aug  6 09:43:54 server01 esmith::event[6693]: S04user-create-unix=action|Event|user-create|Action|S04user-create-unix|Start|1565109831 611957|End|1565109834 936996|Elapsed|3.325039
Aug  6 09:43:54 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Aug  6 09:43:55 server01 esmith::event[6693]: expanding /var/service/qpsmtpd/config/forcespamcheck
Aug  6 09:43:55 server01 esmith::event[6693]: expanding /var/service/qpsmtpd/config/goodrcptto
Aug  6 09:43:55 server01 esmith::event[6693]: expanding /var/qmail/users/assign
Aug  6 09:43:55 server01 esmith::event[6693]: expanding /var/qmail/control/virtualdomains
Aug  6 09:43:55 server01 esmith::event[6693]: expanding /var/qmail/control/badrcptto
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /var/qmail/alias/.qmail-shared
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/rssh.conf
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/pptpd.conf
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/proftpd.conf
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/sudoers
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/ppp/ip-up.local
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/ppp/ip-down.local
Aug  6 09:43:56 server01 esmith::event[6693]: expanding /etc/ppp/options.pptpd
Aug  6 09:43:57 server01 esmith::event[6693]: expanding /etc/raddb/radiusd.conf
Aug  6 09:43:57 server01 esmith::event[6693]: expanding /etc/raddb/users
Aug  6 09:43:57 server01 esmith::event[6693]: expanding /etc/e-smith/pam/accounts.allow
Aug  6 09:43:57 server01 esmith::event[6693]: expanding /etc/e-smith/pam/users.allow
Aug  6 09:43:57 server01 esmith::event[6693]: expanding /etc/e-smith/pam/accounts.deny
Aug  6 09:43:57 server01 esmith::event[6693]: generic_template_expand=action|Event|user-create|Action|generic_template_expand|Start|1565109834 937508|End|1565109837 610166|Elapsed|2.672658
Aug  6 09:43:57 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S20qmail-update-group
Aug  6 09:43:58 server01 esmith::event[6693]: S20qmail-update-group=action|Event|user-create|Action|S20qmail-update-group|Start|1565109837 610713|End|1565109838 650094|Elapsed|1.039381
Aug  6 09:43:58 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S20qmail-update-user
Aug  6 09:43:58 server01 esmith::event[6693]: S20qmail-update-user=action|Event|user-create|Action|S20qmail-update-user|Start|1565109838 650815|End|1565109838 949624|Elapsed|0.298809
Aug  6 09:43:58 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S20user-create-profiledir
Aug  6 09:43:59 server01 esmith::event[6693]: S20user-create-profiledir=action|Event|user-create|Action|S20user-create-profiledir|Start|1565109838 950312|End|1565109839 151087|Elapsed|0.200775
Aug  6 09:43:59 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S25count-active-user-accounts
Aug  6 09:43:59 server01 esmith::event[6693]: S25count-active-user-accounts=action|Event|user-create|Action|S25count-active-user-accounts|Start|1565109839 151794|End|1565109839 344759|Elapsed|0.192965
Aug  6 09:43:59 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S30nextcloud-occ-conf
Aug  6 09:44:00 server01 esmith::event[6693]: The current PHP memory limit is below the recommended value of 512MB.
Aug  6 09:44:00 server01 esmith::event[6693]:
Aug  6 09:44:00 server01 esmith::event[6693]:
Aug  6 09:44:00 server01 esmith::event[6693]:   There are no commands defined in the "user" namespace.
Aug  6 09:44:00 server01 esmith::event[6693]:
Aug  6 09:44:00 server01 esmith::event[6693]:
Aug  6 09:44:00 server01 esmith::event[6693]: malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "Nextcloud is not ins...") at /etc/e-smith/events/user-create/S30nextcloud-occ-conf line 48.
Aug  6 09:44:00 server01 esmith::event[6693]: S30nextcloud-occ-conf=action|Event|user-create|Action|S30nextcloud-occ-conf|Start|1565109839 345431|End|1565109840 444240|Elapsed|1.098809|Status|256
Aug  6 09:44:00 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S50user-modify-quota
Aug  6 09:44:00 server01 esmith::event[6693]: S50user-modify-quota=action|Event|user-create|Action|S50user-modify-quota|Start|1565109840 444801|End|1565109840 606996|Elapsed|0.162195
Aug  6 09:44:00 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S55email-assign
Aug  6 09:44:00 server01 esmith::event[6693]: S55email-assign=action|Event|user-create|Action|S55email-assign|Start|1565109840 607670|End|1565109840 690781|Elapsed|0.083111
Aug  6 09:44:00 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S56update-domain-group-maps
Aug  6 09:44:01 server01 esmith::event[6693]: No rid or sid specified, choosing a RID
Aug  6 09:44:01 server01 esmith::event[6693]: Got RID 11873
Aug  6 09:44:01 server01 esmith::event[6693]: Successfully added group Test Person to the mapping db as a domain group
Aug  6 09:44:01 server01 esmith::event[6693]: S56update-domain-group-maps=action|Event|user-create|Action|S56update-domain-group-maps|Start|1565109840 691470|End|1565109841 311323|Elapsed|0.619853
Aug  6 09:44:01 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S60mailsorting-update-user
Aug  6 09:44:01 server01 esmith::event[6693]: S60mailsorting-update-user=action|Event|user-create|Action|S60mailsorting-update-user|Start|1565109841 311872|End|1565109841 603949|Elapsed|0.292077
Aug  6 09:44:01 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S85dovecot-acl
Aug  6 09:44:01 server01 esmith::event[6693]: S85dovecot-acl=action|Event|user-create|Action|S85dovecot-acl|Start|1565109841 604637|End|1565109841 746839|Elapsed|0.142202
Aug  6 09:44:01 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S85user-group-modify
Aug  6 09:44:01 server01 esmith::event[6693]: S85user-group-modify=action|Event|user-create|Action|S85user-group-modify|Start|1565109841 747516|End|1565109841 979869|Elapsed|0.232353
Aug  6 09:44:01 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/actions/adjust-services
Aug  6 09:44:02 server01 esmith::event[6693]: adjusting supervised smbd (sighup)
Aug  6 09:44:02 server01 esmith::event[6693]: adjusting supervised smbd (up)
Aug  6 09:44:02 server01 esmith::event[6693]: adjusting supervised radiusd (sigterm)
Aug  6 09:44:02 server01 esmith::event[6693]: adjusting supervised radiusd (up)
Aug  6 09:44:02 server01 esmith::event[6693]: adjusting supervised qmail (sighup)
Aug  6 09:44:02 server01 esmith::event[6693]: adjusting supervised qmail (up)
Aug  6 09:44:02 server01 esmith::event[6693]: adjust-services=action|Event|user-create|Action|adjust-services|Start|1565109841 980541|End|1565109842 108029|Elapsed|0.127488
Aug  6 09:44:02 server01 esmith::event[6693]: Running event handler: /etc/e-smith/events/user-create/S95ldap-update-simple
Aug  6 09:44:05 server01 esmith::event[6693]: S95ldap-update-simple=action|Event|user-create|Action|S95ldap-update-simple|Start|1565109842 108574|End|1565109845 169037|Elapsed|3.060463





Re: Error when adding/deleting user or group
« Reply #7 on: August 07, 2019, 04:57:20 PM »
I uninstalled  smeserver-nextcloud  nextcloud and retested add remove user. No more error.
I will need to investigate further if I want to use nextcloud.

Offline janet

  • ****
  • 4,782
Re: Error when adding/deleting user or group
« Reply #8 on: August 07, 2019, 11:23:15 PM »
Catton

To determine if nextcloud is inherently faulty or directly responsible for the user add/delete issues, you could install a clean version of SME server on a test machine (without installing any contribs or other specialised configuration), & then install nextcloud & see if you have similar issues re user add/delete.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Re: Error when adding/deleting user or group
« Reply #9 on: August 08, 2019, 12:21:18 AM »
Janet,
   Thanks. Will do. I have a VM SME just for that purpose. Funny thing My other site did not give me this error.

Offline janet

  • ****
  • 4,782
Re: Error when adding/deleting user or group
« Reply #10 on: August 08, 2019, 01:03:35 AM »
Catton

So what are the differences between servers ?
I think it is time to tell us the detailed history of both servers

In particular how did you setup users etc on the problematic server ?
eg did you use lat on the problematic server & not on the server that is OK ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Re: Error when adding/deleting user or group
« Reply #11 on: August 12, 2019, 05:07:26 PM »
Janet,
    I figured out the difference between the two servers.
The problematic server did not have contrib PHP Software Collections  "smeserver-php-scl" installed.
The other server did. After installing :
yum --enablerepo=remi,epel install php71-php-pecl-redis php70-php-pecl-redis
and a re-install of Nextcloud.
I no longer receive this error.

Offline Jean-Philippe Pialasse

  • *
  • 1,399
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Error when adding/deleting user or group
« Reply #12 on: August 13, 2019, 12:06:43 AM »
Janet,
    I figured out the difference between the two servers.
The problematic server did not have contrib PHP Software Collections  "smeserver-php-scl" installed.
The other server did. After installing :
yum --enablerepo=remi,epel install php71-php-pecl-redis php70-php-pecl-redis
and a re-install of Nextcloud.
I no longer receive this error.


How did you installed smeserver-nextcloud initially?
It should requires smeserver-php-scl. If not this is a bug.


Re: Error when adding/deleting user or group
« Reply #13 on: August 13, 2019, 01:58:04 AM »
I installed Nextcloud as per the wiki. The RPM gave no errors. So PHP71 should be a prerequisite.
The other Server already had smeserver-php-scl for use on an ibay for wordpress.
Do you want me to submit the bug for smeserver-nextcloud contrib ?
I should probably confirm on a fresh VM SME to duplicate the bug. - Yes?

Offline Jean-Philippe Pialasse

  • *
  • 1,399
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Error when adding/deleting user or group
« Reply #14 on: August 13, 2019, 06:27:28 PM »
If you have the time to replicate it would be helpful before opening the bug