Megidd
Megidd

Reputation: 7989

Failed to write to URI file /var/run/couchdb/couch.uri: no such file or directory

I receive the following error when I intend to start couchdb with command sudo couchdb start:

me@linux-box:~> sudo couchdb start
Apache CouchDB 1.6.1 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [<0.33.0>] Apache CouchDB has started on http://0.0.0.0:5984/
[error] [<0.33.0>] Failed to write to URI file /var/run/couchdb/couch.uri: no such file or directory
[error] [<0.32.0>] {error_report,<0.32.0>,
                    {<0.32.0>,crash_report,
                     [[{initial_call,
                        {application_master,init,
                         ['Argument__1','Argument__2','Argument__3',
                          'Argument__4']}},
                       {pid,<0.32.0>},
                       {registered_name,[]},
                       {error_info,
                        {exit,
                         {enoent,
                          {couch_app,start,
                           [normal,
                            ["/etc/couchdb/default.ini",
                             "/etc/couchdb/local.ini"]]}},
                         [{application_master,init,4,
                           [{file,"application_master.erl"},{line,134}]},
                          {proc_lib,init_p_do_apply,3,
                           [{file,"proc_lib.erl"},{line,240}]}]}},
                       {ancestors,[<0.31.0>]},
                       {messages,[{'EXIT',<0.33.0>,normal}]},
                       {links,[<0.31.0>,<0.7.0>]},
                       {dictionary,[]},
                       {trap_exit,true},
                       {status,running},
                       {heap_size,987},
                       {stack_size,27},
                       {reductions,153}],
                      []]}}
{"init terminating in do_boot",{{badmatch,{error,{enoent,{couch_app,start,[normal,["/etc/couchdb/default.ini","/etc/couchdb/local.ini"]]}}}},[{couch,start,0,[{file,"couch.erl"},{line,18}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
init terminating in do_boot ()

Then I have to run the following commands manually to resolved the error:

me@linux-box:~> sudo mkdir /var/run/couchdb
me@linux-box:~> sudo chown -R couchdb:couchdb /var/run/couchdb/
me@linux-box:~> sudo couchdb start

Now I wonder how I can resolve the error permanently. I feel like I might have to modify configurations of couchdb, but I'm not sure how. Thanks.

Upvotes: 3

Views: 786

Answers (1)

kawakaze
kawakaze

Reputation: 96

I stuck it in ~/.bashrc (except for the sudo couchdb start bit).

A bit heavy handed, but works anyways.

Upvotes: 1

Related Questions