It's true that you can just edit the text file
/etc/group. It sounds like you have either deleted too much, or else left the file in a broken state. It needs to be one entry per line, in this format:
for "empty" groups, or
for groups with one member, or
for groups with multiple members. I put "empty" in quotes because you can also be a member of a group if it's set as your primary group in
/etc/passwd — it's the fourth field there.
(The "x" can actually be a password hash, but that's very rarely used these days. It's almost certainly going to be all "x"s on your system.)
If you have extraneous blank lines, or badly formatted ones, that could mess things up.
The file also needs to have world-readable permissions.
Ideally, you have a backup of the file from a few months ago. But, I understand the real world. :)
There is also a file
/etc/gshadow. If you are using group passwords (and like I said, almost nobody does), their hash values should be kept here instead of
/etc/group, because this file is supposed to be only readable by root. This file can also be used to designate group administrators, who have the ability to add members using certain command-line tools. (I don't know of anyone using this functionality either.)
This file should be kept in sync with
/etc/group. Using command-line or GUI tools to manage groups will do that automatically, which is another reason to consider using those rather than just editing the file. However, in actual practice, this file can be quite out of sync and even all munged up and your system will generally work fine. It won't result in the error you're seeing.
Gilles adds in a comment below that you could look in the
/etc/gshadow file for information about how things should be. This won't have all the important information (like group ID number), but will have the group names and probably group membership information.
There may also be an
/etc/group- file (note the
- at the end) — this is the standard backup file created by the some tools for manipulating
/etc/group/. If you're lucky, that'll have everything you need. (Often it's not much help, though, because it's just one backup. And programs like
gpasswd don't update it.)