CouchDB
  1. CouchDB
  2. COUCHDB-1106

After Mac OS X update can not connect to CouchDB (10.6.6 0 => 10.6.7)

    Details

      Description

      After updating Mac OS X to 10.6.7 had problem connecting to couchdb and noticed that it's running but not listening port.
      There are no logs. Even log file is missing and there is nothing in syslog. Launchctl is stopping starting correctly without any error.

      I used macports to install couchdb 4 months ago it was fine before update.
      I tried to remove everything somehow connected to couchdb and setup new one but result is same.

        Activity

        Hide
        Dave Cottlehuber added a comment -

        Working fine here using a homebrew install. Issue sounds very much like permissions related - no logs.

        dave@akai:~ $ uname -r
        10.7.3
        dave@akai:~ $ curl localhost:5984

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

        dave@akai:~ $

        Can you check the following;
        Try a manual start using ./couchdb & su to correct user as needed.
        Then check permissions below & restart.

        chown -R couchdb:couchdb /usr/local/etc/couchdb
        chown -R couchdb:couchdb /usr/local/var/lib/couchdb
        chown -R couchdb:couchdb /usr/local/var/log/couchdb
        chown -R couchdb:couchdb /usr/local/var/run/couchdb
        chmod 0770 /usr/local/etc/couchdb
        chmod 0770 /usr/local/var/lib/couchdb
        chmod 0770 /usr/local/var/log/couchdb
        chmod 0770 /usr/local/var/run/couchdb

        A+
        Dave

        Show
        Dave Cottlehuber added a comment - Working fine here using a homebrew install. Issue sounds very much like permissions related - no logs. dave@akai:~ $ uname -r 10.7.3 dave@akai:~ $ curl localhost:5984 {"couchdb":"Welcome","version":"1.0.2"} dave@akai:~ $ Can you check the following; Try a manual start using ./couchdb & su to correct user as needed. Then check permissions below & restart. chown -R couchdb:couchdb /usr/local/etc/couchdb chown -R couchdb:couchdb /usr/local/var/lib/couchdb chown -R couchdb:couchdb /usr/local/var/log/couchdb chown -R couchdb:couchdb /usr/local/var/run/couchdb chmod 0770 /usr/local/etc/couchdb chmod 0770 /usr/local/var/lib/couchdb chmod 0770 /usr/local/var/log/couchdb chmod 0770 /usr/local/var/run/couchdb A+ Dave
        Hide
        Todd Blose added a comment - - edited

        Why are these permission errors not printed to the couchdb log? The server pretends to start successfully, but remained inaccessible for me. I had to do a lot of digging to find that this was the cause.

        Show
        Todd Blose added a comment - - edited Why are these permission errors not printed to the couchdb log? The server pretends to start successfully, but remained inaccessible for me. I had to do a lot of digging to find that this was the cause.
        Hide
        Aram Karapetyan added a comment -

        aramo:var aramkarapetyan$ uname -r
        10.7.0

        aramo:var aramkarapetyan$ ps aux | grep couch
        aramkarapetyan 38729 0.0 0.0 2435120 532 s001 S+ 10:34PM 0:00.00 grep couch
        couchdb 38692 0.0 0.3 2487548 11328 ?? Ss 10:29PM 0:00.20 /opt/local/lib/erlang/erts-5.8.2/bin/beam.smp -Bd -K true -A 4 – -root /opt/local/lib/erlang -progname erl – -home ~ – -noshell -noinput -sasl errlog_type error -couch_ini /opt/local/etc/couchdb/default.ini /opt/local/etc/couchdb/local.ini -s couch

        aramo:var aramkarapetyan$ less /opt/local/var/log/couchdb/couch.log
        /opt/local/var/log/couchdb/couch.log: No such file or directory
        Log folder is writable

        Permissions are ok.
        couch installed in /opt/local

        Still not working.

        Show
        Aram Karapetyan added a comment - aramo:var aramkarapetyan$ uname -r 10.7.0 aramo:var aramkarapetyan$ ps aux | grep couch aramkarapetyan 38729 0.0 0.0 2435120 532 s001 S+ 10:34PM 0:00.00 grep couch couchdb 38692 0.0 0.3 2487548 11328 ?? Ss 10:29PM 0:00.20 /opt/local/lib/erlang/erts-5.8.2/bin/beam.smp -Bd -K true -A 4 – -root /opt/local/lib/erlang -progname erl – -home ~ – -noshell -noinput -sasl errlog_type error -couch_ini /opt/local/etc/couchdb/default.ini /opt/local/etc/couchdb/local.ini -s couch aramo:var aramkarapetyan$ less /opt/local/var/log/couchdb/couch.log /opt/local/var/log/couchdb/couch.log: No such file or directory Log folder is writable Permissions are ok. couch installed in /opt/local Still not working.
        Hide
        Jan Lehnardt added a comment -

        Can you try starting couchdb as root? If that works, there's still permission issues.

        Show
        Jan Lehnardt added a comment - Can you try starting couchdb as root? If that works, there's still permission issues.
        Hide
        Aram Karapetyan added a comment -

        Does not help.

        Show
        Aram Karapetyan added a comment - Does not help.
        Hide
        Dave Cottlehuber added a comment -

        Hi Aram,

        can you try starting couch interactively, and post back the output please?

        couchdb -i

        Show
        Dave Cottlehuber added a comment - Hi Aram, can you try starting couch interactively, and post back the output please? couchdb -i
        Hide
        Aram Karapetyan added a comment -

        Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:4] [hipe] [kernel-poll:true]

        Eshell V5.8.2 (abort with ^G)

        Show
        Aram Karapetyan added a comment - Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:4] [hipe] [kernel-poll:true] Eshell V5.8.2 (abort with ^G)
        Hide
        Dave Cottlehuber added a comment -

        Aram that's very odd. Normally we should see a whole lot more - mine is at https://gist.github.com/924372 for example. In particular there's nothing here about starting up couchdb - it's as if you're only starting an erlang shell instead of couchdb itself.

        Can you update local.ini to use debug level logging please & then from the Eshell you get after running couchdb -i as user couchdb, can you send back the console output, via pastebin or friendpaste?

        os:getenv().
        i().
        m().
        regs().
        couch:stop().
        crypto:stop().
        crypto:start().
        couch:start().

        A+
        Dave

        Show
        Dave Cottlehuber added a comment - Aram that's very odd. Normally we should see a whole lot more - mine is at https://gist.github.com/924372 for example. In particular there's nothing here about starting up couchdb - it's as if you're only starting an erlang shell instead of couchdb itself. Can you update local.ini to use debug level logging please & then from the Eshell you get after running couchdb -i as user couchdb, can you send back the console output, via pastebin or friendpaste? os:getenv(). i(). m(). regs(). couch:stop(). crypto:stop(). crypto:start(). couch:start(). A+ Dave
        Hide
        Dave Cottlehuber added a comment -

        and also please:
        init:get_arguments().

        Show
        Dave Cottlehuber added a comment - and also please: init:get_arguments().
        Hide
        Aram Karapetyan added a comment -

        Crypto can not start.

        1> os:getenv().
        ["ERL_LIBS=/opt/local/lib/couchdb/erlang/lib",
        "__CF_USER_TEXT_ENCODING=0x0:0:0","HOME=/var/root",
        "SHLVL=1","PROGNAME=erl","PWD=/",
        "PATH=/opt/local/lib/erlang/erts-5.8.2/bin:/opt/local/lib/erlang/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin",
        "ROOTDIR=/opt/local/lib/erlang","USER=root",
        "BINDIR=/opt/local/lib/erlang/erts-5.8.2/bin",
        "SHELL=/bin/sh","TERM=xterm-color","EMU=beam"]

        7> i().
        Pid Initial Call Heap Reds Msgs
        Registered Current Function Stack
        <0.0.0> otp_ring0:start/2 1597 3470 0
        init init:loop/1 2
        <0.3.0> erlang:apply/2 2584 691017 0
        erl_prim_loader erl_prim_loader:loop/3 6
        <0.6.0> gen_event:init_it/6 987 1437 0
        error_logger gen_event:fetch_msg/5 8
        <0.7.0> erlang:apply/2 1597 19369 0
        application_controlle gen_server:loop/6 7
        <0.9.0> application_master:init/4 377 44 0
        application_master:main_loop/2 6
        <0.10.0> application_master:start_it/4 233 70 0
        application_master:loop_it/4 5
        <0.11.0> supervisor:kernel/1 4181 35019 0
        kernel_sup gen_server:loop/6 9
        <0.12.0> rpc:init/1 233 36 0
        rex gen_server:loop/6 9
        <0.13.0> global:init/1 233 50 0
        global_name_server gen_server:loop/6 9
        <0.14.0> erlang:apply/2 233 20 0
        global:loop_the_locker/1 4
        <0.15.0> erlang:apply/2 233 3 0
        global:loop_the_registrar/0 2
        <0.16.0> inet_db:init/1 233 236 0
        inet_db gen_server:loop/6 9
        <0.17.0> global_group:init/1 233 60 0
        global_group gen_server:loop/6 9
        <0.18.0> file_server:init/1 233 85 0
        file_server_2 gen_server:loop/6 9
        <0.19.0> erlang:apply/2 4181 128530 0
        code_server code_server:loop/1 3
        <0.20.0> supervisor_bridge:standard_error/ 233 41 0
        standard_error_sup gen_server:loop/6 9
        <0.21.0> erlang:apply/2 233 9 0
        standard_error standard_error:server_loop/1 2
        <0.22.0> supervisor_bridge:user_sup/1 610 89 0
        gen_server:loop/6 9
        <0.23.0> user_drv:server/2 1597 1357 0
        user_drv user_drv:server_loop/5 8
        <0.24.0> group:server/3 1597 327 0
        user group:server_loop/3 4
        <0.25.0> group:server/3 2584 12240 0
        group:server_loop/3 4
        <0.26.0> erlang:apply/2 2584 6221 0
        shell:shell_rep/4 17
        <0.27.0> kernel_config:init/1 233 268 0
        gen_server:loop/6 9
        <0.28.0> supervisor:kernel/1 233 60 0
        kernel_safe_sup gen_server:loop/6 9
        <0.38.0> erlang:apply/2 4181 14470 0
        c:pinfo/1 50
        Total 31453 914528 0
        218
        ok

        2> couch:stop().
        {error,{not_started,couch}}
        3> crypto:stop().

          • exception error: undefined function crypto:stop/0
            4> crypto:start().
          • exception error: undefined function crypto:start/0
            5>
            5> couch:start().
            {error,{{app_would_not_start,crypto},
            {couch_app,start, [normal, ["/opt/local/etc/couchdb/default.ini", "/opt/local/etc/couchdb/local.ini"]]}

            }}

        =INFO REPORT==== 19-Apr-2011::10:31:43 ===
        application: couch
        exited: {{app_would_not_start,crypto},
        {couch_app,start,
        [normal,
        ["/opt/local/etc/couchdb/default.ini",
        "/opt/local/etc/couchdb/local.ini"]]}}
        type: temporary

        6> init:get_arguments().
        [

        {root,["/opt/local/lib/erlang"]}

        ,

        {progname,["erl"]}

        ,

        {home,["/var/root"]}

        ,

        {sasl,["errlog_type","error"]}

        ,

        {couch_ini,["/opt/local/etc/couchdb/default.ini", "/opt/local/etc/couchdb/local.ini"]}

        ]

        9> regs().

          • Registered procs on node nonode@nohost **
            Name Pid Initial Call Reds Msgs
            application_controlle <0.7.0> erlang:apply/2 19369 0
            code_server <0.19.0> erlang:apply/2 130188 0
            erl_prim_loader <0.3.0> erlang:apply/2 691017 0
            error_logger <0.6.0> gen_event:init_it/6 1437 0
            file_server_2 <0.18.0> file_server:init/1 85 0
            global_group <0.17.0> global_group:init/1 60 0
            global_name_server <0.13.0> global:init/1 50 0
            inet_db <0.16.0> inet_db:init/1 236 0
            init <0.0.0> otp_ring0:start/2 3470 0
            kernel_safe_sup <0.28.0> supervisor:kernel/1 60 0
            kernel_sup <0.11.0> supervisor:kernel/1 35019 0
            rex <0.12.0> rpc:init/1 36 0
            standard_error <0.21.0> erlang:apply/2 9 0
            standard_error_sup <0.20.0> supervisor_bridge:standar 41 0
            user <0.24.0> group:server/3 327 0
            user_drv <0.23.0> user_drv:server/2 1883 0
          • Registered ports on node nonode@nohost **
            Name Id Command
            ok
        Show
        Aram Karapetyan added a comment - Crypto can not start. 1> os:getenv(). ["ERL_LIBS=/opt/local/lib/couchdb/erlang/lib", "__CF_USER_TEXT_ENCODING=0x0:0:0","HOME=/var/root", "SHLVL=1","PROGNAME=erl","PWD=/", "PATH=/opt/local/lib/erlang/erts-5.8.2/bin:/opt/local/lib/erlang/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin", "ROOTDIR=/opt/local/lib/erlang","USER=root", "BINDIR=/opt/local/lib/erlang/erts-5.8.2/bin", "SHELL=/bin/sh","TERM=xterm-color","EMU=beam"] 7> i(). Pid Initial Call Heap Reds Msgs Registered Current Function Stack <0.0.0> otp_ring0:start/2 1597 3470 0 init init:loop/1 2 <0.3.0> erlang:apply/2 2584 691017 0 erl_prim_loader erl_prim_loader:loop/3 6 <0.6.0> gen_event:init_it/6 987 1437 0 error_logger gen_event:fetch_msg/5 8 <0.7.0> erlang:apply/2 1597 19369 0 application_controlle gen_server:loop/6 7 <0.9.0> application_master:init/4 377 44 0 application_master:main_loop/2 6 <0.10.0> application_master:start_it/4 233 70 0 application_master:loop_it/4 5 <0.11.0> supervisor:kernel/1 4181 35019 0 kernel_sup gen_server:loop/6 9 <0.12.0> rpc:init/1 233 36 0 rex gen_server:loop/6 9 <0.13.0> global:init/1 233 50 0 global_name_server gen_server:loop/6 9 <0.14.0> erlang:apply/2 233 20 0 global:loop_the_locker/1 4 <0.15.0> erlang:apply/2 233 3 0 global:loop_the_registrar/0 2 <0.16.0> inet_db:init/1 233 236 0 inet_db gen_server:loop/6 9 <0.17.0> global_group:init/1 233 60 0 global_group gen_server:loop/6 9 <0.18.0> file_server:init/1 233 85 0 file_server_2 gen_server:loop/6 9 <0.19.0> erlang:apply/2 4181 128530 0 code_server code_server:loop/1 3 <0.20.0> supervisor_bridge:standard_error/ 233 41 0 standard_error_sup gen_server:loop/6 9 <0.21.0> erlang:apply/2 233 9 0 standard_error standard_error:server_loop/1 2 <0.22.0> supervisor_bridge:user_sup/1 610 89 0 gen_server:loop/6 9 <0.23.0> user_drv:server/2 1597 1357 0 user_drv user_drv:server_loop/5 8 <0.24.0> group:server/3 1597 327 0 user group:server_loop/3 4 <0.25.0> group:server/3 2584 12240 0 group:server_loop/3 4 <0.26.0> erlang:apply/2 2584 6221 0 shell:shell_rep/4 17 <0.27.0> kernel_config:init/1 233 268 0 gen_server:loop/6 9 <0.28.0> supervisor:kernel/1 233 60 0 kernel_safe_sup gen_server:loop/6 9 <0.38.0> erlang:apply/2 4181 14470 0 c:pinfo/1 50 Total 31453 914528 0 218 ok 2> couch:stop(). {error,{not_started,couch}} 3> crypto:stop(). exception error: undefined function crypto:stop/0 4> crypto:start(). exception error: undefined function crypto:start/0 5> 5> couch:start(). {error,{{app_would_not_start,crypto}, {couch_app,start, [normal, ["/opt/local/etc/couchdb/default.ini", "/opt/local/etc/couchdb/local.ini"]]} }} =INFO REPORT==== 19-Apr-2011::10:31:43 === application: couch exited: {{app_would_not_start,crypto}, {couch_app,start, [normal, ["/opt/local/etc/couchdb/default.ini", "/opt/local/etc/couchdb/local.ini"]]}} type: temporary 6> init:get_arguments(). [ {root,["/opt/local/lib/erlang"]} , {progname,["erl"]} , {home,["/var/root"]} , {sasl,["errlog_type","error"]} , {couch_ini,["/opt/local/etc/couchdb/default.ini", "/opt/local/etc/couchdb/local.ini"]} ] 9> regs(). Registered procs on node nonode@nohost ** Name Pid Initial Call Reds Msgs application_controlle <0.7.0> erlang:apply/2 19369 0 code_server <0.19.0> erlang:apply/2 130188 0 erl_prim_loader <0.3.0> erlang:apply/2 691017 0 error_logger <0.6.0> gen_event:init_it/6 1437 0 file_server_2 <0.18.0> file_server:init/1 85 0 global_group <0.17.0> global_group:init/1 60 0 global_name_server <0.13.0> global:init/1 50 0 inet_db <0.16.0> inet_db:init/1 236 0 init <0.0.0> otp_ring0:start/2 3470 0 kernel_safe_sup <0.28.0> supervisor:kernel/1 60 0 kernel_sup <0.11.0> supervisor:kernel/1 35019 0 rex <0.12.0> rpc:init/1 36 0 standard_error <0.21.0> erlang:apply/2 9 0 standard_error_sup <0.20.0> supervisor_bridge:standar 41 0 user <0.24.0> group:server/3 327 0 user_drv <0.23.0> user_drv:server/2 1883 0 Registered ports on node nonode@nohost ** Name Id Command ok
        Hide
        Dave Cottlehuber added a comment -

        Hi Aram,

        CouchDB requires erlang to be built with SSL, which in your case it is not. Erlang doesn't even get as far as starting couchdb hence no logs for us to see.

        I think this is how mac ports would do it:
        sudo port install erlang +ssl
        reinstall couchdb & you should be away again.

        & I'd suggest logging a bug with macports to get couchdb dependencies forced to use erlang+ssl as it doesn't seem to be in https://trac.macports.org/browser/trunk/dports/databases/couchdb/Portfile

        At this point I would suggest at least for erlang & couchdb you ditch macports and use homebrew. Your world will be a better place.

        A+
        Dave

        Show
        Dave Cottlehuber added a comment - Hi Aram, CouchDB requires erlang to be built with SSL, which in your case it is not. Erlang doesn't even get as far as starting couchdb hence no logs for us to see. I think this is how mac ports would do it: sudo port install erlang +ssl reinstall couchdb & you should be away again. & I'd suggest logging a bug with macports to get couchdb dependencies forced to use erlang+ssl as it doesn't seem to be in https://trac.macports.org/browser/trunk/dports/databases/couchdb/Portfile At this point I would suggest at least for erlang & couchdb you ditch macports and use homebrew. Your world will be a better place. A+ Dave
        Hide
        Dave Cottlehuber added a comment -

        And https://trac.macports.org/ticket/27686 explains why this issue has only arisen recently in macports. Another reason to use homebrew - http://github.com/mxcl/homebrew

        Show
        Dave Cottlehuber added a comment - And https://trac.macports.org/ticket/27686 explains why this issue has only arisen recently in macports. Another reason to use homebrew - http://github.com/mxcl/homebrew
        Hide
        Aram Karapetyan added a comment -

        Thank you very much guys.

        ------------------------------------------
        sudo port install erlang +ssl
        ------------------------------------------

        solved my problem

        Show
        Aram Karapetyan added a comment - Thank you very much guys. ------------------------------------------ sudo port install erlang +ssl ------------------------------------------ solved my problem
        Hide
        Aram Karapetyan added a comment -

        Should I close or resolve issue?

        Show
        Aram Karapetyan added a comment - Should I close or resolve issue?
        Hide
        Jan Lehnardt added a comment -

        Done

        Show
        Jan Lehnardt added a comment - Done

          People

          • Assignee:
            Unassigned
            Reporter:
            Aram Karapetyan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development