{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/959","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/959/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/959/comments","events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/959/events","html_url":"https://github.com/couchbase/sync_gateway/issues/959","id":92587485,"number":959,"title":"Sync Gateway crashes with error 'panic: parent id \"xxx-xxxx\" is missing'","user":{"login":"joshblour","id":1440796,"avatar_url":"https://avatars.githubusercontent.com/u/1440796?v=3","gravatar_id":"","url":"https://api.github.com/users/joshblour","html_url":"https://github.com/joshblour","followers_url":"https://api.github.com/users/joshblour/followers","following_url":"https://api.github.com/users/joshblour/following{/other_user}","gists_url":"https://api.github.com/users/joshblour/gists{/gist_id}","starred_url":"https://api.github.com/users/joshblour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshblour/subscriptions","organizations_url":"https://api.github.com/users/joshblour/orgs","repos_url":"https://api.github.com/users/joshblour/repos","events_url":"https://api.github.com/users/joshblour/events{/privacy}","received_events_url":"https://api.github.com/users/joshblour/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbase/sync_gateway/labels/in%20progress","name":"in progress","color":"ededed"}],"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":null,"comments":6,"created_at":"2015-07-02T09:00:34Z","updated_at":"2015-07-02T20:07:50Z","closed_at":null,"body":"Sync Gateway crashes with error 'panic: parent id \"xxx-xxxx\" is missing'\r\n\r\nTo trigger this error I have the revs_limit set to 3 and I'm updating a document once a second.\r\n\r\nFull crash log here: https://gist.github.com/joshblour/59058ac4e8f9a5dd900d\r\n\r\nYou can reproduce it with my modified version of helloCBL here: https://github.com/joshblour/couchbase-lite-tutorial-ios/tree/sync_rapid_updates\r\nI've added continuous push & pull replications and a timer to update the document once a second.\r\n\r\nI'm running sync_gateway version 1.1.0-26  on my local machine with the following config:\r\n````\r\n{\r\n        \"interface\":\":5984\",\r\n        \"adminInterface\":\":5985\",\r\n        \"log\":[\"REST\"],\r\n        \"verbose\":\"true\",\r\n        \"databases\":{\r\n                \"sync_gateway\" :{\r\n                        \"server\":\"http://localhost:8091\",\r\n                        \"revs_limit\" : 3,\r\n\t\t\t\"users\": { \"GUEST\": { \"disabled\": false, \"admin_channels\": [\"*\"] } },\r\n                        \"bucket\": \"sync_gateway\",\r\n                        \"shadow\": {\r\n                                \"server\": \"http://localhost:8091\",\r\n                                \"bucket\": \"default\"\r\n                        },\r\n                        \"sync\":`function(doc){\r\n                                 if (doc.deleted) {\r\n                                        channel(\"deleted\")\r\n                                } else if (doc.isExpired) {\r\n                                        channel(\"expired\")\r\n                                } else {\r\n                                        channel(\"active\")\r\n                                }\r\n                        }`\r\n                }\r\n        }\r\n}\r\n````"},"comment":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments/118152179","html_url":"https://github.com/couchbase/sync_gateway/issues/959#issuecomment-118152179","issue_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/959","id":118152179,"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":"2015-07-02T20:07:50Z","updated_at":"2015-07-02T20:07:50Z","body":"I was able to reproduce with the following changes:\r\n\r\n* Set GOMAXPROCS to 4 (on my machine, it was using 8 by default)\r\n* Update HCAppDelegate.m to `[NSTimer scheduledTimerWithTimeInterval:0.1`  (change timer to 0.1 seconds from 1 second)"}}