67

I'm trying to run the following command in Terminal:

chown -R couchdb:couchdb /usr/local/var/log/couchdb

However, I keep getting this message:

chown: couchdb: illegal group name

I am using mac osx (mountain lion) and I have command line tools installed. I really don't know very much about unix, but I've been googling the illegal group name error and haven't turned up anything that would help. What am I overlooking? Any additional resources you think might be helpful also appreciated.

egon
  • 949
  • 2
  • 7
  • 12
  • 6
    The `couchdb` group doesn't exist. Create it. –  Apr 12 '13 at 20:55
  • 8
    to see which group does the user `couchdb` belong to, type `id couchdb` – fedorqui Apr 12 '13 at 20:56
  • 1
    `/usr/local/var/log/couchdb` suggests you're logging in `/usr/local/`. Not very usual. (This has nothing to do with the non-existent group, though.) – devnull Apr 14 '13 at 08:13

2 Answers2

78

Try using just the owner if no group.

sudo chown -R user: /usr/local/var/log/couchdb
jackotonye
  • 3,537
  • 23
  • 31
52

illegal group name actually means that the group you're specifying (the couchdb after the colon -- the first couchdb is the user) doesn't exist. You need to either create the group, stop specifying a group, or specify a group that exists.

chaos
  • 122,029
  • 33
  • 303
  • 309
  • 2
    Thanks for your help - went back to look at this code from way back to see what I ended up doing. Seems like I omitted the couchdb:couchdb part (since the log is in that location and working properly). So if anyone else is looking: chown -R username /usr/local/var/log/couchdb – egon Oct 28 '15 at 02:24
  • 3
    If you don't want to create group then just do `sudo chown -R : /usr/local/var/log/couchdb` form @jackotonye's answer. – Touqeer Jun 06 '20 at 08:39