Modify

Ticket #3407 (closed defect: worksforme)

Opened 19 months ago

Last modified 15 months ago

Creating users fails

Reported by: sysoft@… Owned by: jamor@…
Milestone: 2.2.X Component: users
Severity: major Keywords:
Cc:

Description (last modified by jamor@…) (diff)

я добавляю пользователя в систему.

Error

root command set -e
mkdir -p `dirname /home/m.dorosh`
cp -dR --preserve=mode /etc/skel /home/m.dorosh
chown -R m.dorosh:__USERS__ /home/m.dorosh
chmod 0700 /home/m.dorosh failed. 
Error output: chown: invalid user: `m.dorosh:__USERS__'

Command output: . 
Exit value: 1

Trace

root command set -e
mkdir -p `dirname /home/m.dorosh`
cp -dR --preserve=mode /etc/skel /home/m.dorosh
chown -R m.dorosh:__USERS__ /home/m.dorosh
chmod 0700 /home/m.dorosh failed. 
Error output: chown: invalid user: `m.dorosh:__USERS__'

Command output: . 
Exit value: 1 at /usr/share/perl5/Error.pm line 182
	Error::throw('EBox::Exceptions::Sudo::Command', 'cmd', 'set -e\x{a}mkdir -p `dirname /home/m.dorosh`\x{a}cp -dR --preserve=mo...', 'output', 'ARRAY(0x7f2ddabfe0d0)', 'error', 'ARRAY(0x7f2ddad78f08)', 'exitValue', 1, ...) called at /usr/share/perl5/EBox/Sudo.pm line 213
	EBox::Sudo::_rootError('/usr/bin/sudo -p sudo: /var/lib/zentyal/tmp/82wh3EtdwB.cmd 2>...', 'set -e\x{a}mkdir -p `dirname /home/m.dorosh`\x{a}cp -dR --preserve=mo...', 256, 'ARRAY(0x7f2ddabfe0d0)', 'ARRAY(0x7f2ddad78f08)') called at /usr/share/perl5/EBox/Sudo.pm line 182
	EBox::Sudo::_root(1, 'mkdir -p `dirname /home/m.dorosh`', 'cp -dR --preserve=mode /etc/skel /home/m.dorosh', 'chown -R m.dorosh:__USERS__ /home/m.dorosh', 'chmod 0700 /home/m.dorosh') called at /usr/share/perl5/EBox/Sudo.pm line 136
	EBox::Sudo::root('mkdir -p `dirname /home/m.dorosh`', 'cp -dR --preserve=mode /etc/skel /home/m.dorosh', 'chown -R m.dorosh:__USERS__ /home/m.dorosh', 'chmod 0700 /home/m.dorosh') called at /usr/share/perl5/EBox/UsersAndGroups.pm line 858
	EBox::UsersAndGroups::initUser('EBox::UsersAndGroups=HASH(0x7f2dd8e02080)', 'm.dorosh', 1) called at /usr/share/perl5/EBox/UsersAndGroups.pm line 1064
	EBox::UsersAndGroups::addUser('EBox::UsersAndGroups=HASH(0x7f2dd8e02080)', 'HASH(0x7f2ddaa4fb80)') called at /usr/share/perl5/EBox/CGI/UsersAndGroups/AddUser.pm line 77
	EBox::CGI::UsersAndGroups::AddUser::_process('EBox::CGI::UsersAndGroups::AddUser=HASH(0x7f2dd6d7c7a8)') called at /usr/share/perl5/EBox/CGI/Base.pm line 275
	EBox::CGI::Base::run('EBox::CGI::UsersAndGroups::AddUser=HASH(0x7f2dd6d7c7a8)') called at /usr/share/perl5/EBox/CGI/Run.pm line 129
	EBox::CGI::Run::run('EBox::CGI::Run', 'UsersAndGroups/AddUser', 'EBox') called at /usr/share/zentyal/cgi/ebox.cgi line 34
	ModPerl::ROOT::ModPerl::Registry::usr_share_zentyal_cgi_ebox_2ecgi::handler('Apache2::RequestRec=SCALAR(0x7f2dd6ce37a8)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 204
	eval {...} called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 204
	ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0x7f2dd6ce31f0)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 170
	ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0x7f2dd6ce31f0)') called at /usr/lib/perl5/ModPerl/Registry.pm line 31
	ModPerl::Registry::handler('ModPerl::Registry', 'Apache2::RequestRec=SCALAR(0x7f2dd6ce37a8)') called at -e line 0
	eval {...} called at -e line 0

Attachments

zentyal.log Download (117.0 KB) - added by anonymous 19 months ago.
zentyal.log
software.log Download (58.0 KB) - added by anonymous 19 months ago.
software.log

Change History

Changed 19 months ago by anonymous

zentyal.log

Changed 19 months ago by anonymous

