Sync gateway and Lite-Core (C API) compatibility

I use Lite-Core for C development. I ran a replicator in my code for connection to sync gateway. But i received error 403 (403 Forbidden ). i read some issues and so i realize that my problem is mismatch of lite-core version and sync gateway version. so my questions:

  1. what is Lite-Core version?
  2. what is Sync Gateway version for compatibility with Lite-Core

Qt log:
20:19:04.452353| [DB]: Opening DataFile ./ali3/db.sqlite3
20:19:04.452960| [DB]: Opening DataFile ./ali3/db.sqlite3
20:19:04.453541| [BLIP]: {Connection#1}==> litecore::blip::Connection ->ws:192.168.1.43:4984/afc-center/_blipsync
20:19:04.453567| [BLIP]: {Connection#1} Opening connection…
20:19:04.453604| [Actor]: Starting Scheduler<0x1e027d0> with 4 threads
20:19:04.456337| [WS] WARNING: {C4SocketImpl#1}==> litecore::websocket::C4SocketImpl ws:192.168.1.43:4984/afc-center/_blipsync
20:19:04.456360| [WS] WARNING: {C4SocketImpl#1} WebSocket closed abnormally with status 403
20:19:04.456389| [BLIP]: {Connection#1} Closed with WebSocket status 403: Unexpected response status 403 Forbidden
20:19:04.456413| [Sync]: {Repl#1}==> litecore::repl::Replicator ./ali3/ ->ws:192.168.1.43:4984/afc-center/_blipsync
20:19:04.456425| [Sync]: {Repl#1} Connection closed with WebSocket status 403: “Unexpected response status 403 Forbidden”
20:19:04.456443| [Sync] ERROR: {Repl#1} Got LiteCore error: Unexpected response status 403 Forbidden (7/403)
20:19:04.456451| [BLIP]: {BLIPIO#2}==> litecore::blip::BLIPIO 0x1e02588
20:19:04.456464| [BLIP]: {BLIPIO#2} ~BLIPIO: Sent 0 bytes, rcvd 0. Max outbox depth was 0, avg -nan
20:19:04.456473| [Sync]: {Repl#1} now stopped
20:19:04.456516| [DB]: Closing DataFile

1 Like

403 forbidden , I think directly relates to sync function on the sync gateway. Can you please share the sync function also.

yes:

function (doc, oldDoc) {
if (doc.sdk) {
channel(doc.sdk);
}
}

may be @adamf can help on this.

wich version of SGW is compatible with Lite Core?

Sync gateway 2.0 is compatible with Lite Core

which version?
i have SGW 2.0 (823)

1 Like