-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CouchDB 2.1 crashes when a mount point contains whitespace #732
Comments
Can you please provide which version of CouchDB you are using, your |
; CouchDB Configuration Settings ; Custom settings should be made in this file. They will override settings [couchdb] [couch_peruser] [chttpd] [httpd] ; Uncomment next line to set the configuration modification whitelist. Only [query_servers] [httpd_global_handlers] [couch_httpd_auth] [os_daemons] [daemons] [ssl] ; To enable Virtual Hosts in CouchDB, add a vhost = path directive. All requests to [update_notification] ; To create an admin account uncomment the '[admins]' section below and add a [cluster] [native_query_servers] [vendor] [log] [compactions] [replicator] |
Here is my temporarily workaround! abs_path(Path0) -> |
The ini doesn’t show the |
in fact, can you dump |
Dirs from default.ini: |
single node therefore no /_node/... |
77462 s006 S+ 153:01.58 /Users/obi458/devel/couchdb_latest/rel/dev1/couchdb/bin/../erts-8.3/bin/beam.smp -K true -A 16 -Bd -- -root /Users/obi458/devel/couchdb_latest/rel/dev1/couchdb/bin/.. -progname couchdb -- -home /Users/obi458 -- -boot /Users/obi458/devel/couchdb_latest/rel/dev1/couchdb/bin/../releases/2.1.0/couchdb -name couchdb1@127.0.0.1 -setcookie monster -kernel error_logger silent -sasl sasl_error_logger false -noshell -noinput -config /Users/obi458/devel/couchdb_latest/rel/dev1/couchdb/bin/../releases/2.1.0/sys.config |
I guess this is a race, race between get_disk_data() and free_space_rec(abs_path(Path), DiskData) cause |
Hint, just called: 18> os_mon:call(disksup, get_disk_data, infinity). |
You say "single node therefore no /_node" but that's not true. There is always a |
Can not find /_node/couchdb1@127.0.0.1/_config, what does it mean absolute relative path or something else, i don't know? |
OK, you mean http://... {"native_query_servers":{"erlang":"{couch_native_process, start_link, []}","query":"{mango_native_proc, start_link, []}"},"httpd_design_handlers":{"_compact":"{couch_mrview_http, handle_compact_req}","_info":"{couch_mrview_http, handle_info_req}","_list":"{couch_mrview_show, handle_view_list_req}","_rewrite":"{couch_httpd_rewrite, handle_rewrite_req}","_show":"{couch_mrview_show, handle_doc_show_req}","_update":"{couch_mrview_show, handle_doc_update_req}","_view":"{couch_mrview_http, handle_view_req}","_view_changes":"{couch_mrview_http, handle_view_changes_req}"},"uuids":{"algorithm":"sequential","max_count":"1000"},"cluster":{"n":"1","q":"8"},"cors":{"credentials":"false"},"chttpd":{"authentication_handlers":"{chttpd_auth, cookie_authentication_handler}, {chttpd_auth, default_authentication_handler},{couch_httpd_auth, proxy_authentication_handler}","backlog":"512","bind_address":"0.0.0.0","docroot":"./share/www","port":"5983","proxy_use_secret":"true","require_valid_user":"true","socket_options":"[{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]"},"httpd_global_handlers":{"/":"{couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>}","_active_tasks":"{couch_httpd_misc_handlers, handle_task_status_req}","_all_dbs":"{couch_httpd_misc_handlers, handle_all_dbs_req}","_config":"{couch_httpd_misc_handlers, handle_config_req}","_plugins":"{couch_plugins_httpd, handle_req}","_replicate":"{couch_replicator_httpd, handle_req}","_restart":"{couch_httpd_misc_handlers, handle_restart_req}","_session":"{couch_httpd_auth, handle_session_req}","_stats":"{couch_stats_httpd, handle_stats_req}","_system":"{chttpd_misc, handle_system_req}","_utils":"{couch_httpd_misc_handlers, handle_utils_dir_req, "./share/www"}","_uuids":"{couch_httpd_misc_handlers, handle_uuids_req}","favicon.ico":"{couch_httpd_misc_handlers, handle_favicon_req, "./share/www"}"},"attachments":{"compressible_types":"text/*, application/javascript, application/json, application/xml","compression_level":"8"},"admins":{"admin":"-pbkdf2-e2f272537f56b0254d1397e37425d73f94cd3979,7a54c5ca3cb97898aba94a4e689a4eaf,10"},"query_server_config":{"os_process_limit":"100","reduce_limit":"true"},"vendor":{"name":"The Apache Software Foundation"},"replicator":{"connection_timeout":"30000","http_connections":"20","interval":"60000","max_churn":"20","max_jobs":"500","max_replication_retry_count":"infinity","retries_per_request":"10","socket_options":"[{keepalive, true}, {nodelay, false}]","ssl_certificate_max_depth":"3","startup_jitter":"5000","verify_ssl_certificates":"false","worker_batch_size":"500","worker_processes":"4"},"ssl":{"port":"6984"},"log":{"level":"error","writer":"stderr"},"indexers":{"couch_mrview":"true"},"view_compaction":{"keyvalue_buffer_size":"2097152"},"query_servers":{"coffeescript":"./bin/couchjs ./share/server/main-coffee.js","javascript":"./bin/couchjs ./share/server/main.js"},"features":{"scheduler":"true"},"daemons":{"auth_cache":"{couch_auth_cache, start_link, []}","compaction_daemon":"{couch_compaction_daemon, start_link, []}","couch_peruser":"{couch_peruser, start_link, []}","external_manager":"{couch_external_manager, start_link, []}","httpd":"{couch_httpd, start_link, []}","index_server":"{couch_index_server, start_link, []}","os_daemons":"{couch_os_daemons, start_link, []}","query_servers":"{couch_proc_manager, start_link, []}","uuids":"{couch_uuids, start, []}","vhosts":"{couch_httpd_vhost, start_link, []}"},"couch_peruser":{"delete_dbs":"false","enable":"false"},"httpd":{"allow_jsonp":"false","authentication_handlers":"{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler},{couch_httpd_auth, proxy_authentication_handler}","bind_address":"0.0.0.0","default_handler":"{couch_httpd_db, handle_request}","enable_cors":"false","enable_xframe_options":"false","max_http_request_size":"67108864","port":"5982","secure_rewrites":"true","socket_options":"[{recbuf, 262144}, {sndbuf, 262144}]","vhost_global_handlers":"_utils, _uuids, _session, _users"},"httpd_db_handlers":{"_all_docs":"{couch_mrview_http, handle_all_docs_req}","_changes":"{couch_httpd_db, handle_db_changes_req}","_compact":"{couch_httpd_db, handle_compact_req}","_design":"{couch_httpd_db, handle_design_req}","_design_docs":"{couch_mrview_http, handle_design_docs_req}","_local_docs":"{couch_mrview_http, handle_local_docs_req}","_temp_view":"{couch_mrview_http, handle_temp_view_req}","_view_cleanup":"{couch_mrview_http, handle_cleanup_req}"},"database_compaction":{"checkpoint_after":"5242880","doc_buffer_size":"524288"},"csp":{"enable":"true"},"couch_httpd_auth":{"allow_persistent_cookies":"false","auth_cache_size":"50","authentication_db":"_users","authentication_redirect":"/_utils/session.html","iterations":"10","proxy_use_secret":"true","require_valid_user":"true","secret":"59edb32b73e57cda6be862966548e535","timeout":"600"},"couchdb":{"attachment_stream_buffer_size":"4096","changes_doc_ids_optimization_threshold":"100","database_dir":"./data","default_security":"admin_local","delayed_commits":"false","file_compression":"snappy","max_dbs_open":"500","os_process_timeout":"5000","uuid":"039e269bb0d0bec878ad366eb24b37b1","view_index_dir":"./data"},"compactions":{"_default":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}]","bi_chat":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]","bi_client_info":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]","bi_data":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]","chat":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]","client":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]","data":"[{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "23:00"}, {to, "04:00"}]"},"compaction_daemon":{"check_interval":"300","min_file_size":"131072"}} |
maybe it’s the disk space monitor tripping up on volume paths with spaces in them? Do you get the error when the TM volume is not mounted? |
|
For those watching this issue, we have 2 workarounds right now:
We'll be looking at this issue in closer detail in the coming days. |
I may be having the same issue, as I'm on a Mac and use Time Machine (I also use Arq to backup to the cloud, which covers this directory). The issue I was having was my CouchDB would randomly start spitting errors over and over that look like this: https://gist.github.com/SCdF/9994ca2afdc727bd39270eaa97abe422
The only way I could find to fix it was basically delete all shard data and re-configure CouchDB. |
Though if we think it's because of devices mounted with spaces in them, then while I don't have that problem with Time Machine, I do have the Recovery HD mounted by default for some reason:
|
Ejecting Recovery HD has tentatively fixed the problem for me. I'll report back if that changes. Is there a reason CouchDB checks for disk space on mounts other than the one it's on? |
I ran into a similar issue recently which turned out to be caused by https://bugs.erlang.org/browse/ERL-343. |
I ran also into this same problem. I downloaded CouchDB 2.1.0 (2017-08-07) for Mac from the CouchDB Website. My Time Machine is also every 1 hour active for doing the backups ... in this time the CouchDB is not available and crashes. [error] 2017-09-07T10:08:59.894213Z couchdb@localhost emulator -------- Error in process <0.2586.0> on node 'couchdb@localhost' with exit value: {{badmatch,{error,enoent}},[{couch_compaction_daemon,abs_path,1,[{file,"src/couch_compaction_daemon.erl"},{line,526}]},{couch_compaction_daemon,free_space_rec,2,[{file,"src/couch_compaction_daemon.erl"},{line,517}]},{couch_compaction_daemon... |
If the compaction daemon cannot calculate the free space for a volume, do not crash CouchDB. Instead, log a warning that free space could not be calculated and continue. Compaction of the database is not necessarily prevented - just that the disk space for this specific volume won't be taken into account when deciding whether to automatically compact or not. This is primarily to cope with edge cases arising from ERL-343, whereby disksup:get_disk_data() returns invalid paths for volumes containing whitespace. Fixes #732
When will this issue be fixed? |
@kinesias The issue is fixed, on 11 Sep. There just hasn't been a CouchDB release yet that includes this fix. I gave you a workaround for now in the other ticket you commented on. Spamming our issue tracker actually makes the release process take longer. Please be patient. |
Did this issue exist in 2.0.0.1? I am seeing the same problem when running CouchDB 2.0.0.1 in a native Windows Docker container with the data directory mounted as a volume into the container. |
@drnybble It's a bug in Erlang 19 (will be fixed in Erlang 21) and any CouchDB version prior to 2.1.1 will be susceptible, I think. The fix is to use Erlang 18 or disable the compaction daemon. |
@willholley Hmmm, seems that the Windows build of CouchDB is using Erlang 18, so perhaps this is a different problem. |
You are probably the only person on the planet brave enough to be running Windows as your host OS and Windows as the guest OS for a CouchDB Docker container. This is an unsupported configuration for us, but if you can work out what's wrong, good luck. |
Sadly updating to 2.1.1 did not fix the issue on Windows.
|
As stated in the Windows installer, you must install CouchDB to a path with no spaces and use no spaces in your data directory. We don't have any workaround for this problem at this time. |
I don't believe this problem is related to spaces with paths -- I don't see any spaces. |
@drnybble Please open a new issue instead of hijacking this one. |
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"!!!!!:
and gives:
The text was updated successfully, but these errors were encountered: