couchbase / docker

Dockerfiles and configuration scripts for the Docker Hub Official Couchbase images
143 stars 154 forks source link

Views error ({badmatch,{error,ebusy}}) #140

Closed micopiira closed 4 years ago

micopiira commented 4 years ago

I'm trying to run couchbase on docker (Windows 10 host) with:

docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 -v /d/couchbase:/opt/couchbase/var couchbase

When I try to create a view I get error:

from: http://172.17.0.2:8092/yksa/_design/dev_test/_view/test?limit=6&stale=false&connection_timeout=60000&inclusive_end=true&skip=0&full_set=;
reason: {badmatch,{error,ebusy}} ([{couch_set_view_group,handle_info,2, [{file,"/home/couchbase/jenkins/workspace/couchbase-server-unix/couchdb/src/couch_set_view/src/couch_set_view_group.erl"}, {line,1223}]}, {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,604}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}])

Without -v it works. A permission problem of some kind? What should I try?

Related to #47 ?

ceejatec commented 4 years ago

I'm not sure about the cause here - at a wild guess, when you create a view, two different Couchbase processes are attempting to open the same logfile at the same time, and on a Windows filesystem that would fail. It's possible the Windows version of Couchbase operates differently to work around that issue, but since you're effectively running the Linux version of Couchbase on a Windows filesystem here, things may not work right.

I will ask around to see if anyone has any ideas about a cause. If you could attach a more complete logfile that would be great. Maybe you could even "docker exec" into the container and run "cbcollect_info /opt/couchbase/var/logfiles.zip", and attach that zip.

Just to set expectations, though, this isn't any kind of supported environment, and I don't expect there will be much dev effort available to spend on reproducing or fixing this issue if it only occurs in Docker on Windows.

micopiira commented 4 years ago

Heres the logfiles

logfiles.zip

ceejatec commented 4 years ago

Thank you for the log, it was quite helpful. I spoke to a lead developer and he discovered the underlying cause. My guess was basically correct: There's a situation which the Windows version of Couchbase Server works around. However, the Docker image is the Linux version of the product, which doesn't have that workaround as it doesn't expect to be running on a Windows filesystem.

It would be possible to enable the workaround on all platforms, possibly selected by a couchdb.ini flag. Not sure of the risk or priority of making that fix, but I have filed a product ticket: https://issues.couchbase.com/browse/MB-37452

I'm going to close this GitHub issue in preference to that Jira ticket. Thank you for the report and debugging information!