Koozali.org: home of the SME Server

Recreate A Deleted User?

Offline wbell

  • ***
  • 49
  • +0/-0
Recreate A Deleted User?
« on: January 05, 2010, 07:53:46 PM »
PLEASE HELP!

I have a deleted user (bakst) I need to re-add, but I keep getting the following error, when trying to create the user, from the SME web interface:

Code: [Select]
Error: the account "bakst" can't be created because there is already a system account of that name.

WHAT I'VE TRIED
  • Searched the forum for answers.
  • Checked the web interface for the existing "bakst" user, and it was not there.
  • Tried using The Lazy Admin Toolkit (lat-users) to remove deleted user, and re-add the new user.
  • Tried manually removing the deleted user, with the following command:
Code: [Select]
userdel bakst
  • Tried manually removing the deleted user, with the following command:
Code: [Select]
/sbin/e-smith/db accounts delete bakst
  • Tried manually removing the deleted user, with the following commands:
Code: [Select]
rm -Rf /var/spool/mail/bakst
rm -Rf /home/e-smith/files/users/bakst
rm -Rf /home/e-smith/files/samba/profiles/bakst
pico -w /etc/passwd   (Delete all lines or instances of bakst)
pico -w /etc/passwd-   (Delete all lines or instances of bakst)
pico -w /etc/shadow   (Delete all lines or instances of bakst)
pico -w /etc/shadow-   (Delete all lines or instances of bakst)
pico -w /etc/gshadow   (Delete all lines or instances of bakst)
pico -w /etc/gshadow-   (Delete all lines or instances of bakst)
pico -w /etc/group   (Delete all lines or instances of bakst)
pico -w /etc/group-   (Delete all lines or instances of bakst)
pico -w /home/e-smith/db/accounts   (Delete all lines or instances of bakst)

signal-event post-upgrade; signal-event reboot

