CouchDB installs fine for everything except execut

2019-05-04 00:21发布

问题:

  • Did a fresh install of Apache CouchDB on Windows 7 x64, using setup-couchdb-1.4.0_R16B01.exe

  • Can access futon without any problem

  • Can programmatically create databases and add documents (including views)

  • Get the error pasted below when executing a view (even when executing the simplest default non-edited temporary map-reduce in Futon

    "map": "function(doc){ emit(null, doc); }"

    (in which case the same exact error text is shown in a browser pop-up)

Does this error make sense to anyone? Where should I start my investigation?

Notes:

  1. The path c:/cygwin/relax/APACHE~1.0/src/couchdb/ does not exist on my machine...
  2. I already tried to uninstall version 1.4.0 and replace it with 1.3.0 and even the older 1.2.0, but the same issue occurs always.

Error Message:

{"error":"EXIT",
 "reason":"{{badmatch,\n
            {error,\n
            {enoent,\n
            [{erlang,open_port,\n
                [{spawn,\n
                     \"c:/Program Files (x86)/Apache Software Foundation/CouchDB/lib/couch-1.4.0/priv/couchspawnkillable ./couchjs.exe ../share/couchdb/server/main.js\"},\n
                 [stream,{line,4096},binary,exit_status,hide]],\n
                []},\n
            {couch_os_process,init,1,\n
                [{file,\n
                     \"c:/cygwin/relax/APACHE~1.0/src/couchdb/couch_os_process.erl\"},\n
                 {line,148}]},\n
            {gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,304}]},\n
            {proc_lib,init_p_do_apply,3,\n
                [{file,\"proc_lib.erl\"},{line,239}]}]}}},\n
 [{couch_query_servers,new_process,3,\n
      [{file,\"c:/cygwin/relax/APACHE~1.0/src/couchdb/couch_query_servers.erl\"},\n
       {line,477}]},\n
  {couch_query_servers,lang_proc,3,\n
      [{file,\"c:/cygwin/relax/APACHE~1.0/src/couchdb/couch_query_servers.erl\"},\n
        {line,462}]},\n
  {couch_query_servers,handle_call,3,\n
      [{file,\"c:/cygwin/relax/APACHE~1.0/src/couchdb/couch_query_servers.erl\"},\n
       {line,334}]},\n  {gen_server,handle_msg,5,[{file,\"gen_server.erl\"},{line,585}]},\n
  {proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}"}

回答1:

What is the result of running http://localhost:5984/_utils/verify_install.html ?

This error usually happens when people install to a filesystem with ntfs 8.3 filename mangling disabled. Various "tune-up" and performance tools do this for you without understanding the consequences.

Easiest fix is to install to a directory without spaces, e.g. c:\couchdb.

The weird c:\cygwin... lines come up because when CouchDB is built & compiled, error messages are returned with filenames and line numbers present, relative to the build directory, not your future install directory.

Also, the couchdb mailing list is the best place to ask for support (I read it :-).



回答2:

The noent error implies that a file is missing. Check to see if this file exists:

c:/Program Files (x86)/Apache Software Foundation/CouchDB/lib/couch-1.4.0/priv/couchspawnkillable

The install may be failing on your setup for some reason.



回答3:

This is an issue with Erlang rather then CouchDB.

Erlang (bundle with CouchDB) is still using the 8.3 short filename format (possibly due to backward compatibility), but in newer version of Windows, the 8.3 name generation is disabled by default [read more here].

I would not recommend to enable the 8.3 filename to fix this (though it could), but rather install CouchDB directly under C:\<foldername> (without any spaces in the folder name).