Couchbase syncgateway traefik

Hello

I am trying to do the following with Traefik 1.7.

https://docs.couchbase.com/sync-gateway/2.1/load-balancer.html

The https work. I can’t get the websocke to work.

@simon.murray
2019-11-17T19:12:01.224Z [DBG] WS+: c:[18366323] Push RPY#6
2019-11-17T19:12:01.224Z [DBG] WS+: c:[18366323] Sending frame: RPY#6 (flags= 1, size= 10)
2019-11-17T19:12:01.401Z [DBG] WS+: c:[18366323] receiveLoop stopped
2019-11-17T19:12:01.401Z [DBG] WS+: c:[18366323] parseLoop stopped
2019-11-17T19:12:01.401Z [DBG] WS+: c:[18366323] Sender stopped
2019-11-17T19:12:01.401Z [INF] HTTP: c:[18366323] #36405: --> BLIP+WebSocket connection closed

I’ve never worked with Traefik but in the case with certain other edge routers/load balancers/ reverse proxies, we’ve had to specifically enable websockets . So you may want to double check the configuration to ensure that websockets is enabled and also configured to allow the designated Sync Gateway ports (defaults to 4984 for public)

https://docs.couchbase.com/sync-gateway/2.1/load-balancer.html

that example uses nginx and uses port 80 and then sends the Traefik to port 4984 so I suppose that it should work.

However am getting an error. Replication starts but then the websocket is closed

logs.zip (5.0 KB)

@priya.rajagopal

i have attached logs. i create new docs and it syncs but the ws connection closes

@simon.murray

running sync gateway in kubernetes with Traefik ingress controller

I don’t see any errors in the logs. It seems like documents were synced and replicator closed gracefully.