software.log

comment:1 Changed 19 months ago by sysoft@…

I wanted to tell: I add the user in system. The house folder is created, but to the user the specified group isn't appropriated.

comment:2 Changed 19 months ago by jamor@…

  • Description modified (diff)
  • Summary changed from Bug report from Zentyal Server to When creating user: chown fails because group '_USERS_' does not exist

comment:3 Changed 19 months ago by jamor@…

Hello sysoft and thanks for your report,

I think I have found the error. Go to 'Module status' and enable the 'Users and Group' module then save changes. After that try to create users, you should not have problem now.

I suggest you delete the previous created users and create them again to make sure they are properly created this time.

We will work in the code to make sure this bad configuration will not be reached anymore.

Regards,

Javier

comment:4 Changed 19 months ago by jamor@…

  • Status changed from new to closed
  • Resolution set to fixed

(In [23560]) Make LDAP ready after enableActions restarting the service to avoid problems when quering users or groups closes #3407

comment:5 Changed 16 months ago by airtonix@…

  • priority changed from normal to highest
  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Severity changed from normal to blocker

got this error even though uses and groups was already enabled. :<

comment:6 Changed 16 months ago by jamor@…

Yes, the error is when you enable it and then go to create an user, without saving changes first. This should be fixed in zentyal-users version 2.2.5. What version do you have?.

comment:7 Changed 16 months ago by sysoft@…

  • Component changed from base to users

I have this problem has not disappeared (by the way, zentyal was installed on ubuntu server 10.04). well, that user does not add up there. and on another server everything works fine (installed from the distribution zentyal). users are periodically added to it. everything is stable. What additional information do I submit to that faulty server? maybe I would have reinstalled the OS out there, but now there is no time. now that there is a problem - I can help the logs, configuration information.

comment:8 Changed 16 months ago by jamor@…

Hello,

this error is probably the result of a sequence of events that avoided the creation of the _USERS_ group. If you remember all steps configuring users it could be helpful. Also I would like to know if it is a standalone users installation or a master/slave.

Anyway you can try to reinstall the users module in your system with the command 'sudo /usr/sahre/zentyal/users/reinstall' and setup again.

Regards,

Javier

comment:9 Changed 16 months ago by jamor@…

  • Status changed from reopened to accepted

comment:10 Changed 16 months ago by jamor@…

  • priority changed from highest to normal
  • Status changed from accepted to closed
  • Resolution set to worksforme

Sorry, I cannot reproduce this, I would need more information to do something with this issue.

comment:11 Changed 16 months ago by victor.major@…

  • Status changed from closed to reopened
  • Resolution worksforme deleted

Hi Javier,

I am affected by this error as well, ticket #3789.

Your suggested correction above 'sudo /usr/sahre/zentyal/users/reinstall' is faulty.

I think that you meant to write 'sudo /usr/share/zentyal/users/reinstall' however that path does not exist.

There is no 'users' directory under '/usr/share/zentyal'

My Zentyal version is 2.2.5 with 5 users. The error occurred when I tried to add the 6th user, immediately after adding the 5th user.

comment:12 Changed 16 months ago by victor.major@…

Sorry, I added my latest comment to my ticket #3789. I'll copy it here:

The correct command sequence is:

cd /usr/share/zentyal-users/ sudo ./reinstall

BUT, this does not fix the problem. Executing this command deleted all the users and is now preventing addition of any users by reporting the same error as in this ticket and my own ticket, thus our file server is effectively dead.

Restarting the "Users and Groups" and "File Sharing" does not help either.

Please help, urgently.

comment:13 Changed 16 months ago by victor.major@…

I did some more investigation.

If I SSH to the server and execute the failed 'chown -R user:USERS /home/user' command as root, there is no error.

Thus: USERS group was created by Zentyal and there is no obvious error. The error seems to be with permissions, or admin level when logging into the web front end. It appears that the Zentyal admin user is not given adequate authority to make the changes to users.

My Zentyal admin user belongs to these groups: adm dialout cdrom plugdev lpadmin sambashare admin

As a "fix" to get us out of this jam can you tell me the sequence of commands to add users to Zentyal from the terminal?

comment:14 Changed 16 months ago by victor.major@…

  • Summary changed from When creating user: chown fails because group '_USERS_' does not exist to Creating users fails

more information.

I followed my hunch and attempted used addition as root through terminal using the script detailed here:  http://forum.zentyal.org/index.php/topic,4888.msg20153.html#msg20153

Unfortunately I got the same error as root:

Creating user: user user

