ArgumentException: bucket count must be a power of 2!
Tue, 11/06/2012 - 12:21
I'm using Couchbase 2.0 Beta with the latest .Net SDK and logging.
I'm just trying to save anything to the server. I've tried many things, but the result is always false.
----------------------------------------------------------------------------------
Dim result = CacheClient.Store(StoreMode.Set, key, dataString) // is always false!
----------------------------------------------------------------------------------
I've tried many things and after investigating the logs I found this error that keeps popping up.
================================================================================================= 2012-11-06 12:02:29,812 [22] ERROR Couchbase.CouchbasePool [(null)] <(null)> - Failed to initialize the pool. System.ArgumentException: bucket count must be a power of 2! at Enyim.Caching.Memcached.VBucketNodeLocator..ctor(String hashAlgorithm, VBucket[] buckets) at Couchbase.CouchbasePool.InitVBucket(ClusterConfig config, ISaslAuthenticationProvider auth) at Couchbase.CouchbasePool.ReconfigurePool(ClusterConfig config) =================================================================================================
What should I do to resolve this? 1.8 was so simple to get things into the cache. I feel like this has been a headache to get working out of the box.
Below is my app.config.
======================================================================================
<configuration>
<configSections>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
<sectionGroup name="enyim.com">
<section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<enyim.com>
<log factory="Enyim.Caching.Log4NetFactory, Enyim.Caching.Log4NetAdapter" />
</enyim.com>
<log4net debug="false">
<appender name="LogFileAppender" type="log4net.Appender.FileAppender,log4net">
<param name="File" value="c:\\temp\\error-log.txt" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" />
</layout>
</appender>
<root>
<priority value="ALL" />
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="10000"
numberToRemoveWhenScavenging="10" backingStoreName="Null Storage"
type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Cache Manager" />
</cacheManagers>
<backingStores>
<add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Null Storage" />
</backingStores>
</cachingConfiguration>
<couchbase>
<servers bucket="Test" bucketPassword="">
<add uri="http://127.0.0.1:8091/pools"/>
</servers>
</couchbase>
</configuration>
Turns out this is a Windows 8 issue and I had to replace a .dll to make things work.
See this issue for the fix:
http://www.couchbase.com/issues/browse/MB-6395