{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1406","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1406/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1406/comments","events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1406/events","html_url":"https://github.com/couchbase/sync_gateway/issues/1406","id":125054834,"number":1406,"title":"Feedtype=DCP not working sometimes","user":{"login":"tleyden","id":296876,"avatar_url":"https://avatars.githubusercontent.com/u/296876?v=3","gravatar_id":"","url":"https://api.github.com/users/tleyden","html_url":"https://github.com/tleyden","followers_url":"https://api.github.com/users/tleyden/followers","following_url":"https://api.github.com/users/tleyden/following{/other_user}","gists_url":"https://api.github.com/users/tleyden/gists{/gist_id}","starred_url":"https://api.github.com/users/tleyden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleyden/subscriptions","organizations_url":"https://api.github.com/users/tleyden/orgs","repos_url":"https://api.github.com/users/tleyden/repos","events_url":"https://api.github.com/users/tleyden/events{/privacy}","received_events_url":"https://api.github.com/users/tleyden/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbase/sync_gateway/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"tleyden","id":296876,"avatar_url":"https://avatars.githubusercontent.com/u/296876?v=3","gravatar_id":"","url":"https://api.github.com/users/tleyden","html_url":"https://github.com/tleyden","followers_url":"https://api.github.com/users/tleyden/followers","following_url":"https://api.github.com/users/tleyden/following{/other_user}","gists_url":"https://api.github.com/users/tleyden/gists{/gist_id}","starred_url":"https://api.github.com/users/tleyden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleyden/subscriptions","organizations_url":"https://api.github.com/users/tleyden/orgs","repos_url":"https://api.github.com/users/tleyden/repos","events_url":"https://api.github.com/users/tleyden/events{/privacy}","received_events_url":"https://api.github.com/users/tleyden/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/couchbase/sync_gateway/milestones/12","html_url":"https://github.com/couchbase/sync_gateway/milestones/1.2.0","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/milestones/12/labels","id":771891,"number":12,"title":"1.2.0","description":"","creator":{"login":"jessliu","id":4998909,"avatar_url":"https://avatars.githubusercontent.com/u/4998909?v=3","gravatar_id":"","url":"https://api.github.com/users/jessliu","html_url":"https://github.com/jessliu","followers_url":"https://api.github.com/users/jessliu/followers","following_url":"https://api.github.com/users/jessliu/following{/other_user}","gists_url":"https://api.github.com/users/jessliu/gists{/gist_id}","starred_url":"https://api.github.com/users/jessliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessliu/subscriptions","organizations_url":"https://api.github.com/users/jessliu/orgs","repos_url":"https://api.github.com/users/jessliu/repos","events_url":"https://api.github.com/users/jessliu/events{/privacy}","received_events_url":"https://api.github.com/users/jessliu/received_events","type":"User","site_admin":false},"open_issues":111,"closed_issues":147,"state":"open","created_at":"2014-08-29T16:34:15Z","updated_at":"2016-01-05T21:25:35Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2016-01-05T21:25:26Z","updated_at":"2016-01-06T01:23:36Z","closed_at":null,"body":"Factored out of https://github.com/couchbase/sync_gateway/issues/1085#issuecomment-168844340.  I'm seeing strange connection errors when using the DCP feedtype under certain conditions."},"comment":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments/169189461","html_url":"https://github.com/couchbase/sync_gateway/issues/1406#issuecomment-169189461","issue_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1406","id":169189461,"user":{"login":"tleyden","id":296876,"avatar_url":"https://avatars.githubusercontent.com/u/296876?v=3","gravatar_id":"","url":"https://api.github.com/users/tleyden","html_url":"https://github.com/tleyden","followers_url":"https://api.github.com/users/tleyden/followers","following_url":"https://api.github.com/users/tleyden/following{/other_user}","gists_url":"https://api.github.com/users/tleyden/gists{/gist_id}","starred_url":"https://api.github.com/users/tleyden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleyden/subscriptions","organizations_url":"https://api.github.com/users/tleyden/orgs","repos_url":"https://api.github.com/users/tleyden/repos","events_url":"https://api.github.com/users/tleyden/events{/privacy}","received_events_url":"https://api.github.com/users/tleyden/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T01:23:36Z","updated_at":"2016-01-06T01:23:36Z","body":"I tried running this under Docker on AWS, expecting it to work (since it worked under Docker on my OSX setup), and ended up seeing a *third* behavior!  \r\n\r\nIn the [sync gateway logs](https://gist.github.com/tleyden/94dec89e62022b0f4583) there are tons of DCP rollback errors.\r\n\r\n```\r\n2016-01-06T00:33:56.971Z WARNING: DCP Rollback request - rolling back DCP feed for: vbucketId: 520, rollbackSeq: 0 -- base.(*DCPReceiver).Rollback() at dcp_feed.go:176\r\n\r\n```\r\n\r\nIn the [couchbase server babysitter logs](https://gist.github.com/tleyden/0989c2001ebf4ca8c93d) there are lots of [errors](https://gist.github.com/tleyden/0989c2001ebf4ca8c93d#file-gistfile1-txt-L1542) regarding the sequence numbers:\r\n\r\n```\r\nmemcached<0.76.0>: 2016-01-06T00:46:53.667653Z WARNING (default) DCP (Producer) eq_dcpq:cbdatasource-3e1a2d322bc37113 - (vb 520) Stream request failed because the snap start seqno (2) <= start seqno (0) <= snap end seqno (2) is required\r\n```\r\n\r\nTo try to sanity check the setup, I ran with feedtype=DCPSHARD with no issues -- [startup log output for sync gateway](https://gist.github.com/tleyden/3335c89c5ce3cb1492e3).  Ditto for feedtype=TAP.\r\n\r\nSince Sync Gateway doesn't recover from the DCP Rollback messages I think there are bugs with feedtype=DCP around dealing with DCP Rollbacks (the feedtype=DCPSHARD has undergone more testing in that regard as far as I know)\r\n\r\nSetup:\r\n\r\n* [Sync Gateway config feedtype=dcp](https://gist.github.com/tleyden/5bd00a4c4f30e06cf9e3)\r\n* Couchbase server 4.1.0, configured hostname to be 127.0.0.1 during setup\r\n* The Couchbase Server bucket is empty when starting Sync Gateway\r\n* Running `--net host` so that both docker containers share the host networking and Sync Gateway can view docker over 127.0.0.1.\r\n\r\nSteps to repo:\r\n\r\n* Install Docker\r\n* `docker run -itd --net host couchbase/server:enterprise-4.1.0`\r\n* Manually setup Couchbase Server via web UI and create buckets\r\n* `docker run -itd --net host --entrypoint /bin/bash couchbase/sync-gateway`\r\n* `docker exec -ti container-id bash` to get a bash shell in the container\r\n* Switch to the `feature/issue_1085_dboffline_dcp` branch, run `git submodule init && git submodule update`, rebuild Sync Gateway\r\n* Use the  [Sync Gateway config feedtype=dcp](https://gist.github.com/tleyden/5bd00a4c4f30e06cf9e3)\r\n* Start Sync Gateway\r\n\r\n"}}