Repository: apache/couchdb

Issue #732: CouchDB 2.1 crashes when a mount point contains whitespace
Created: 2017-08-01T08:46:00Z
When time machine runs on the couchdb data folder the compaction failed and couchdb shutdown:
I added couch_log to see why, this gives me the path "/Volumes/Time"!!!!!:
abs_path(Path0) ->
    couch_log:debug("-------------------- abs_path ~p", [Path0]),
    {ok, Info} = file:read_link_info(Path0),
    case Info#file_info.type of
        symlink ->
            {ok, Path} = file:read_link(Path0),
            abs_path(Path);
        _ ->
            abs_path2(Path0)
    end.

and gives:
[debug] 2017-08-01T08:24:39.917976Z couchdb@localhost <0.2442.0> -------- Supervisor couch_secondary_services started couch_compaction_daemon:start_link() at pid <0.2682.0>
[debug] 2017-08-01T08:24:39.926015Z couchdb@localhost <0.2684.0> -------- Fragmentation for database `_dbs` is 0%, estimated space for compaction is 28864 bytes.
[debug] 2017-08-01T08:24:39.926312Z couchdb@localhost <0.2684.0> -------- Fragmentation for database `_nodes` is 0%, estimated space for compaction is 8372 bytes.
[debug] 2017-08-01T08:24:39.926747Z couchdb@localhost <0.2684.0> -------- Fragmentation for database `_replicator` is 0%, estimated space for compaction is 8378 bytes.
[debug] 2017-08-01T08:24:39.927227Z couchdb@localhost <0.2684.0> -------- Fragmentation for view group `_replicator` (database `_replicator`) is 0%, estimated space for compaction is 51 bytes.
[debug] 2017-08-01T08:24:39.927522Z couchdb@localhost <0.2684.0> -------- Fragmentation for database `_users` is 0%, estimated space for compaction is 8378 bytes.
[debug] 2017-08-01T08:24:39.927944Z couchdb@localhost <0.2684.0> -------- Fragmentation for view group `_auth` (database `_users`) is 0%, estimated space for compaction is 51 bytes.
[debug] 2017-08-01T08:24:39.928793Z couchdb@localhost <0.2684.0> -------- Fragmentation for database `shards/00000000-1fffffff/_global_changes.1501572189` is 98%, estimated space for compaction is 13246 bytes.
[debug] 2017-08-01T08:24:39.928851Z couchdb@localhost <0.2684.0> -------- -------------------- abs_path "./data"
[debug] 2017-08-01T08:24:39.928991Z couchdb@localhost <0.2684.0> -------- -------------------- abs_path "/Volumes/Time"
[error] 2017-08-01T08:24:39.929252Z couchdb@localhost emulator -------- Error in process <0.2684.0> on node couchdb@localhost with exit value:
{{badmatch,{error,enoent}},[{couch_compaction_daemon,abs_path,1,[{file,"src/couch_compaction_daemon.erl"},{line,527}]},{couch_compaction_daemon,free_space_rec,2,[{file,"src/couch_compaction_daemon.erl"},{line,517}]},{couch_compaction_daemon,can_db_compact,2,[{file,"src/couch_compaction_daemon.erl"},{line,327}]},{couch_compaction_daemon,maybe_compact_db,3,[{file,"src/couch_compaction_daemon.erl"},{line,164}]},{couch_compaction_daemon,'-compact_loop/1-fun-0-',3,[{file,"src/couch_compaction_daemon.erl"},{line,141}]},{couch_server,'-all_databases/2-fun-0-',4,[{file,"src/couch_server.erl"},{line,273}]},{filelib,do_fold_files2,8,[{file,"filelib.erl"},{line,185}]},{filelib,do_fold_files2,8,[{file,"filelib.erl"},{line,195}]}]}

Duplicate issue #802: CouchDB 2.1 (compaction-daemon) crashes on specific database or documents
Created: 2017-09-11T08:17:52Z
After updating to CouchDB 2.1 from 2.0 CouchDB keeps crashing. Starting without databases worked. I decided to import the old data per database and not use the data-directory of 2.0. This worked and I assumed there was some format inconsistency.
But now I created a new database (named nwst-crm-dev-backup) which contains 283 documents now. All like:
{ "_id": "activity_10006", "_rev": "1-43fc3d3f930dd313dbb26c197249da4b", "type": "activity", "body": "Description... ", "companyId": "company_203", "userId": "user_1", "subtype": "meeting" }
And CouchDB keeps crashing and restarting.
It could be that the bug is data-related as I tried to replace the documents with placeholder-strings (so that I could send the database here), but then the crash doesn't seems to happen. I tried to find out which kind of data this could be, without luck.
Deleting the database prevents CouchDB from crashing. Also disabling the compaction_deamon keeps CouchDB running.
I am running MacOS Sierra 10.12.4. The disk has enough free space (221 GB) and TimeMachine is switched off.
Location of databases: /Volumes/SD/DBs/CouchDB2
Maybe it's related to #732, but because the cause of that bug seems to be related to TimeMachine I decided to file a new issue.
Systemlog: https://friendpaste.com/1v8h7GF5gXqyPt6168oa7J

Closing comment (2017-09-29T06:34:50Z): Duplicate of #732.