You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2017/11/14 11:21:15 UTC
[GitHub] dch opened a new issue #991: windows fails to run if installed to a path with spaces in it
dch opened a new issue #991: windows fails to run if installed to a path with spaces in it
URL: https://github.com/apache/couchdb/issues/991
If CouchDB is installed to a path with spaces, and on a windows system that doesn't have the 8.3 NTFS filename mapping registry flag set (possibly the default now on newer windows releases than what I have available), then the following pretty stack trace comes up whenever `couchjs` is summoned:
```erl
{{badmatch, {error, {enoent, [{erlang,open_port, [{spawn, "c:/Program Files (x86)/Apache Software Foundation/CouchDB/lib/couch-1.7.1/priv/couchspawnkillable ./couchjs.exe ../share/couchdb/server/main.js"}, [stream,{line,4096},binary,exit_status,hide]], []}, {couch_os_process,init,1, [{file, "c:/cygwin/relax/apache-couchdb-1.7.1/src/couchdb/couch_os_process.erl"}, {line,148}]}, {gen_server,init_it,6,[{file,"gen_server.erl"},{line,306}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,237}]}]}}}, [{couch_query_servers,new_process,3, [{file, "c:/cygwin/relax/apache-couchdb-1.7.1/src/couchdb/couch_query_servers.erl"}, {line,477}]}, {couch_query_servers,lang_proc,3, [{file, "c:/cygwin/relax/apache-couchdb-1.7.1/src/couchdb/couch_query_servers.erl"}, {line,462}]}, {couch_query_servers,handle_call,3, [{file, "c:/cygwin/relax/apache-couchdb-1.7.1/src/couchdb/couch_query_servers.erl"}, {line,334}]}, {gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]}, {gen_server
,handle_msg,5,[{file,"gen_server.erl"},{line,639}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}
```
This is because we use an absolute path to `couchspawnkillable.exe` in 2 places:
```erl
start_port(Command, EnvPairs) ->
PrivDir = couch_util:priv_dir(),
Spawnkiller = filename:join(PrivDir, "couchspawnkillable"),
```
- https://github.com/apache/couchdb/blob/1.7.x/src/couchdb/couch_os_daemons.erl#L200
- https://github.com/apache/couchdb/blob/1.7.x/src/couchdb/couch_os_process.erl#L145
There are a few solutions to this; but the simplest one is to change https://github.com/apache/couchdb/blob/1.7.x/src/couchdb/couch_util.erl#L60 to use `os:type/0` and return a regex munged relative path instead. Given that this code branch will only be used on Windows, nobody is taking a performance hit that they didn't already sign up to ;-).
Another alternative is to deny our OTP-ness and move `couchspawnkillable.exe` during https://github.com/apache/couchdb/blob/1.7.x/src/couchdb/priv/Makefile.am#L136-L137 into `./bin/` as we already do with `couchjs.exe`, and then invoke `couchspawnkillable.exe` without any path at all.
I'm cool with either, if somebody feels like picking one option and implementing it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services