Cannot stop couchdb using /etc/init.d/couchdb after package install

Bug #448682 reported by Robbie Williamson
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
couchdb (Debian)
Fix Released
Unknown
couchdb (Ubuntu)
Triaged
Medium
Unassigned
Karmic
Invalid
Medium
Unassigned
Lucid
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: couchdb

Cannot stop couchdb via init.d script:

robbiew@robbiew-netbook:~$ ps -ef | grep couchdb
robbiew 15130 15111 0 08:03 pts/2 00:00:00 grep couchdb
robbiew@robbiew-netbook:~$ sudo service couchdb start
[sudo] password for robbiew:
 * Starting database server couchdb [ OK ]
robbiew@robbiew-netbook:~$ ps -ef | grep couch
couchdb 15187 1 0 08:03 pts/2 00:00:00 /bin/sh -e /usr/bin/couchdb -a \"/etc/couchdb/default.ini\" -a \"/etc/couchdb/local.ini\" -b -r 5 -p /var/run/couchdb/couchdb.pid -o /dev/null -e /dev/null -R
couchdb 15326 15187 0 08:04 pts/2 00:00:00 sleep 5
robbiew 15351 15111 0 08:04 pts/2 00:00:00 grep couch
robbiew@robbiew-netbook:~$ sudo service couchdb stop
 * Stopping database server couchdb [ OK ]
robbiew@robbiew-netbook:~$ ps -ef | grep couch
couchdb 15187 1 0 08:03 pts/2 00:00:00 /bin/sh -e /usr/bin/couchdb -a \"/etc/couchdb/default.ini\" -a \"/etc/couchdb/local.ini\" -b -r 5 -p /var/run/couchdb/couchdb.pid -o /dev/null -e /dev/null -R
couchdb 15549 15187 0 08:04 pts/2 00:00:00 sleep 5
robbiew 15578 15111 0 08:04 pts/2 00:00:00 grep couch

ProblemType: Bug
Architecture: i386
Date: Sun Oct 11 07:58:27 2009
DistroRelease: Ubuntu 9.10
Package: couchdb 0.10.0~svn818859-0ubuntu2
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-13.42-generic
SourcePackage: couchdb
Tags: ubuntu-unr
Uname: Linux 2.6.31-13-generic i686
XsessionErrors:
 (gnome-settings-daemon:1755): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (nautilus:1847): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (polkit-gnome-authentication-agent-1:1865): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (gnome-panel:1806): Gdk-CRITICAL **: gdk_x11_colormap_foreign_new: assertion `GDK_IS_VISUAL (visual)' failed
 (gnome-panel:1806): Gdk-CRITICAL **: gdk_x11_colormap_foreign_new: assertion `GDK_IS_VISUAL (visual)' failed

Revision history for this message
Robbie Williamson (robbiew) wrote :
Changed in couchdb (Ubuntu):
importance: Undecided → Medium
Changed in couchdb (Ubuntu Karmic):
status: New → Triaged
Revision history for this message
Maxime Garcia (maxime-garcia) wrote :

This seems to be a consequence of the Bug 453049 :
https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/453049

See the fix at my comment :
https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/453049/comments/10
that resolves this stop bug.

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 :

Just reinstalled on my laptop - that had no previous couch install (except ubuntuone).

The same bug occured... could not stop.

The script reports (couchdb stop.... [ok]) but I can still update documents in futon (the web admin for couch).

Also trying to restart gives same errors above, and log file continues to be filled (even after --purge).

Only way to stop couch - is to reboot.

If left for a while - I could see this taking down a few computers, especially if they don't have a seperate partition for /var.

Revision history for this message
Fer (fauria) wrote :

You can kill couchdb without rebooting by using:

ps -U couchdb -o pid= | xargs kill -9

Revision history for this message
intel352 (intel352) wrote :

Problem still exists on Ubuntu 10.4 Server

Revision history for this message
Mathias Gug (mathiaz) wrote :

couchdb will not be killed by its init script because signal 1 is ignored if the daemon has been started during package installation:

$ cat /proc/$(cat /var/run/couchdb/couchdb.pid)/status
[...]
SigIgn: 0000000000001007
[...]

If couchdb has been started by its init script during boot time or from the console then signal 1 is not ignored:

$ cat /proc/$(cat /var/run/couchdb/couchdb.pid)/status
SigIgn: 0000000000001006

The couchdb script uses signal 1 to kill the erlang vm.

summary: - Cannot stop couchdb using /etc/init.d/couchdb
+ Cannot stop couchdb using /etc/init.d/couchdb after package install
Revision history for this message
Mathias Gug (mathiaz) wrote :

Some conversations with cjwatson on IRC lead to two potential fixes to address the issue:

1. < cjwatson> mathiaz: I meant calling sigaction in the daemon itself

2. < cjwatson> or create a tiny C wrapper that does struct sigaction sa;
                  memset (&sa, 0, sizeof sa); sa.sa_handler = SIG_DFL;
                  sigemptyset (&sa.sa_mask); sa.sa_flags = 0; sigaction
                  (SIGHUP, &sa, NULL); and then execs the program

It seems that option 1. may not be possible if erlang doesn't support signals.

Changed in couchdb (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Medium
Changed in couchdb (Debian):
status: Unknown → New
Changed in couchdb (Debian):
status: New → Fix Released
Revision history for this message
JC Hulce (soaringsky) wrote :

Debian fixed this in 1.1.0-2. This version likely will not make it in to Precise as-is; someone needs to go through SRU procedure. I am closing the bugtasks for old versions of Ubuntu and adding ones for new versions

Changed in couchdb (Ubuntu Karmic):
status: Triaged → Invalid
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in couchdb (Ubuntu Lucid):
status: Triaged → Won't Fix
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.