I am attempting to setup replication between a .NET (8.0.403
) C# application using Couchbase Lite (3.2.0
), and a Couchbase Server + Couchbase Sync Gateway running in docker containers on the same machine (M3 Mac
). The replication code is as follows:
// Get the database (and create it if it doesn't exist)
var database = new Database("mydb");
var collection = database.GetDefaultCollection();
// Create replicator to push and pull changes to and from
var targetEndpoint = new URLEndpoint(new Uri("ws://localhost:4984/audit"));
var replConfig = new ReplicatorConfiguration(targetEndpoint);
replConfig.AddCollection(database.CreateCollection("projects", "audit"));
// Add authentication
replConfig.Authenticator = new BasicAuthenticator("user@fake.com", "passwordFake");
replConfig.Continuous = true;
replConfig.ReplicatorType = ReplicatorType.PushAndPull;
// Create replicator
var replicator = new Replicator(replConfig);
replicator.AddChangeListener(OnReplicatorUpdate);
try {
replicator.Start(); //THIS LINE FAILS
} catch (Exception e) {
Console.WriteLine(e);
}
However the call to replicator.Start()
results in the following error message:
Process finished with exit code 139.
with no other error or warning logs and the application quits. I am running the console app via Jetbrains Rider and dotnet run
.
This same code and docker setup works on a Windows 10 machine.
Additionally, after changing this code to connect to a Couchbase Capella instance, it continues to exit with the same error on Mac, but succeeds on Windows
This same simple application also works on my M3 Mac when written in Java rather than .NET C#
How can I have the replication succeed on a M3 Mac.
Full stacktrace:
2024-10-22 01:05:38.759-04:00 [1]| INFO) [Database] (Startup) [1] CouchbaseLite/3.2.0 (.NET; Darwin 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:04 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6030) Build/141 LiteCore/3.2.0 (224) Commit/1b16cd92
2024-10-22 01:05:38.819-04:00 [1]| WARNING) [Database] (Logging) [1] Database.Log.File.Config is null, meaning file logging is disabled. Log files required for product support are not being generated.
2024-10-22 01:05:38.819-04:00 [1]| INFO) [Database] (Database) [1] Opening database at /redacted/consoleTodo/bin/Debug/net8.0/CouchbaseLite/mydb.cblite2
2024-10-22 01:05:38.821-04:00 [1]| INFO) [Database] {Shared#1}==> litecore::DataFile::Shared 0x102e09558 @0x102e09558
2024-10-22 01:05:38.821-04:00 [1]| INFO) [Database] Obj=/Shared#1/ Path=/redacted/consoleTodo/bin/Debug/net8.0/CouchbaseLite/mydb.cblite2/db.sqlite3 Instantiated
2024-10-22 01:05:38.821-04:00 [1]| DEBUG) [Database] Obj=/Shared#1/ created for DataFile 0x102e0f290 at /redacted/consoleTodo/bin/Debug/net8.0/CouchbaseLite/mydb.cblite2/db.sqlite3
2024-10-22 01:05:38.821-04:00 [1]| INFO) [Database] {DB#2}==> litecore::SQLiteDataFile /redacted/consoleTodo/bin/Debug/net8.0/CouchbaseLite/mydb.cblite2/db.sqlite3 @0x102e0f290
2024-10-22 01:05:38.821-04:00 [1]| INFO) [Database] Obj=/DB#2/ File=Shared#1 Opening database
2024-10-22 01:05:38.823-04:00 [1]| INFO) [Database] {Collection#3}==> litecore::CollectionImpl mydb/_default @0x600003c6c4d0
2024-10-22 01:05:38.823-04:00 [1]| INFO) [Database] Obj=/Collection#3/ DB=DB#2 Instantiated
2024-10-22 01:05:38.824-04:00 [1]| VERBOSE) [Database] Obj=/DB#2/ Next expiration time is 0
2024-10-22 01:05:38.824-04:00 [1]| VERBOSE) [Database] Obj=/DB#2/ Next expiration time is 0
2024-10-22 01:05:38.824-04:00 [1]| VERBOSE) [Database] Obj=/DB#2/ Next expiration time is 0
2024-10-22 01:05:38.824-04:00 [1]| VERBOSE) [Database] Obj=/DB#2/ Next expiration time is 0
2024-10-22 01:05:38.825-04:00 [1]| INFO) [Database] {Collection#4}==> litecore::CollectionImpl mydb/projects @0x600003c6c5f0
2024-10-22 01:05:38.825-04:00 [1]| INFO) [Database] Obj=/Collection#4/ DB=DB#2 Instantiated
2024-10-22 01:05:38.832-04:00 [1]| VERBOSE) [Replicator] (Database) [1] There is no saved HTTP cookies.
2024-10-22 01:05:38.837-04:00 [1]| INFO) [Replicator] (Replicator) [1] Replicator[<*> ws://localhost:4984/audit]: Starting
2024-10-22 01:05:38.837-04:00 [1]| DEBUG) [Database] Obj=/Shared#1/ adding DataFile 0x15260af30
2024-10-22 01:05:38.837-04:00 [1]| INFO) [Database] {DB#5}==> litecore::SQLiteDataFile /redacted/consoleTodo/bin/Debug/net8.0/CouchbaseLite/mydb.cblite2/db.sqlite3 @0x15260af30
2024-10-22 01:05:38.837-04:00 [1]| INFO) [Database] Obj=/DB#5/ File=Shared#1 Opening database
2024-10-22 01:05:38.837-04:00 [1]| INFO) [Database] {Collection#6}==> litecore::CollectionImpl mydb/_default @0x600003c70320
2024-10-22 01:05:38.837-04:00 [1]| INFO) [Database] Obj=/Collection#6/ DB=DB#5 Instantiated
2024-10-22 01:05:38.837-04:00 [1]| VERBOSE) [Database] Obj=/DB#5/ Next expiration time is 0
2024-10-22 01:05:38.837-04:00 [1]| VERBOSE) [Database] Obj=/DB#5/ Next expiration time is 0
2024-10-22 01:05:38.838-04:00 [1]| VERBOSE) [Database] Obj=/DB#5/ Next expiration time is 0
2024-10-22 01:05:38.838-04:00 [1]| VERBOSE) [Database] Obj=/DB#5/ Next expiration time is 0
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Network] {Connection#7}==> litecore::blip::Connection ->ws://localhost:4984/audit/_blipsync @0x600002061010
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Network] Obj=/Connection#7/ Opening connection...
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Network] {BLIPIO#8}==> litecore::blip::BLIPIO ->ws://localhost:4984/audit/_blipsync @0x15260bbc0
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Network] {C4Socket#9}==> litecore::repl::C4SocketImpl ws://localhost:4984/audit/_blipsync @0x15260b3e8
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {DNRepl@102C112D8/C4RemoteRepl#10}==> litecore::C4RemoteReplicator 0x15260a1a0 @0x15260a1a0
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {Repl#11}==> litecore::repl::Replicator ->ws://localhost:4984/audit/_blipsync @0x15260b900
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {DBAccess#12}==> litecore::repl::DBAccess 0x15410cb38 @0x15410cb38
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/ DB=DB#5 Instantiated {{Coll#0} "audit.projects": {"Push": continuous, "Pull": continuous, Options={autoPurge:true, headers:{}}}}
Options={auth:{, type:"Basic", username:"demo@example.com"}, autoPurge:true, headers:{}, maxRetries:2147483646}
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Database] {Collection#13}==> litecore::CollectionImpl mydb/projects @0x600003c60b00
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Database] Obj=/Collection#13/ DB=DB#5 Instantiated
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {Pusher#14}==> litecore::repl::Pusher Repl#11 @0x15260bef0
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {Inserter#15}==> litecore::repl::Inserter Repl#11 @0x15260c440
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {RevFinder#16}==> litecore::repl::RevFinder Repl#11 @0x15260c5e0
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] {Puller#17}==> litecore::repl::Puller Repl#11 @0x15260c130
2024-10-22 01:05:38.838-04:00 [1]| VERBOSE) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/ Remote-DB ID 1 found for target <ws://localhost:4984/audit/_blipsync>
2024-10-22 01:05:38.838-04:00 [1]| VERBOSE) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/ C4RemoteRepl 0x15260a1a0 created Repl 0x15260b900
2024-10-22 01:05:38.838-04:00 [1]| INFO) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/ Starting Replicator Repl#11 with config: {{{Coll#0} "audit.projects": {"Push": continuous, "Pull": continuous, Options={autoPurge:true, headers:{}}}}
Options={auth:{, type:"Basic", username:"demo@example.com"}, autoPurge:true, headers:{}, maxRetries:2147483646}}
2024-10-22 01:05:38.838-04:00 [12]| VERBOSE) [Query] RecordEnumerator 0x600003974218: (.audit.projects, 110 0)
2024-10-22 01:05:38.838-04:00 [13]| INFO) [Network] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/Connection#7/C4Socket#9/ Connecting...
2024-10-22 01:05:38.838-04:00 [12]| INFO) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/ Coll=0 Scanning for pre-existing conflicts...
2024-10-22 01:05:38.839-04:00 [12]| INFO) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/ Coll=0 Found 0 conflicted docs in 0.001 sec
2024-10-22 01:05:38.839-04:00 [12]| INFO) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/ Coll=0 No local checkpoint 'cp-GUNXeJTSVmKRxlFzNTNCbzbewinVwPjl2aEv5XpXYJY='
2024-10-22 01:05:38.839-04:00 [12]| INFO) [Replicator] Obj=/DNRepl@102C112D8/C4RemoteRepl#10/Repl#11/ activityLevel=connecting: connectionState=1, savingChkpt=0
2024-10-22 01:05:38.839-04:00 [1]| INFO) [Replicator] (Replicator) [1] Replicator[<*> ws://localhost:4984/audit] is Connecting, progress 0/0
2024-10-22 01:05:38.839-04:00 [1]| INFO) [Replicator] (Replicator) [1] Replicator[<*> ws://localhost:4984/audit] is Connecting, progress 0/0
Connecting to Sync Gateway.
All documents synced.
2024-10-22 01:05:38.841-04:00 [1]| INFO) [Query] {Query#18}==> litecore::SQLiteQuery SELECT * FROM audit.projects @0x6000037687f0
2024-10-22 01:05:38.841-04:00 [1]| INFO) [Query] Obj=/Query#18/ Compiling N1QL query: SELECT * FROM audit.projects
2024-10-22 01:05:38.841-04:00 [1]| VERBOSE) [Query] Obj=/Query#18/ N1QL query translated to: {"FROM":[{"COLLECTION":"projects","SCOPE":"audit"}],"WHAT":[["."]]}
2024-10-22 01:05:38.841-04:00 [1]| INFO) [Query] Obj=/Query#18/ Compiled as SELECT fl_result(fl_root("audit.projects".body)) FROM "kv_.audit.projects" AS "audit.projects"
2024-10-22 01:05:38.841-04:00 [1]| INFO) [Query] {QueryEnum#19}==> litecore::SQLiteQueryEnumerator 0x600003f6c378 @0x600003f6c378
2024-10-22 01:05:38.841-04:00 [1]| INFO) [Query] Obj=/QueryEnum#19/ Created on {Query#18} with 0 rows (2 bytes) in 0.011ms
2024-10-22 01:05:38.842-04:00 [1]| INFO) [Query] (QueryResultSet) [1] Beginning query enumeration (600002564b00)
2024-10-22 01:05:38.842-04:00 [1]| VERBOSE) [Query] Obj=/QueryEnum#19/ END
2024-10-22 01:05:38.842-04:00 [1]| INFO) [Query] (QueryResultSet) [1] End of query enumeration (600002564b00)
Number of rows :: 0
2024-10-22 01:05:38.844-04:00 [.NET TP Worker]| INFO) [Replicator] (WebSocketWrapper) [.NET TP Worker (8)] c4Socket is retained, and reachability status monitor is starting.
Process finished with exit code 139.