Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The couchbase client for C.

CCBC-368: Bail on bootstrap when the bucket is potentially missing

This will abort the current provider iteration on the list of hosts if
an authentication or HTTP 404 error is encountered _AND_ there is no
prior configuration

Change-Id: Ic2d4c9d0c4d9fb6045583dd6ed05eb273e876f7f
Reviewed-by: Sergey Avseyev <>
Tested-by: Sergey Avseyev <>
latest commit 41967f12c0
M. Nunberg mnunberg authored April 17, 2014
Octocat-spinner-32 cmake cmake/configure: Provide better proxy Makefile April 08, 2014
Octocat-spinner-32 config CCBC-69: Use autoreconf instead of invoking each tool myself May 28, 2012
Octocat-spinner-32 contrib Optimize libvbucket populate_bucket. March 26, 2014
Octocat-spinner-32 debug Update meta data for release 2.0.3 February 06, 2013
Octocat-spinner-32 example Add simple tool for putting load on views November 04, 2013
Octocat-spinner-32 include Documentation additions April 01, 2014
Octocat-spinner-32 m4 Add --enable-maintainer-mode October 25, 2013
Octocat-spinner-32 man Documentation additions April 01, 2014
Octocat-spinner-32 packaging Update packaging metadata for 2.3.0 GA April 09, 2014
Octocat-spinner-32 plugins UV: Set error status on connect failure February 10, 2014
Octocat-spinner-32 src CCBC-368: Bail on bootstrap when the bucket is potentially missing April 17, 2014
Octocat-spinner-32 tests Set line buffering (helps for windows) on tests April 08, 2014
Octocat-spinner-32 tools fix typo in tools/CMakeLists April 08, 2014
Octocat-spinner-32 win32 Remove NMakefile. CMake is now the build system for Windows February 08, 2014
Octocat-spinner-32 .gitignore Add simple tool for putting load on views November 04, 2013
Octocat-spinner-32 .travis.yml [travis] Output tests results after the build August 21, 2013
Octocat-spinner-32 AUTHORS Update AUTHORS September 11, 2013
Octocat-spinner-32 CMakeLists.txt cmake: fix mock URL February 25, 2014
Octocat-spinner-32 Added November 12, 2012
Octocat-spinner-32 LICENSE Rename license file and add it to distribution December 06, 2011
Octocat-spinner-32 Restore DTrace functionality. March 26, 2014
Octocat-spinner-32 Include durablity man page into the dist August 08, 2013
Octocat-spinner-32 README.markdown Reformat README slightly to be 80 column friendly. March 03, 2014
Octocat-spinner-32 RELEASE_NOTES.markdown Update packaging metadata for 2.3.0 GA April 09, 2014
Octocat-spinner-32 Set variable names correctly January 28, 2014
Octocat-spinner-32 Update packaging metadata for 2.3.0 GA April 09, 2014

Couchbase C Client

Build Status

This is the C client library for Couchbase It communicates with the cluster and speaks the relevant protocols necessary to connect to the cluster and execute data operations.


  • Can function as either a synchronous or asynchronous library
  • Callback Oriented
  • Can integrate with most other asynchronous environments. You can write your code to integrate it into your environment. Currently support exists for
    • libuv (Windows and POSIX)
    • libev (POSIX)
    • libevent (POSIX)
    • select (Windows and POSIX)
    • IOCP (Windows Only)
  • Support for operation batching
  • ANSI C ("C89")
  • Cross Platform - Tested on Linux, OS X, and Windows.


Before you build from this repository, please check the Couchbase C Portal to see if there is a binary or release tarball available for your needs. Since the code here is not part of an official release it has therefore not gone through our release testing process.

For building you have two options; the first is via GNU autotools and the second is via CMake. Autotools provides more packaging flexibility while CMake integrates better into your normal (C/C++) development environment. CMake is also the only way to build the library on Windows.


The library comes with no mandatory third party dependencies; however by default it will demand that at least libevent, libev, or libuv are installed as those are the most tested I/O platforms.

If you are building libcouchbase as a depdency for an application which contains its own event loop implementation then you may specify the --disable-plugins option to the configure script.

Additionally, in order to run the tests you will need to have java installed. The tests make use of a mock server written in Java.

The binary command line tools (i.e. cbc) and tests require a C++ compiler. The core library requires only C.

Building with autotools

In order to build with autotools you need to generate the configure script first. This requires autoconf, automake, libtool and friends.

$ ./config/
$ ./configure
$ make
$ make check
$ make install

You may run ./configure --help to see a list of build options

Building with CMake (*nix)

Provided is a convenience script called cmake/configure. It is a Perl script and functions like a normal autotools script.

$ mkdir lcb-build # sibling of the git tree
$ cd lcb-build
$ ../libcouchbase/cmake/configure
$ make
$ ctest

Building with CMake (Windows)

Spin up your visual studio shell and run cmake from there. It is best practice that you make an out-of-tree build; thus like so:

Assuming Visual Studio 2010

C:\> git clone git://
C:\> mkdir lcb-build
C:\> cd lcb-build
C:\> cmake -G "Visual Studio 10" ..\libcouchbase
C:\> msbuild /M libcouchbase.sln

This will generate and build a Visual Studio .sln file.

Windows builds are known to work on Visual Studio versions 2008, 2010 and 2012.

Bugs, Support, Issues

You may report issues in the library in our issue tracked at Sign up for an account and file an issue against the Couchbase C Client Library project.

The developers of the library hang out in IRC on #libcouchbase on



API Documentation exists inline with the headers in the include/libcouchbase directory. man-pages are also available in the man directory and are installed via make install.


In addition to filing bugs, you may contribute by submitting patches to fix bugs in the library. Contributions may be submitting to We use Gerrit as our code review system - and thus submitting a change would require an account there. Note that pull requests will not be ignored but will be responded to much quicker once they are converted into Gerrit.

For something to be accepted into the codebase, it must be formatted properly and have undergone proper testing. While there are no formatting guidelines per se, the code should look similar to the existing code within the library.

Branches and Tags

Released versions of the library are marked as annotated tags inside the repository.

  • The release10 contains the older 1.x versions of the library.
  • The master branch represents the mainline branch. The master branch typically consists of content going into the next release.
  • The packet-ng branch contains the next generation version of the library with improved packet handling.


See the AUTHORS file


libcouchbase is licensed under the Apache 2.0 License. See LICENSE file for details.

Something went wrong with that request. Please try again.