couchdb fails to install because /var/log/couchdb/0.10.0 does not exist

Bug #453049 reported by Chad Miller
140
This bug affects 30 people
Affects Status Importance Assigned to Milestone
couchdb (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Karmic by Chad Miller

Bug Description

Binary package hint: couchdb

The couchdb user is unprivileged and can not create log files without a containing /var/log/couchdb directory.

Without it, couchdb refuses to start.

Related branches

Chad Miller (cmiller)
Changed in couchdb (Ubuntu):
status: New → Confirmed
Chad Miller (cmiller)
summary: - couchdb won't start without log directory
+ couchdb fails to install because /var/log/couchdb does not exist
Revision history for this message
Chad Miller (cmiller) wrote : Re: couchdb fails to install because /var/log/couchdb does not exist

Errors were encountered while processing:
 couchdb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up couchdb (0.10.0-0ubuntu1) ...
chown: cannot access `/var/log/couchdb': No such file or directory
dpkg: error processing couchdb (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 couchdb

Revision history for this message
Anders Jackson (anders-jackson) wrote :

I can confirm this.
If the directory is created with 'sudo mkdir /var/log/couchdb' before installing couchdb, the installation looks like it will make a good installation.

Revision history for this message
Chad Miller (cmiller) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

@@ -8,7 +8,8 @@

 case $1 in
     configure)
- mkdir -p /var/lib/couchdb
+ test -d /var/log/couchdb || mkdir -p /var/log/couchdb
+ test -d /var/lib/couchdb || mkdir -p /var/lib/couchdb
         chown -R couchdb:couchdb /var/lib/couchdb
         chown -R couchdb:couchdb /var/log/couchdb
         chmod -R 0770 /var/lib/couchdb

The test is unnecessary, mkdir -p already implies this.

Also, the attached debdiff includes another patch for a bug that's marked private. Please unmark the bug as private (if it doesn't contain information that needs to be private), or create a public bug report that's a suitable reference for the upload changelog.

Revision history for this message
Chad Miller (cmiller) wrote :

The additional patch is probably unnecessary. Let's only add the mkdir for now.

Revision history for this message
Martin Pitt (pitti) wrote :

uploaded

Changed in couchdb (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package couchdb - 0.10.0-0ubuntu2

---------------
couchdb (0.10.0-0ubuntu2) karmic; urgency=low

  * create /var/log/couchdb so that couchdb installs/runs (LP: #453049)

 -- Chad Miller <email address hidden> Mon, 19 Oct 2009 09:37:43 -0400

Changed in couchdb (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Chad Miller (cmiller) wrote :

Oh, that is insufficient. It fails *silently*, in a slightly different way, and seems to succeed, unless /var/log/couchdb/UPSTREAMVERSION/ exists. Adding to queued patch. over on #456234.

Chad Miller (cmiller)
Changed in couchdb (Ubuntu):
status: Fix Released → Fix Committed
Revision history for this message
Joe "Rotund" Tennies (joe-tennies) wrote :

Yeah. I just want to add a comment that you need something like /var/log/couchdb/0.10.0/ for it to work.

Revision history for this message
Maxime Garcia (maxime-garcia) wrote :

The fix is partial.

It misses the /var/log/couchdb/0.10.0 dir to work.

Steps to get working :

sudo aptitude install couchdb
sudo su
mkdir /var/log/couchdb/0.10.0
chown couchdb:couchdb /var/log/couchdb/0.10.0

(it also corrects the "/etc/init.d/couchch stop" problem that doesn't effectively stop couchdb)

Changed in couchdb (Ubuntu):
status: Fix Committed → Confirmed
Revision history for this message
Maxime Garcia (maxime-garcia) wrote :

I give more details :

The fix released permits couchdb to install, to launch, but not to work.

Creating the correct log dir (/var/log/couchdb/0.10.0) permits couchdb to work :

telnet 127.0.0.1 5984
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET / HTTP/1.1

HTTP/1.1 200 OK
Server: CouchDB/0.10.0 (Erlang OTP/R13B)
Date: Wed, 21 Oct 2009 09:19:29 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 41
Cache-Control: must-revalidate

{"couchdb":"Welcome","version":"0.10.0"}

Revision history for this message
Chad Miller (cmiller) wrote :

Fixed in 0.10.0-0ubuntu3 yesterday. (Attached to LP: #456234)

Changed in couchdb (Ubuntu):
status: Confirmed → Fix Committed
summary: - couchdb fails to install because /var/log/couchdb does not exist
+ couchdb fails to install because /var/log/couchdb/0.10.0 does not exist
Chad Miller (cmiller)
Changed in couchdb (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Wolfgang Richter (wolfgang-richter) wrote :

Also, there is a folder:

/var/lib/couchdb/0.10.0

that is not being created properly.

Should exist and be owned by couchdb:couchdb.

Revision history for this message
Wolfgang Richter (wolfgang-richter) wrote :

Maxime's issue is probably that /var/lib/couchdb/0.10.0 doesn't exist. My couchdb works fine with these two folders now created (running Mozilla Raindrop on it).

Revision history for this message
cjazz108 (adamjpetty) wrote :

I have the bug... trying to install couchdb 0.10.0

After install, I cannot stop, it continually restarts itself, and starts to fill up /var/log/couchdb/couchdb.log with errors of

[Fri, 06 Nov 2009 15:58:41 GMT] [error] [<0.66.0>] {error_report,<0.24.0>,
              {<0.66.0>,crash_report,
               [[{initial_call,{mochiweb_socket_server,init,['Argument__1']}},
                 {pid,<0.66.0>},
                 {registered_name,[]},
                 {error_info,{exit,eaddrinuse,
                                   [{gen_server,init_it,6},
                                    {proc_lib,init_p_do_apply,3}]}},
                 {ancestors,[couch_secondary_services,couch_server_sup,
                             <0.1.0>]},
                 {messages,[]},
                 {links,[<0.53.0>]},
                 {dictionary,[]},
                 {trap_exit,true},
                 {status,running},
                 {heap_size,987},
                 {stack_size,24},
                 {reductions,446}],
                []]}}

My understanding is that this is a bug when its trying to restart itself - and already sees that it's running. So now it does stop, but caught in a loop trying to restart.

This could be a big deal, but not sure if its just my setup or not.

Not even uninstalling keeps couch from running too... its like there's no way to get rid of it without a reboot.

I apt-get remove --purged, and apt-get remove reinstalled, same issue

Revision history for this message
cjazz108 (adamjpetty) wrote :

I re-installed on a fresh Karmic x64 install (never installed couch here before) Same issue. The script reports that "Couchdb stopped... [ok]" but no such stoppage has occured.

If you then hit /etc/init.d/couchdb restart, or reload - that's when the log file starts to fill up, because port 5984 (standard port) is already reserved, but for some reason, it still sees it as stopped - and continues to try to restart - although it never stopped the first time.

This is rather serious. I tried to reconfigure my couchdb init files, and overnight, I had a 1gb log file. Luckily I have /var/log on a seperate partition for couch specifically - but this could cause some big issues if it's left for more than overnight.

BTW all the right files and permissions seem to be created now - so this is not a /var/log(or lib)/couchdb/0.10.0 existence/permission issue anymore.

I'm now installing from source, so I'll report if it continues.

Revision history for this message
cjazz108 (adamjpetty) wrote :

sry added to wrong bug... moving to correct one

Revision history for this message
mauricepsonnemann (msonnemann) wrote :

I just want to report that this bug is still (or again) present in Lucid Lynx.
Creating /var/log/couchdb, /var/lib/couchdb/0.10.0 and chmoding them to couchdb:couchdb did the trick though.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.