I am trying to programmatically create buckets using IClusterManager.CreateBucket
and am getting a SocketException.ConnectionAborted 10053 error consistantly when attempting to create the second bucket on localhost. The code I am using to reproduce is
using System;
using System.Collections.Generic;
using Couchbase;
using Couchbase.Configuration.Client;
namespace CouchbaseManagementReset
{
class Program
{
static void Main(string[] args)
{
var config = new ClientConfiguration
{
Servers = new List<Uri> { new Uri("http://localhost:8091") }
};
using (var cluster = new Cluster(config))
{
var manager = cluster.CreateManager("Administrator", "password");
for (var i = 0; i < 2; i++)
{
var result = manager.CreateBucket($"bucket{i}");
if (!result.Success)
{
Console.WriteLine($"bucket{i} failed - {result.Message}");
}
}
}
}
}
}
and the resulting logfile has the error
Couchbase.Management.ClusterManager Error System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at Couchbase.Management.ClusterManager.CreateBucket(String name, UInt32 ramQuota, BucketTypeEnum bucketType, ReplicaNumber replicaNumber, AuthType authType, Boolean indexReplicas, Boolean flushEnabled, Boolean parallelDbAndViewCompaction, String saslPassword, ThreadNumber threadNumber)
I’m running Couchbase Server 3.1.1-1807 Enterprise Edition, and am using Couchbase.NetClient 2.2.1.0 on Windows 7 Professional. Oddly enough, having somebody else remotely connect to my Couchbase Server instance and run the same code does not produce the same error, seems restricted to localhost.
Any ideas or additional information I could provide?