Opened 14 years ago

Closed 13 years ago

#25375 closed defect (fixed)

couchdb missing default.d local.d

Reported by: daniel.terreros@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: daniel.terreros@…, daniel@…, sewebster@…, bradley.holt@…
Port: couchdb

Description

Using OSX 10.6.4 both dmg package and from source on clean install. get a curl(7) and

sudo -u couchdb couchdb

yields this

$ sudo -u couchdb couchdb
find: /opt/local/etc/couchdb/default.d: No such file or directory
find: /opt/local/etc/couchdb/local.d: No such file or directory

=CRASH REPORT==== 21-Jun-2010::23:40:52 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.29.0>
    registered_name: []
    exception exit: {{app_would_not_start,ssl},
                     {couch_app,start,
                                [normal,
                                 ["/opt/local/etc/couchdb/default.ini",
                                  "/opt/local/etc/couchdb/local.ini"]]}}
      in function  application_master:init/4
    ancestors: [<0.28.0>]
    messages: [{'EXIT',<0.30.0>,normal}]
    links: [<0.28.0>,<0.6.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 24
    reductions: 161
  neighbours:

=INFO REPORT==== 21-Jun-2010::23:40:52 ===
    application: couch
    exited: {{app_would_not_start,ssl},
             {couch_app,start,
                        [normal,
                         ["/opt/local/etc/couchdb/default.ini",
                          "/opt/local/etc/couchdb/local.ini"]]}}
    type: temporary

Change History (13)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to jwa@…
Port: couchdb added

Please remember to fill in the Port field and cc the maintainer.

comment:2 Changed 14 years ago by daniel.terreros@…

Cc: daniel.terreros@… added

Cc Me!

comment:3 Changed 14 years ago by daniel@…

Cc: daniel@… added

Cc Me!

comment:4 Changed 14 years ago by luke.driscoll@…

I don't believe that the problem is the missing directories, it is because of the new erlang. The bug is fixed in Couchdb 0.12 (not yet released): https://issues.apache.org/jira/browse/COUCHDB-805. Can we get a backport into macports?

comment:5 Changed 14 years ago by daniel.terreros@…

Rolled back erlang to R13B04 and tried again this is what happened. Long story short, still missing the default.d

find: /opt/local/etc/couchdb/default.d: No such file or directory
find: /opt/local/etc/couchdb/local.d: No such file or directory
Apache CouchDB 0.11.0 (LogLevel=info) is starting.
[error] [<0.19.0>] Loading of /opt/local/lib/couchdb/erlang/lib/couch-0.11.0/ebin/couch_stats_collector.beam failed: badfile
=ERROR REPORT==== 25-Jun-2010::16:11:13 ===
Loading of /opt/local/lib/couchdb/erlang/lib/couch-0.11.0/ebin/couch_stats_collector.beam failed: badfile
[error] [emulator] beam/beam_load.c(1317): Error loading module couch_stats_collector:
  use of opcode 151; this emulator supports only up to 149
=ERROR REPORT==== 25-Jun-2010::16:11:13 ===
beam/beam_load.c(1317): Error loading module couch_stats_collector:
  use of opcode 151; this emulator supports only up to 149

[error] [<0.84.0>] {error_report,<0.30.0>,
    {<0.84.0>,supervisor_report,
     [{supervisor,{local,couch_secondary_services}},
      {errorContext,start_error},
      {reason,
          {'EXIT',
              {undef,
                  [{couch_stats_collector,start,[]},
                   {supervisor,do_start_child,2},
                   {supervisor,start_children,3},
                   {supervisor,init_children,2},
                   {gen_server,init_it,6},
                   {proc_lib,init_p_do_apply,3}]}}},
      {offender,
          [{pid,undefined},
           {name,stats_collector},
           {mfa,{couch_stats_collector,start,[]}},
           {restart_type,permanent},
           {shutdown,brutal_kill},
           {child_type,worker}]}]}}
=SUPERVISOR REPORT==== 25-Jun-2010::16:11:13 ===
     Supervisor: {local,couch_secondary_services}
     Context:    start_error
     Reason:     {'EXIT',{undef,[{couch_stats_collector,start,[]},
                                 {supervisor,do_start_child,2},
                                 {supervisor,start_children,3},
                                 {supervisor,init_children,2},
                                 {gen_server,init_it,6},
                                 {proc_lib,init_p_do_apply,3}]}}
     Offender:   [{pid,undefined},
                  {name,stats_collector},
                  {mfa,{couch_stats_collector,start,[]}},
                  {restart_type,permanent},
                  {shutdown,brutal_kill},
                  {child_type,worker}]

[error] [<0.76.0>] {error_report,<0.30.0>,
    {<0.76.0>,supervisor_report,
     [{supervisor,{local,couch_server_sup}},
      {errorContext,start_error},
      {reason,shutdown},
      {offender,
          [{pid,undefined},
           {name,couch_secondary_services},
           {mfa,{couch_server_sup,start_secondary_services,[]}},
           {restart_type,permanent},
           {shutdown,infinity},
           {child_type,supervisor}]}]}}
=SUPERVISOR REPORT==== 25-Jun-2010::16:11:13 ===
     Supervisor: {local,couch_server_sup}
     Context:    start_error
     Reason:     shutdown
     Offender:   [{pid,undefined},
                  {name,couch_secondary_services},
                  {mfa,{couch_server_sup,start_secondary_services,[]}},
                  {restart_type,permanent},
                  {shutdown,infinity},
                  {child_type,supervisor}]
=CRASH REPORT==== 25-Jun-2010::16:11:13 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.30.0>
    registered_name: []
    exception exit: {bad_return,
                        {{couch_app,start,
                             [normal,
                              ["/opt/local/etc/couchdb/default.ini",
                               "/opt/local/etc/couchdb/local.ini"]]},
                         {'EXIT',
                             {{badmatch,{error,shutdown}},
                              [{couch_server_sup,start_server,1},
                               {application_master,start_it_old,4}]}}}}
      in function  application_master:init/4
    ancestors: [<0.29.0>]
    messages: [{'EXIT',<0.31.0>,normal}]
    links: [<0.29.0>,<0.6.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 24
    reductions: 161
  neighbours:
=INFO REPORT==== 25-Jun-2010::16:11:13 ===
    application: couch
    exited: {bad_return,{{couch_app,start,
                                    [normal,
                                     ["/opt/local/etc/couchdb/default.ini",
                                      "/opt/local/etc/couchdb/local.ini"]]},
                         {'EXIT',{{badmatch,{error,shutdown}},
                                  [{couch_server_sup,start_server,1},
                                   {application_master,start_it_old,4}]}}}}
    type: temporary

comment:6 Changed 14 years ago by sewebster@…

Cc: sewebster@… added

Cc Me!

comment:7 Changed 14 years ago by sewebster@…

FYI you don't need to cc yourself (it will email you as the reporter) and you should use WikiFormatting for your pasted output.

I don't think the default.d thing is your problem, it makes it past that... look at the next line. It says:

Loading of /opt/local/lib/couchdb/erlang/lib/couch-0.11.0/ebin/couch_stats_collector.beam failed: badfile

and then goes on to complain about that.

Did you ever have a working erlang + couchdb install? What were the versions of the two packages? Can you try those versions again and see if it works, and then if so, upgrade "one at a time" to figure out where the problem is?

comment:8 Changed 14 years ago by oree@…

I had the same issue with couchdb @0.11.0 and erlang @R14A

The patch pointed out by luke.driscoll helped me out (https://issues.apache.org/jira/secure/attachment/12447524/couch_app.patch)

To build manually, copy the diff file to ${portpath}/files/patch-src-couchdb-couch_app.erl.diff and apply the following to Portfile:

--- Portfile.orig	2010-04-10 23:30:00.000000000 +0300
+++ Portfile	2010-06-29 23:04:38.000000000 +0300
@@ -41,6 +41,8 @@
 set plistdir /Library/LaunchDaemons
 startupitem.uniquename org.apache.couchdb
 
+patchfiles	patch-src-couchdb-couch_app.erl.diff
+
 post-destroot {
     addgroup ${dbgroup}
     adduser ${dbuser} gid=[existsgroup ${dbgroup}]

Now couchdb works again!

comment:9 Changed 14 years ago by daniel.terreros@…

[After the fix its still missing default.d]

So for anyone who comes here from now on here is the step by step in pure rookie terms to get couchdb up and running (assuming you are using the default set up in your config file using "rsync.macports.org')

Follow this file path to where you need to make your changes

 /opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/couchdb

Open the Portfile and add one line of code

patchfiles	patch-src-couchdb-couch_app.erl.diff

create a new file called "files" (no quotation marks)

in the "files" folder create a file named "patch-src-couchdb-couch_app.erl.diff" which contains this code:

Index: src/couchdb/couch_app.erl
===================================================================
--- src/couchdb/couch_app.erl	(revision 955834)
+++ src/couchdb/couch_app.erl	(working copy)
@@ -20,7 +20,7 @@
 
 start(_Type, DefaultIniFiles) ->
     IniFiles = get_ini_files(DefaultIniFiles),
-    case start_apps([crypto, sasl, inets, oauth, ssl, ibrowse, mochiweb]) of
+    case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, mochiweb]) of
     ok ->
         couch_server_sup:start_link(IniFiles);
     {error, Reason} ->

then

sudo port install couchdb

And it is time to relax

[final portfile should look something like this]

# $Id$

PortSystem 1.0

name		couchdb
version		0.11.0

categories	databases
platforms	darwin

description	CouchDB is a document database server
maintainers	jwa
long_description  ${description} with a restful HTTP API, capable of \
	storing arbitrary JSON documents, building powerful data views, \
	defined in JavaScript, and processed in parallel using Map/Reduce. \
	It leaves out SQL and transactions for simplicity's sake, to \
	improve scalability and to relax users' lives.

homepage	http://couchdb.apache.org/
master_sites	apache
master_sites.mirror_subdir	${name}/${version}/
distname	apache-${name}-${version}

checksums           md5     c1784e3850da01dc37dad20c5b1a85f8 \
                    sha1    b5b84e1d8a082960df09df7e4eda664b5e6c59d7 \
                    rmd160  cd52e0f41a67b1cba9792e2ac11c74cad5c6a1a9

depends_lib	port:automake \
    port:autoconf \
    port:libtool \
    port:help2man \
    port:icu \
    port:spidermonkey \
    port:curl \
    port:erlang

set dbgroup couchdb
set dbuser couchdb
set logdir ${prefix}/var/log/couchdb
set dbdir ${prefix}/var/lib/couchdb
set plistdir /Library/LaunchDaemons
startupitem.uniquename org.apache.couchdb




post-destroot {
    addgroup ${dbgroup}
    adduser ${dbuser} gid=[existsgroup ${dbgroup}]
    xinstall -m 755 -o ${dbuser} -g ${dbgroup} -d \
	${destroot}${dbdir} \
	${destroot}${logdir} \
	${destroot}${plistdir}
    destroot.keepdirs-append \
        ${destroot}${dbdir} \
        ${destroot}${logdir}
    set plist org.apache.couchdb.plist
    system "cd ${destroot}/Library/LaunchDaemons && ln -sf ${prefix}/Library/LaunchDaemons/${plist}"
# the following patches can be removed after next version
    reinplace "s;`/opt/local/bin/icu-config --invoke`;;" ${destroot}/${prefix}/bin/couchdb
    reinplace "s;^.*DYLD_LIBRARY_PATH.*$;;g" ${destroot}/${prefix}/Library/LaunchDaemons/org.apache.couchdb.plist
}

patchfiles	patch-src-couchdb-couch_app.erl.diff

post-activate {
    ui_msg "########################################################################"
    ui_msg "# Changes in CouchDB 0.10.0 make 0.9.1 database files incompatible."
    ui_msg "# See http://wiki.apache.org/couchdb/BreakingChanges for details"
    ui_msg "#"
    ui_msg "# Run the following command to install the CouchDB launchd"
    ui_msg "# startup item in order to start and re-start service automatically:"
    ui_msg "#"
    ui_msg "# sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist"
    ui_msg "########################################################################"
}

livecheck.type	regex
livecheck.url	http://couchdb.apache.org/downloads.html
livecheck.regex	apache-${name}-(0.\[0-9\]+.\[0-9\])

comment:10 in reply to:  9 ; Changed 14 years ago by john.ragan@…

Replying to daniel.terreros@…:

I'm kind of new at MacPorts, but I followed all these steps with no change in behavior. The file name is exact (/opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/couchdb/files/patch-src-couchdb-couch_app.erl.diff), copied the diff from above directly to it, put the command (patchfiles patch-src-couchdb-couch_app.erl.diff) above the post-activate in Portfile.

After running 'sudo port install couchdb', it does not seem to really do anything other than:

--->  Computing dependencies for couchdb
--->  Cleaning couchdb

Is there something basic I am missing?

comment:11 in reply to:  10 Changed 14 years ago by celehner1@…

Try this after doing the patch:

sudo port uninstall couchdb
sudo port install couchdb

Replying to john.ragan@…:

Replying to daniel.terreros@…:

I'm kind of new at MacPorts, but I followed all these steps with no change in behavior. The file name is exact (/opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/couchdb/files/patch-src-couchdb-couch_app.erl.diff), copied the diff from above directly to it, put the command (patchfiles patch-src-couchdb-couch_app.erl.diff) above the post-activate in Portfile.

After running 'sudo port install couchdb', it does not seem to really do anything other than:

--->  Computing dependencies for couchdb
--->  Cleaning couchdb

Is there something basic I am missing?

comment:12 Changed 14 years ago by bradley.holt@…

Cc: bradley.holt@… added

Cc Me!

comment:13 Changed 13 years ago by jyrkiwahlstedt

Resolution: fixed
Status: newclosed

Now couchdb is at 1.0.2, and at least I don't see any problem executing the original command, I'll reopen this, if necessary...

Note: See TracTickets for help on using tickets.