I'm at a loss...  Any help would be GREATLY appreciated!


 :-(

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Recreate A Deleted User?
« Reply #1 on: January 05, 2010, 08:10:46 PM »
I have a deleted user (bakst) I need to re-add

You have a partially deleted user. Before you try to re-create, you should try to understand how you came to have a partially deleted user.

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #2 on: January 05, 2010, 08:24:06 PM »
I'm not sure what caused it, and actually I think it's a partially added user.
I tried to add the user "bakst", and it timed out.  So, I looked at my "messages" log to see what was happening, and saw entries, like the ones below, for every user!

Code: [Select]
Jan  5 12:19:13 webserver esmith::event[10052]: adding entry for group Stats Student30 failed! 
Jan  5 12:19:13 webserver esmith::event[10052]: No rid or sid specified, choosing a RID 
Jan  5 12:19:13 webserver esmith::event[10052]: Got RID 2459 
Jan  5 12:19:13 webserver esmith::event[10052]: adding entry for group Richard Reynolds failed! 
Jan  5 12:19:13 webserver esmith::event[10052]: No rid or sid specified, choosing a RID 
Jan  5 12:19:13 webserver esmith::event[10052]: Got RID 2460 
Jan  5 12:19:13 webserver esmith::event[10052]: adding entry for group Stats Student04 failed! 
Jan  5 12:19:13 webserver esmith::event[10052]: No rid or sid specified, choosing a RID 
Jan  5 12:19:13 webserver esmith::event[10052]: Got RID 2461 

The entries, like the ones above, have happened multiple times, since the "bakst" incident.  I have NO idea, if this is even related, though.

 :-(

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #3 on: January 05, 2010, 08:31:22 PM »
Uh-Oh...  I just tried to create a different user (bakst10), and that failed too!

Code: [Select]
Operation status report
An error occurred creating the user.

 :-(

Here are the logs, from the "messages" file, after trying to create "bakst10":

Code: [Select]
Jan  5 13:29:07 webserver esmith::event[26765]: S10update-domain-group-maps=action|Event|user-create|Action|S10update-domain-group-maps|Start|1262719721 786183|End|1262719747 373643|Elapsed|25.58746
Jan  5 13:29:07 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S20qmail-update-group
Jan  5 13:29:08 webserver esmith::event[26765]: S20qmail-update-group=action|Event|user-create|Action|S20qmail-update-group|Start|1262719747 373944|End|1262719748 123980|Elapsed|0.750036
Jan  5 13:29:08 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S20qmail-update-user
Jan  5 13:29:08 webserver esmith::event[26765]: Can't call method "dir" on an undefined value at /etc/e-smith/events/user-create/S20qmail-update-user line 57. 
Jan  5 13:29:08 webserver esmith::event[26765]: S20qmail-update-user=action|Event|user-create|Action|S20qmail-update-user|Start|1262719748 124203|End|1262719748 219076|Elapsed|0.094873|Status|65280
Jan  5 13:29:08 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S20user-create-profiledir
Jan  5 13:29:08 webserver esmith::event[26765]: Use of uninitialized value in chown at /usr/lib/perl5/site_perl/esmith/util.pm line 102. 
Jan  5 13:29:08 webserver esmith::event[26765]: S20user-create-profiledir=action|Event|user-create|Action|S20user-create-profiledir|Start|1262719748 219272|End|1262719748 471121|Elapsed|0.251849
Jan  5 13:29:08 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S25count-active-user-accounts
Jan  5 13:29:08 webserver esmith::event[26765]: S25count-active-user-accounts=action|Event|user-create|Action|S25count-active-user-accounts|Start|1262719748 471387|End|1262719748 717318|Elapsed|0.245931
Jan  5 13:29:08 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S25ldap-update
Jan  5 13:29:08 webserver esmith::event[26765]: failed to modify user entry for uid=bakst10,ou=Users,dc=sages,dc=us: No such object at /etc/e-smith/events/user-create/S25ldap-update line 160. 
Jan  5 13:29:08 webserver esmith::event[26765]: S25ldap-update=action|Event|user-create|Action|S25ldap-update|Start|1262719748 717559|End|1262719748 937958|Elapsed|0.220399
Jan  5 13:29:08 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S50user-modify-quota
Jan  5 13:29:09 webserver esmith::event[26765]: Could not get uid for user named "bakst10" 
Jan  5 13:29:09 webserver esmith::event[26765]: S50user-modify-quota=action|Event|user-create|Action|S50user-modify-quota|Start|1262719748 938102|End|1262719749 35976|Elapsed|0.097874|Status|65280
Jan  5 13:29:09 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S55email-assign
Jan  5 13:29:09 webserver esmith::event[26765]: qmail-newu: fatal: bad format in users/assign 
Jan  5 13:29:09 webserver esmith::event[26765]: S55email-assign=action|Event|user-create|Action|S55email-assign|Start|1262719749 36241|End|1262719749 37920|Elapsed|0.001679|Status|28416
Jan  5 13:29:09 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/user-create/S85user-group-modify
Jan  5 13:29:09 webserver esmith::event[26765]: id: bakst10: No such user 
Jan  5 13:29:09 webserver esmith::event[26765]: S85user-group-modify=action|Event|user-create|Action|S85user-group-modify|Start|1262719749 38055|End|1262719749 305675|Elapsed|0.26762
Jan  5 13:29:09 webserver esmith::event[26765]: Running event handler: /etc/e-smith/events/actions/adjust-services
Jan  5 13:29:09 webserver esmith::event[26765]: adjusting supervised qmail (sighup) 
Jan  5 13:29:09 webserver esmith::event[26765]: adjusting supervised qmail (up) 
Jan  5 13:29:09 webserver esmith::event[26765]: adjusting supervised radiusd (sigterm) 
Jan  5 13:29:09 webserver esmith::event[26765]: adjusting supervised radiusd (up) 
Jan  5 13:29:09 webserver esmith::event[26765]: adjusting supervised smbd (sighup) 
Jan  5 13:29:09 webserver esmith::event[26765]: adjusting supervised smbd (up) 
Jan  5 13:29:09 webserver esmith::event[26765]: adjust-services=action|Event|user-create|Action|adjust-services|Start|1262719749 305835|End|1262719749 402570|Elapsed|0.096735

 :-?
« Last Edit: January 05, 2010, 08:36:52 PM by wbell »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Recreate A Deleted User?
« Reply #4 on: January 05, 2010, 08:52:49 PM »
Here are the logs, from the "messages" file, after trying to create "bakst10":

Please post all the details of your problem to the bug tracker.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Recreate A Deleted User?
« Reply #5 on: January 05, 2010, 09:09:18 PM »
wbell

You did so many inappropriate changes and have now potentially messed up your system. NEVER manually edit configuration files on sme server, and do not use other standard Linux user manipulation commands as they are inappropriate to use on sme, due to it's use of the db command & sme specific databases, and signal events and the structure of the whole configuration system.

A 20 second search/read of the FAQ (linked at top of these forums), provided the answer that you probably originally needed:
Deletion of Users Ibays Groups
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:
Code: [Select]
signal-event user-delete <username>
db accounts delete <username>

As you have now done so many manual changes to configuration files, it's hard to say what state your system is in. This line is of concern:
Use of uninitialized value in chown at /usr/lib/perl5/site_perl/esmith/util.pm line 102. 

although I honestly do not know what to do to resolve your current situation.
Unless you have expert knowledge of sme server (which you do not appear to have), I'd take the seemingly easy way out and restore from backup those files you have manually tampered with (ie a known good backup done before you tampered).

Perhaps Charlie or others more technically savvy with sme can help you unravel your mess.

Edit: Oh I see the suggestion to go to bugzilla. A good idea.
« Last Edit: January 05, 2010, 09:54:12 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #6 on: January 05, 2010, 09:18:28 PM »
wbell

You did so many inappropriate changes and have now potentially messed up your system. NEVER manually edit configuration files on sme server, and do not use other standard Linux user manipulation commands as they are inappropriate to use on sme, due to it's use of the db command & sme specific databases, and signal events and the structure of the whole configuration system.

A 20 second search/read of the FAQ (linked at top of these forums), provided the answer that you probably originally needed

As you have now done so many manual changes to configuration files, it's hard to say what state your system is in. This line is of concern:
Use of uninitialized value in chown at /usr/lib/perl5/site_perl/esmith/util.pm line 102. 

although I honestly do not know what to do to resolve your current situation.
Unless you have expert knowledge of sme server (which you do not appear to have), I'd take the seemingly easy way out and restore from backup those files you have manually tampered with (ie a known good backup done before you tampered).

Perhaps Charlie or others more technically savvy with sme can help you unravel your mess.

"mary", I appreciate, and thank you for, your concern, but I know when, and when not to, "mess" with SME Server's config files.
I ALWAYS search, read, and ask, before editing files, such as the above.
I've performed manual removals of users countless times, and I have NEVER had any issues, so I know that it can be done safely.

 8-)

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #7 on: January 05, 2010, 09:20:06 PM »
Please post all the details of your problem to the bug tracker.
Bug 5695 has been submitted!
http://bugs.contribs.org/show_bug.cgi?id=5695

 8-)

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Recreate A Deleted User?
« Reply #8 on: January 05, 2010, 09:49:04 PM »
wbell

Quote
I ALWAYS search, read, and ask, before editing files, such as the above.

You asked here AFTER making those manual changes.
It does not appear that you found these commands from the FAQ (at least not the user-delete event).
signal-event user-delete <username>
db accounts delete <username>

Quote
I've performed manual removals of users countless times, and I have NEVER had any issues.....

Until now ! It's still NOT  recommended procedure and should not be promulgated here in these forums as a good or appropriate way of maintaining your sme server.

Other than troubleshooting serious problems, there should be no need to make manual changes as you suggest.
If you need to do so, then it's likely there is an underlying problem with the base system or with your methodology, which should be sorted out in the bug tracker.

Anyway the matter is in bugzilla now....
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #9 on: January 05, 2010, 10:11:57 PM »
You asked here AFTER making those manual changes.
It does not appear that you found these commands from the FAQ (at least not the user-delete event).
signal-event user-delete <username>
db accounts delete <username>
Just because I asked here after the fact, doesn't mean I didn't ask!
I work with several knowledgeable people, and I am a member of many technology list-servs and forums.
I searched several times within Contribs.org, but I never saw the "signal-event user-delete <username>" command.
I did, however, find the "db accounts delete <username>", and it was tried!


Until now ! It's still NOT  recommended procedure and should not be promulgated here in these forums as a good or appropriate way of maintaining your sme server.
I did not promulgate anything!  I merely stated the methods, for which I had attempted!  I never recommended that someone else should attempt it!


Other than troubleshooting serious problems, there should be no need to make manual changes as you suggest.
If you need to do so, then it's likely there is an underlying problem with the base system or with your methodology, which should be sorted out in the bug tracker.
If I didn't feel as if it was a "serious problem", I wouldn't have made manual changes.


Again...  I may not know all underlying details of SME Server, but in no way would I consider myself a n00b.   :-x

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Recreate A Deleted User?
« Reply #10 on: January 05, 2010, 10:54:08 PM »
wbell

Gee, why are you acting so defensively ?
I pointed out a FAQ entry which you clearly admit to having missed, and the very reason that FAQ  entry has been posted is for people who have the sort of problem you appeared to originally have had.

Quote
I did, however, find the "db accounts delete <username>", and it was tried!

Trying that in isolation is not sufficient, as indicated by the FAQ, the "matching" user-delete event is needed too.
 
How far do you want to keep pushing this discussion that you are knowledgable etc and have tried everything possible, despite overlooking a fundamentally important command ?
I see no thanks, no I'll give that a go, or no gee whiz I missed so much stuff by not seeing that in the FAQ ever before.

Quote
I did not promulgate anything!  I merely stated the methods, for which I had attempted!  I never recommended that someone else should attempt it!

You subsequently did. You "authoritively" claimed such method has been used many times by you without any problem EVER !
There are many instances in these forums where it is stated NOT to edit individual files as you have done and that doing so is NOT RECOMMENDED practice.

Quote
I may not know all underlying details of SME Server, but in no way would I consider myself a n00b.

Ah, your angst appears to be a psychological concern not to be seen as a noob !!!
You also seem unable to "take on board" a valid and documented suggestion.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Recreate A Deleted User?
« Reply #11 on: January 05, 2010, 11:08:47 PM »
wbell & mary, could you please stop it now :-)?

this discussion is going pretty OT IMHO.

Thank you

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #12 on: January 06, 2010, 02:42:02 PM »
Gee, why are you acting so defensively ?
mary... I only defended myself, because I felt as if I was being attacked verbally.  Look at what you've said, and stand in my shoes for a minute.
BTW... I'll try the "fundamentally important command", and post my results.


wbell & mary, could you please stop it now :-)?
this discussion is going pretty OT IMHO.
Thank you
Stefano... I'm done.  As stated above, I felt as if "mary" was attacking me, so I needed to defend myself.

Offline wbell

  • ***
  • 49
  • +0/-0
Re: Recreate A Deleted User?
« Reply #13 on: January 06, 2010, 03:02:50 PM »
As suggested by "mary", I tried performing the following commands:
Code: [Select]
signal-event user-delete bakst
db accounts delete bakst
signal-event post-upgrade; signal-event reboot

Then, I tried to recreate the "bakst" user and still got the following:
Code: [Select]
Operation status report
Error: the account "bakst" can't be created because there is already a system account of that name.

 :-(

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Recreate A Deleted User?
« Reply #14 on: January 06, 2010, 03:06:56 PM »
wbell

Post your results to the bugtracker, not here.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.