From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030120 Description of problem: redhat-config-user throws an exeption in mainwindow, refresh_user with no other explanation. useradd, userdel etc all work properly. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.redhat-config-users 2. 3. Actual Results: messagebox with "the user database cannot be read. Program will exit now. Expected Results: If there is somthing wrong with /etc/passwd /etc/group this gives no information of what to do. /etc/passwd, /etc/group, /etc/shadow all exist and are readable and command line user utilities all work. Additional info: Problem seems have something to do with associating names with gids
Have you modified any of these files by hand? This error is usually caused by people deleting a user from /etc/passwd but not from /etc/shadow. In this case, the files are out of sync and this breaks libuser, which is the backend that redhat-config-users uses.
As far as I remember users have only to added and taken away with useradd, userdel. Both the /etc/passwd file and /etc/shadow file have the same number of entries. It is failing in the try block with the call to userEnt.get. def refresh_users(self): self.user_dict = {} self.gid_dict = {} # pull up information about users and store the objects in # a dictionary keyed by user name i = 0 for user in self.get_user_list(self.get_filter_data()): i = i + 1 if i >= self.service_interval: service_pending_events() i = 0 userName = user.get(libuser.USERNAME)[0] userEnt = self.ADMIN.lookupUserByName(userName) self.user_dict[user] = userEnt # try to get a name to associate with the user's primary gid, # and attempt to minimize lookups by caching answers try: gidNumber = userEnt.get(libuser.GIDNUMBER)[0] except: messageDialog.show_message_dialog(_("The user database cannot be read. Program will exit now.")) os._exit(0)
Try adding a print statement to /usr/share/redhat-config-users/mainWindow.py file to show us which user name it's tripping up on. In the refresh_users() function, add: 'print userName' after the 'userName = user.get(libuser.USERNAME)[0] That should print out the user name of each user as it's processed. What is the last user name that it prints out?
I found a rogue user is /etc/shadow- . The problem on this machine is resolved but the problem of poor error notification with no user direction remains. The average user is not going to know what is wrong so he will call you. You can do better.
The problem is that the database can be broken in any number of ways. There's no way for redhat-config-users to know what the problem might be. All it knows is that the call to libuser fails. Creating this error message was in response to bug #73375, so the behavior has improved. The majority of these bugs is caused by people who try to delete a user manually by deleting them from /etc/passwd. They forget to delete the user in /etc/shadow, so the two files get out of sync. I would argue that the "average user", as you say, will not run into this problem because they don't modify those files by hand. But there's no way for me to give the user a set of steps to take because there's no way to know in what way the files are corrupted. Maybe there are mismatched entries in the files. Maybe there are invalid (non-ASCII) characters in the files. Maybe something else. There's no way for redhat-config-users to know. I think the current error message at least gives the user some indication that something is wrong with the user and group database. At any rate, I cannot change the behavior at this point since we are past string freeze. Resolving as 'notabug' since this is the expected behavior.