root command set -e mkdir -p dirname /home/user cp -dR --preserve=mode /etc/skel /home/user chown -R user:USERS /home/user chmod 0700 /home/user failed. Error output: chown: invalid user: `user:USERS'

Thus this is not a permission issue, but a genuine hard bug as far as I can tell and unrelated to group USERS existing. Here is the groupadd USERS output:

'groupadd: group 'USERS' already exists'

comment:15 Changed 16 months ago by jamor@…

  • Severity changed from blocker to major

Hello Victor Major,

after seeing your logs in #3789 it seems that the problem is that the home directory of the user already exists. I will fix the code so this error is not obscured by the chown error.

To fix your system, you could remove the home directory. Another option is to set in /etc/zentyal/users.conf the mk_home variable to 'no'; this disable directory creation do it is possible it is not useful for your configuration.

Other thing important is to know how you have arrived to this situation. You created the user manully and then removed it?. You created the user using the interface and then removed it?. Or you have mounted an existent hard disk with directories created?.

I have reset the sevirty to 'major'; we have removed the 'blocker' severity and 'major' is for disruption of important services or important data loss.

Regards,

Javier

comment:16 follow-up: ↓ 17 Changed 16 months ago by jamor@…

  • Status changed from reopened to accepted

comment:17 in reply to: ↑ 16 Changed 16 months ago by victor.major@…

Replying to jamor@…:

Hi Javier, thank you for replying.

User directories were deleted via ssh, but the error persists.

The error occurred while using only the web interface...except I remember now. Two new users could not access shares on Zentyal machine. I then used ssh to see if the new users were actually samba users and they were not. The existing 3 users were samba users and they had access to shared drives. Thus the original error was also with user creation where Zentyal failed to create samba users. File sharing for existing users was of course active and fully operational at that stage.

I recall that I then manually created one user, but Zentyal web interface did not see her so I removed the user using ssh.

I then successfully created at least one user using Zentyal web interface before this user creation error appeared.

comment:18 Changed 16 months ago by jamor@…

Hello,

I have tried to reproduce this adding and removing users without success. I would try to use your new information to try to reproduce.

Also I have checked that the 'directory already' exists message is fired before the chown command. Maybe you have a non standard set of permissions?. To see this could you put the output of this command:

ls -ld /home  /home/*

Regards,

Javier

Thanks

comment:19 Changed 16 months ago by victor.major@…

Hi Javier,

drwxr-xr-x  4 root   root   4096 2012-02-07 18:18 /home
drwxr-xr-x  6 root   root   4096 2011-10-19 15:57 /home/samba
drwxr-xr-x 19 vmajor vmajor 4096 2012-02-07 17:04 /home/vmajor

It all looks normal here as far as I can see...

Cheers,

Victor

comment:20 Changed 16 months ago by victor.major@…

I removed and reinstalled Users and Groups and File Sharing, I also ran apt-get remove samba --purge and cleaned up all LDAP config files, but the problem persisted.

I finally went to /etc/zentyal and edited 'users.conf' file to show this:

# whether to create user homes or not
mk_home = no

After rebooting the server all is well with user creation and shares, except that use home directories are not created. This is not an issue for us since we do not use this feature anyway.

The original bug remains unsolved.

comment:21 Changed 16 months ago by jamor@…

Hello Victor Major,

yes, the permissions are correct. I am thinking that maybe is a error in your /etc/skel files or other unexpected configuration of your system.

Please, could you run the following commands and paste here they result?

sudo mkdir -p `dirname /home/test1`
sudo cp -dR --preserve=mode /etc/skel /home/test1
sudo chown -R stacic:__USERS__ /home/test1
sudo chmod 0700 /home/test1

If the user 'stacic' does not exists use another existent user. When you finished you could remove safely the directory /home/test1

Many thanks,

Javier

comment:22 Changed 16 months ago by victor.major@…

Hi Javier,

there is no error.

/home ls -al shows this now:

drwxr-xr-x  5 root   root      4096 2012-02-10 09:51 .
drwxr-xr-x 22 root   root      4096 2012-02-08 17:39 ..
drwxr-xr-x  6 root   root      4096 2011-10-19 15:57 samba
drwx------  2 stacic __USERS__ 4096 2012-02-10 09:51 test1
drwxr-xr-x 19 vmajor vmajor    4096 2012-02-07 17:04 vmajor

V.

comment:23 Changed 16 months ago by jamor@…

Hello Victor,

this puzzles me because those are the commands which are executed in the point which your log raises the error.

Could you switch back temporally 'mk_home' to 'yes', create a user and report back the new zentyal.log ?

Regards,

Javier

comment:24 Changed 15 months ago by jamor@…

  • Owner changed from jacalvo@… to jamor@…

comment:25 Changed 15 months ago by jamor@…

  • Status changed from accepted to closed
  • Resolution set to worksforme

Hello Victor,

I have not seen this exact error in other system so if you could not provide me with more feedback I would think that is a strange knot in your system and not trace back it to Zentyal.

So I close this until we get more examples of this problem or more feedback.

Kind regards,

Javier

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.