2019-11-17 09:07:22.251+00:00 [6]| INFO)  [Replicator] {Repl#7} Saved local checkpoint cp-r1rJEUs1cQmBSwqVXJahNXGsvsk= to db
2019-11-17 09:07:22.255+00:00 [6]| INFO)  [Replicator] {Repl#7} Replication complete! Closing connection
2019-11-17 09:07:22.416+00:00 [61]| INFO)  [Replicator] (WebSocketWrapper) [61] Closing socket normally due to request from LiteCore
2019-11-17 09:07:22.423+00:00 [61]| INFO)  [Network] {C4SocketImpl#14} Socket disconnected cleanly

Do you have replication enabled in continuous or one-shot mode?

If it’s not continuous then the socket connection will close once the pending documents are synced. If you want to have the documents to be synced continually any time there is a change, then setup the replicator in continuous mode which will keep the web socket connection open.
(which IIRC is the default mode)

hello @priya.rajagopal

I managed to fix the issue with couchbase mobile .net core version 2.6. That seems to be working and syncing

However am having a issue with the Android mobile 2.5

2019-11-18T09:37:49.167Z [DBG] Changes+: c:[587e2fb9] MultiChangesFeed waiting… (to ResidentTablet123)
2019-11-18T09:37:49.167Z [DBG] Changes+: No new changes to send to change listener. Waiting for “carevisit-dev”'s count to pass 0
2019-11-18T09:37:49.167Z [DBG] Sync+: c:[587e2fb9] Sending 1 changes. User:ResidentTablet123
2019-11-18T09:37:49.167Z [DBG] Sync+: c:[587e2fb9] Sending 0 changes. User:ResidentTablet123
2019-11-18T09:37:49.167Z [DBG] WSFrame+: c:[587e2fb9] Queued MSG#1~
2019-11-18T09:37:49.167Z [DBG] WS+: c:[587e2fb9] Push MSG#1~
2019-11-18T09:37:49.167Z [INF] Sync: c:[587e2fb9] Sent all changes to client. User:ResidentTablet123
2019-11-18T09:37:49.167Z [DBG] WS+: c:[587e2fb9] Sending frame: MSG#1~ (flags= 101000, size= 51)
2019-11-18T09:37:49.196Z [DBG] WS+: c:[587e2fb9] Received frame: MSG#3!~ (flags= 11000, length=4090)
2019-11-18T09:37:49.197Z [INF] WS: c:[587e2fb9] ERROR decompressing frame: inputLen=4090, remaining=0, output=0, error=unexpected EOF

2019-11-18T09:37:49.197Z [INF] WS: c:[587e2fb9] Error receiving frame MSG#3!~: unexpected EOF. Raw frame = <0318549bc9ae60b99696790be6775c96dc37635e807989815b40421482f797f8fe6d9fd439a55ba9c88c081f7b357fb3ecfd9fffebfffd8ff33fffd7fe4fffe7fffec7fff98fffb7ffcbffe8fffbbfeffff79ffefddfff15e629bb2f6ffaf0cec47e8669230f13478d7d2edf523bfffab77f3973e2b069afed4e3bc987325d1f2e9f506ad8b174cf1ffad7bff968ffdbbffdfbbf460bd1d69e4d2eb598681dcb9f354dad2555fefcb4277c8bf6906be9b6e7b2eb1e8d7f941db3f363b8befa48bf175db19d9dfa3665e66ea29bded459f995772996135c58ee5b74e76d5b74c1f65a578a8edf6e319fba864bceb9fa7b513faadb352d534264a7dd36d3da0e26a5bcbd4dc5f9b2bf457de8e38cc2b96bb02e8c1df9dfb275d89d6a48f1f7a2ec2f13c864ca582c9a59b4679b4d2965b6d30631ecdfa276ae13ea99c4312db696eaf06707bffab165c5f27bd1ba59279e6894050e1d593436b2b5770b95ffdbcd7e8bd6dadab2619598679b7ead3c7bb0d3876a733c7efe89a99f29c4988c5f639b985a37c312dd35061b1a6ecc711365cbb0c10697f68c7b8652b62aa3f47472a8b98edf8bee183d991e26ec46492d9f4c9f671a7baa0de5d4e9dc5d34cf1d921d6590cbb8d3d26aecdeb6e648e7fab368f1d6dbde8f61e9ca4e5736b54fb69b7a997ed8516bfc169d91309fbdfc881c82656df76d8fb2fab6a79ffc27fbd45899659963138bbae0cc20ef6cd773b4e15a9de5167faa6c761e4b13945e77a06e478973d59953dafbcfa29604931533fd8cec3414438d0fb3bb737445caf91d3f244f56d2f47453daad77ebc3dea5b8e8b78f7f8b5f3d418abc29761c13cbdaa6711a330f91f269851e6ff17be7cfaac9c7e07b5cb9c6b0dd749518c4be72ff53fc9488ef79065357b126921933d4a6616e3b096b6db3dd922a2727777c9b36cdca0e3d593aadb5e44af3eb4f9d8eee57dc7699a94892a8a48adcc6a7dcfd013df6f6dfa271264a6a8e316d000796f5cd0d6bcb2e54cc3e7f625a5c0b9e7099e629f938b3a3ee5733a987c0c132a872518ae28da7e5d47df075d05a6738b7738ebe9416c3df980e1025baaf99c8be1d243ea5667cf13101413eeff52d3a96cb3ec419d3e83d9f6e23ff5e7ca2a8c2616b6f51ff2d1a52f0b614d3d208f4fe64cfc37ae3c6f22b349fdc87a791e62dde679781922958e9cd4d7a2ca4b1eca26dbf4583cf5ab4d3b6b1ee6a5c5e94d406f5aaa3a308735d21bb35e3dde901ce0248179bb3c50229beb85cedccd54d7adfffdee999a3fab0ac394b6d6a77a1eec12b4f4a00af3901866f519766616b3d1cdbe3f0f558fa967dc6535ab1ffe0e9b7686c255201d3b895a6e8249a56e3307dfb32d9694f7ddee2efec8a929f966dd6e4ea72a5d22cb38ece766fa25cfd1615f4ac7dc8ae3be0299865e83e2a0c3055b10440e85b744d5be25a966d015fb3fa4265b816f7b031f203dea2f16bd33973a657e9cb404c2b1d50c3a0814aa26a92f7bbde3a0d25575a7652eb67c4057f8519565cb1ef4a7e2ef2b3f90ffaba3d6cb29b12ad88af5728ce46a2d106243b832b3751fb4478b084be0611eb415dd37b8badf933f64329d7be3a8db002d8a5744f415fa8a69e928ca06843c554ea45fe453e66b776870208d212db43a3b6ee337aa120def1eb8da9dd2daf6ea8e00c486bd10547d546a5e740afe74b7c2adac68eb64b7d39c879b6e4ed01e4ed0a2ea7dfc767f7ae87764c401880a79e98722e63adf7a5a96f46bebc9febde146409b640db7b05db76cf2d3b5bf9c3e3edf4a2945bbdedc2f14762a7eccc8c98331cd5ec76680f18e8d24915d9a53c48504c89a6f00bb1c2cf190894527e97546bb9b811e064d794a8524da35b386d74f44a412e5c40c9beb12f2adeafeaac4ba0224b74187614aabbffdee9b6bb276a0d101647ad2d2d45f67399f3c0cf50edb880423d372a8993f6be5967c1ba754ca10ee4557ec774c0fbc19e6cd05e207f7203e20b10014407dad90875dc45476e67adb322fcbb6c69d5c1f708298a124c39bf8fbf810de4cd30850371fc08a074f41fac477f835fb0cc4d54f7ac4a0b0377d675bb2749a0eca88a3a40966f5158ed5b74c2e63150fc0efc8bc82daaa9362339d6a1d40dbd5d40a173529db3a6839e64272e37feb4eb007bb6e367d10ffa4670230598a41dda2a668a75a0c90c593e106f837fdd4bd44ec812253c403aae4de8d957b0bebb65a7a45001b5affc49f686e183faec8db75fc27aa4a9da4204c09cb31146bf1f57ed992d8bcf1676ca0b7e297bd51c2c0ad0db45440e1ae17216c579457007547734e84512171bcd50bd07f928f6a456daaadb5c1bfac84d5b29b34c00462236fe9442bb4c629ccfbc05d1fc57651dfd6d012718d5b369480a7e5ec39cda4669b9b7f9e90b4f95758f0887c94583bb9d32c52ff0fc0979fc84b97d9b2d03763ca0e1acc29842dac6e157c3d642ed03a2fe762e241da12d113931a0224e45b84a90c4097013a2ce4fb0976940d16f71045319646ece0edbf61a4c2f8d9f8084469a0159f59242b52ecfe82cfcefd02f74aecb7bf4bcc3c82af717de7af530cdcd91cd06c94d0cdfa21377d0aaed9672ea697d610807318d76a5c3f2c8d6a29b42aa284302cf512ed624f78501a8e1fcec14f9294990c16f708182a08f07c206017475c686622a4c0924389b4377a3ad49c18937aa30752039c2950640d447b86ea1a2f156d3e308e2c8702355695ae6047beff0536d8edea06339820de80972902a4a059be061a2828cc11c5040bfc35128e5ba9a379988526d13d549208d4ac0636be2681725f7c82c8aa03b3d23e55b240c0ed54887b41a3ac40a67b87513182fab4f906e8d90d82f1a31563453cb6826f609cecc45a0fc17ebd5505915a3121a2127711b811c2a023fe967f6dfcd47acc38299e83b72170fe8d6c009e3f7a13a3c01ee577cfb1da84d5f03205e6bef98ba3cf803ab73e884d85b6dbbf2740840a5c5135a9292af122fda319cc4668b91bcf4ada68993fc164f48195c24ad0a44132c7ef36c8e6529622972f47a87a6dfce5dbc066767072498800394ff44df80a1060dbfab3d8e6ebe8baf455bf0f35a2c8d820208d79a08248a86cd39081fb8a9fd25327e55127b4f05e56af2c9348b34ff67c883787d4f47fd5e12c1ac41f707f379d2046c0a2514913b1d5ae010ed0025c4327c8b53391fed753456c2998e2ff01b71ded0e1886944bd75eb50b65f22e9514449c056a179fd1e75282e7819c037f5f8dafbe27e801d3636dac8b4b263f93d3c8939a84f44347f3b5f258528c03374ea58a2ff04b4db467d2d50bcf675589fe3d5eeaef46ddfe211218fe6f6883dd83ace213d4de7a0fc4fcacdcbdadf2ac919db8de376fd4896698c601358ea40a1219ba36496bb38fafe6b1a009c1a6aa6264018458301823d4c2a14c5d614e1cc2f1c09eacefa012e11ed68e194b621a326daf6ebe1fedd710aae0e8c01aaa7099f3bf07180eb489b63d98085a63f5f8d3fd4135a15e929bf43b164d59f853e670480aeae0edfa25466cbc315b8d5b153ba145742dba0cc004d8c15b07fdb1b750cca7994a514351958bb9784f3a2f6425da04c00a8fb9f181fa4e9dad974043e09a44ff00f80205b9d5ba26e5f35b0ad5c48af145eee09ff5dc5284ed2d86296fd7428bce4ff24104319364c6676ee53bd4e277ed571d22a788dd8fcad0eb6d629623864e269883340ddd1cb6c1fa71dd9478ec4f5d673bc612939afb35170074bc2e299541247b3c5b94866048bea3998a09eb52bd13dd4193a7c3bd451b6256ba4312e095c655c03943b1225e610d960f7902896815d367c44b0d3e7e076d32c62cd63e9088b85092005624511c0f0dffcb90b196e78e4d946660d19ce7c603fce0647670fe23a8d13aee02a03725a314cb750c31ad94408056d91cfc69a1cf479e09cbf438cd3296e62872b6d0a15a2602a12d620e2e81522045a3ed9dd20aa31f0981ca4c08711c37f26068fde8b7f7aa3f13b83ea91cda0f150a9a6ad2027978ed40fbd13be309470e8948a8edfbd0f0a09e780facef8ac9cb02cbfc320e6cdb1902ad89d7f78d45c2be82b44187abe7aacecd770f49638cfa6094bc970ece1021ccf090f09f801b5ebb80396777633814e569a3231ac393d12b1f84dd53c294f0db4048dcc4503b413f00561b741510428b63cd9f92dda9373840fb089da28d5821068ac1c091e544d1dab8570215e3555fb818080787e324743d747cdb2527a46ee2ac28dc6e3ef22b357a315a80732e23a82d623b3cf38bd5e2c43c1399f29248cbf9d89decee7e4d92cad4994d31357dfa2fe402d00343b61294418e81be5637b44f8ec493b5f64c018a2da40f362e7e80dcd853ec0f3e16b16feb09f5dd1cae787f8efe0a1b98629a60db668b4238a305d879a38c082c77b7eb32ffe8093e8a665f55fc75ef8ed90e066320c3352b82fb857c11e1c5da2b9d0eee41e04379586e7d85b39de2d7ccc9f2495c935b214638bd6a324e1e485396f11e9565f87dd690e9ada26db052cb819596a9a6b83b2d80c102fc512cf1b6685e4a6af16e40927e3006054fcbdab194f78c6ef3210e988058c4483c619dbb4300f3aa7e355dba836b5af5ee53491f8dd2a413072286ccb913bd43260f2231fbea0cec54665e5279042192cc178046fd6847868e45aaf9f6f2b6772b335a820d2d9e3ae3ef5e0e6a1e86b73be51c8f1f78e1765989b13824f621b55c2608f599f0b0820f7a71b710e35a19f2278333aca883f0ea31e3f5143731f5ae26e397cc1a519d01f1abd518c14590016880d0c710a1a8840fbf5140fd04d6c81ec76b08e3e218551d06397ede23f7ef1dbaa2553078436ac31d4f1886d9749d03800e829cbbd89f6cc6c0d7d0d12d2cd38c6c80171d36dc4e830fcf9a4907a7df0e5ae17f72de104374a5db4d3acd69dd650f3213521d50722d41f7e79cb92b9dd1d521549bcd41ae022154cd75d1abe36696348a03bc8f7331d357f6a047d1010a713c98b28fdf8a6e083347806bdf052e1c0814ef347c8be9c3b03fbe19bd604c49a149167768acd45246583fe6d2ed512ef4080fdbb4e37934d4c03e22e56809e8c16cdcc0b3eec1dff03da73c2a4f7f01a839a8d51b7053e82817151073895fd8d2234f496fa25e26be812e1b04fc2f30dc03c0dbd7f8b108a6dc05c5021750e7a5305ddd16278925c4931ea2ebf6ea8d0a4463930c0408d716230b3a40c989d87de3f1e1cbd1caa0db89ecc4e43020c0aaeb9d9b8563fd9bb7cc790f8157e9a033800e65c6cc1367add5101ff6b534a248e5fa53f1efc0ccf6ac5a0e69afc1c02af2fdd4c200957c5f58f2ba6a1a36439345c872203085054277cea9d2dc409ee73dc37934720dca1b4e74fd2c280a6d310991481a1c404786467d5dbfec118a55fe0c213a2737b2f54cc8271a3c00231ddde501a50b8e540dc321be55847be167ed0fc7c6ffeca7105f33d9eaf8521b181d942b5336918d64108312b25b3f8e1149d7de890e2d54b0814987c61f3074a8fce3523c145baea3ab3389af7d65a4a2e2d1c32261bd7da945e7f26bf5b7a5b70a84b6175627f83edef44154187153e3065d79c72c820266f28aad97787736a7b9e8b6c818a6b011f077e47974534669fc8aefe145eca77512cb78f80b9ffa6d48b16eedb77a38d0cd5f5a877c773148b44660bba511b002fecbe22f086f38feec17afb166d08004fc40cfc222216a3c135602671a3195d68d7cfe6>
2019-11-18T09:37:49.197Z [INF] WS: c:[587e2fb9] Error: parseLoop closing socket due to error: unexpected EOF
2019-11-18T09:37:49.197Z [DBG] WS+: c:[587e2fb9] parseLoop stopped
2019-11-18T09:37:49.197Z [INF] WS: c:[587e2fb9] BLIP/Websocket Handler exited: unexpected EOF
2019-11-18T09:37:49.197Z [INF] HTTP: c:[587e2fb9] #3818: --> BLIP+WebSocket connection error: unexpected EOF
2019-11-18T09:37:49.197Z [INF] HTTP: c:[587e2fb9] #3818: --> BLIP+WebSocket connection closed
2019-11-18T09:37:49.197Z [DBG] Changes+: Notifying to check for _changes feed termination
2019-11-18T09:37:49.197Z [DBG] SyncMsg+: c:[587e2fb9] #2: Type:subChanges --> Time:30.684057ms User:ResidentTablet123
2019-11-18T09:37:49.197Z [DBG] WS+: c:[587e2fb9] Sender stopped
2019-11-18T09:37:49.197Z [DBG] Changes+: No new changes to send to change listener. Waiting for “carevisit-dev”'s count to pass 6
2019-11-18T09:37:49.197Z [INF] Changes: c:[587e2fb9] MultiChangesFeed done (to ResidentTablet123)