{"action":"created","issue":{"url":"https://api.github.com/repos/MISP/MISP/issues/935","repository_url":"https://api.github.com/repos/MISP/MISP","labels_url":"https://api.github.com/repos/MISP/MISP/issues/935/labels{/name}","comments_url":"https://api.github.com/repos/MISP/MISP/issues/935/comments","events_url":"https://api.github.com/repos/MISP/MISP/issues/935/events","html_url":"https://github.com/MISP/MISP/issues/935","id":133197588,"number":935,"title":"Synchronisation issues","user":{"login":"h122015","id":16301608,"avatar_url":"https://avatars.githubusercontent.com/u/16301608?v=3","gravatar_id":"","url":"https://api.github.com/users/h122015","html_url":"https://github.com/h122015","followers_url":"https://api.github.com/users/h122015/followers","following_url":"https://api.github.com/users/h122015/following{/other_user}","gists_url":"https://api.github.com/users/h122015/gists{/gist_id}","starred_url":"https://api.github.com/users/h122015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h122015/subscriptions","organizations_url":"https://api.github.com/users/h122015/orgs","repos_url":"https://api.github.com/users/h122015/repos","events_url":"https://api.github.com/users/h122015/events{/privacy}","received_events_url":"https://api.github.com/users/h122015/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MISP/MISP/labels/potential-bug","name":"potential-bug","color":"eb6420"},{"url":"https://api.github.com/repos/MISP/MISP/labels/support","name":"support","color":"cc317c"},{"url":"https://api.github.com/repos/MISP/MISP/labels/WaitingAnswer","name":"WaitingAnswer","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/MISP/MISP/milestones/12","html_url":"https://github.com/MISP/MISP/milestones/Support","labels_url":"https://api.github.com/repos/MISP/MISP/milestones/12/labels","id":1661623,"number":12,"title":"Support","description":"All the support issues","creator":{"login":"Rafiot","id":248875,"avatar_url":"https://avatars.githubusercontent.com/u/248875?v=3","gravatar_id":"","url":"https://api.github.com/users/Rafiot","html_url":"https://github.com/Rafiot","followers_url":"https://api.github.com/users/Rafiot/followers","following_url":"https://api.github.com/users/Rafiot/following{/other_user}","gists_url":"https://api.github.com/users/Rafiot/gists{/gist_id}","starred_url":"https://api.github.com/users/Rafiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rafiot/subscriptions","organizations_url":"https://api.github.com/users/Rafiot/orgs","repos_url":"https://api.github.com/users/Rafiot/repos","events_url":"https://api.github.com/users/Rafiot/events{/privacy}","received_events_url":"https://api.github.com/users/Rafiot/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":18,"state":"open","created_at":"2016-03-23T09:41:30Z","updated_at":"2016-04-05T14:09:55Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2016-02-12T09:49:12Z","updated_at":"2016-04-05T14:15:29Z","closed_at":null,"body":"I'm testing the synchronisation again with two other remote instances, one running 2.4.5 and the other one running the latest commit (2.4.17). I've created an event with distribution \"Connected communities\" and clicked on publish and it was properly pushed to the instance running 2.4.5 but not to the one running 2.4.17. In my logs I see the following:\r\n\r\n$ tail -f resque-worker-error.log resque-2016-02-12.log resque-scheduler-2016-02-05.log error.log debug.log error.log -n 20 | grep '2016-02-12 10'\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Notice: Undefined variable: remoteId in [/var/www/MISP/app/Model/Event.php, line 685]\r\n[2016-02-12 10:02:33] main.INFO: got {\"queue\":\"default\",\"id\":\"7b18a9c56f2ecfaf0c36adb92185c3cf\",\"class\":\"EventShell\",\"args\":[[\"publish\",\"2133\",null,\"5522\",\"1\"]]} {\"type\":\"got\",\"args\":\"[object] (Resque_Job: {\\\"queue\\\":\\\"default\\\",\\\"id\\\":\\\"7b18a9c56f2ecfaf0c36adb92185c3cf\\\",\\\"class\\\":\\\"EventShell\\\",\\\"args\\\":[[\\\"publish\\\",\\\"2133\\\",null,\\\"5522\\\",\\\"1\\\"]]})\",\"worker\":\"misp.my.org:1593\"} []\r\n[2016-02-12 10:02:33] main.INFO: Processing ID:7b18a9c56f2ecfaf0c36adb92185c3cf in default {\"type\":\"process\",\"worker\":\"misp.my.org:1593\",\"job_id\":\"7b18a9c56f2ecfaf0c36adb92185c3cf\"} []\r\n[2016-02-12 10:02:36] main.INFO: got {\"queue\":\"email\",\"id\":\"5e4e4327c1978bd9130e042a69022fd1\",\"class\":\"EventShell\",\"args\":[[\"alertemail\",\"1\",\"5521\",\"2133\"]]} {\"type\":\"got\",\"args\":\"[object] (Resque_Job: {\\\"queue\\\":\\\"email\\\",\\\"id\\\":\\\"5e4e4327c1978bd9130e042a69022fd1\\\",\\\"class\\\":\\\"EventShell\\\",\\\"args\\\":[[\\\"alertemail\\\",\\\"1\\\",\\\"5521\\\",\\\"2133\\\"]]})\",\"worker\":\"misp.my.org:1633\"} []\r\n[2016-02-12 10:02:36] main.INFO: Processing ID:5e4e4327c1978bd9130e042a69022fd1 in email {\"type\":\"process\",\"worker\":\"misp.my.org:1633\",\"job_id\":\"5e4e4327c1978bd9130e042a69022fd1\"} []\r\n[2016-02-12 10:02:36] main.INFO: done ID:7b18a9c56f2ecfaf0c36adb92185c3cf {\"type\":\"done\",\"job_id\":\"7b18a9c56f2ecfaf0c36adb92185c3cf\",\"time\":3119,\"worker\":\"misp.my.org:1593\"} []\r\n[2016-02-12 10:02:36] main.INFO: done ID:5e4e4327c1978bd9130e042a69022fd1 {\"type\":\"done\",\"job_id\":\"5e4e4327c1978bd9130e042a69022fd1\",\"time\":129,\"worker\":\"misp.my.org:1633\"} []\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Notice: Undefined variable: remoteId in [/var/www/MISP/app/Model/Event.php, line 685]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n2016-02-12 10:02:33 Warning: Invalid argument supplied for foreach() in [/var/www/MISP/app/Model/Event.php, line 678]\r\n\r\n\r\nI've also created another event using a sharing group involving the remote instance running 2.4.17 and published it. I see no errors in my logs but I don't see the event on the remote instance either.\r\n\r\n$ tail -f resque-worker-error.log resque-2016-02-12.log resque-scheduler-2016-02-05.log error.log debug.log error.log -n 20 | grep '2016-02-12 10:15'\r\n[2016-02-12 10:15:06] main.INFO: got {\"queue\":\"default\",\"id\":\"3ccde8d1c0c2517d97799f6aa28002c0\",\"class\":\"EventShell\",\"args\":[[\"publish\",\"2134\",null,\"5524\",\"1\"]]} {\"type\":\"got\",\"args\":\"[object] (Resque_Job: {\\\"queue\\\":\\\"default\\\",\\\"id\\\":\\\"3ccde8d1c0c2517d97799f6aa28002c0\\\",\\\"class\\\":\\\"EventShell\\\",\\\"args\\\":[[\\\"publish\\\",\\\"2134\\\",null,\\\"5524\\\",\\\"1\\\"]]})\",\"worker\":\"misp.my.org:1593\"} []\r\n[2016-02-12 10:15:06] main.INFO: got {\"queue\":\"email\",\"id\":\"8085f0eab777c0810cce62b8c8778284\",\"class\":\"EventShell\",\"args\":[[\"alertemail\",\"1\",\"5523\",\"2134\"]]} {\"type\":\"got\",\"args\":\"[object] (Resque_Job: {\\\"queue\\\":\\\"email\\\",\\\"id\\\":\\\"8085f0eab777c0810cce62b8c8778284\\\",\\\"class\\\":\\\"EventShell\\\",\\\"args\\\":[[\\\"alertemail\\\",\\\"1\\\",\\\"5523\\\",\\\"2134\\\"]]})\",\"worker\":\"misp.my.org:1633\"} []\r\n[2016-02-12 10:15:06] main.INFO: Processing ID:3ccde8d1c0c2517d97799f6aa28002c0 in default {\"type\":\"process\",\"worker\":\"misp.my.org:1593\",\"job_id\":\"3ccde8d1c0c2517d97799f6aa28002c0\"} []\r\n[2016-02-12 10:15:06] main.INFO: Processing ID:8085f0eab777c0810cce62b8c8778284 in email {\"type\":\"process\",\"worker\":\"misp.my.org:1633\",\"job_id\":\"8085f0eab777c0810cce62b8c8778284\"} []\r\n[2016-02-12 10:15:06] main.INFO: done ID:8085f0eab777c0810cce62b8c8778284 {\"type\":\"done\",\"job_id\":\"8085f0eab777c0810cce62b8c8778284\",\"time\":132,\"worker\":\"misp.my.org:1633\"} []\r\n[2016-02-12 10:15:08] main.INFO: done ID:3ccde8d1c0c2517d97799f6aa28002c0 {\"type\":\"done\",\"job_id\":\"3ccde8d1c0c2517d97799f6aa28002c0\",\"time\":2389,\"worker\":\"misp.my.org:1593\"} []\r\n\r\nOn the side of the instance running 2.4.17, the following can be seen in the logs:\r\n\r\n2016-02-12 10:14:43 Error: [MethodNotAllowedException] Invalid Sharing Group or not authorised. (Sync user is not contained in the Sharing group)\r\nRequest URL: /events\r\nStack Trace:\r\n#0 [internal function]: EventsController->add()\r\n#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(490): ReflectionMethod->invokeArgs(Object(EventsController), Array)\r\n#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(185): Controller->invokeAction(Object(CakeRequest))\r\n#3 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(160): Dispatcher->_invoke(Object(EventsController), Object(CakeRequest), Object(CakeResponse))\r\n#4 /var/www/MISP/app/webroot/index.php(92): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))\r\n#5 {main}\r\n\r\n2016-02-12 10:02:10 Notice: Notice (8): Undefined index: distribution in [/var/www/MISP/app/Model/Event.php, line 1702]\r\nTrace:\r\nEvent::__captureObjects() - APP/Model/Event.php, line 1702\r\nEvent::_add() - APP/Model/Event.php, line 1807\r\nEventsController::add() - APP/Controller/EventsController.php, line 893\r\nReflectionMethod::invokeArgs() - [internal], line ??\r\nController::invokeAction() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 490\r\nDispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 185\r\nDispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 160\r\n[main] - APP/webroot/index.php, line 92\r\n\r\n2016-02-12 10:02:10 Notice: Notice (8): Undefined index: distribution in [/var/www/MISP/app/Model/Event.php, line 1713]\r\nTrace:\r\nEvent::__captureObjects() - APP/Model/Event.php, line 1713\r\nEvent::_add() - APP/Model/Event.php, line 1807\r\nEventsController::add() - APP/Controller/EventsController.php, line 893\r\nReflectionMethod::invokeArgs() - [internal], line ??\r\nController::invokeAction() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 490\r\nDispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 185\r\nDispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 160\r\n[main] - APP/webroot/index.php, line 92\r\n\r\n\r\nOn all instances I'm synchronising with, the organisation name and UUID is the same and match the ones defines on my own instance. Funny enough, those two remote instances are getting events from my instance with distribution \"All communities\".  My instance is running 2.4.17 with the latest commit (f81960f)\r\n"},"comment":{"url":"https://api.github.com/repos/MISP/MISP/issues/comments/205828797","html_url":"https://github.com/MISP/MISP/issues/935#issuecomment-205828797","issue_url":"https://api.github.com/repos/MISP/MISP/issues/935","id":205828797,"user":{"login":"h122015","id":16301608,"avatar_url":"https://avatars.githubusercontent.com/u/16301608?v=3","gravatar_id":"","url":"https://api.github.com/users/h122015","html_url":"https://github.com/h122015","followers_url":"https://api.github.com/users/h122015/followers","following_url":"https://api.github.com/users/h122015/following{/other_user}","gists_url":"https://api.github.com/users/h122015/gists{/gist_id}","starred_url":"https://api.github.com/users/h122015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h122015/subscriptions","organizations_url":"https://api.github.com/users/h122015/orgs","repos_url":"https://api.github.com/users/h122015/repos","events_url":"https://api.github.com/users/h122015/events{/privacy}","received_events_url":"https://api.github.com/users/h122015/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T14:15:29Z","updated_at":"2016-04-05T14:15:29Z","body":"==> resque-2016-04-05.log <==\r\n[2016-04-05 16:13:54] main.INFO: got {\"queue\":\"email\",\"id\":\"b60b4e252f77e24f726ba706de09af41\",\"class\":\"EventShell\",\"args\":[[\"alertemail\",\"1\",\"7609\",\"2390\"]]} {\"type\":\"got\",\"args\":\"[object] (Resque_Job: {\\\"queue\\\":\\\"email\\\",\\\"id\\\":\\\"b60b4e252f77e24f726ba706de09af41\\\",\\\"class\\\":\\\"EventShell\\\",\\\"args\\\":[[\\\"alertemail\\\",\\\"1\\\",\\\"7609\\\",\\\"2390\\\"]]})\",\"worker\":\"misp.ip-plus.net:1633\"} []\r\n[2016-04-05 16:13:54] main.INFO: Processing ID:b60b4e252f77e24f726ba706de09af41 in email {\"type\":\"process\",\"worker\":\"misp.ip-plus.net:1633\",\"job_id\":\"b60b4e252f77e24f726ba706de09af41\"} []\r\n[2016-04-05 16:13:55] main.INFO: done ID:b60b4e252f77e24f726ba706de09af41 {\"type\":\"done\",\"job_id\":\"b60b4e252f77e24f726ba706de09af41\",\"time\":142,\"worker\":\"misp.ip-plus.net:1633\"} []\r\n[2016-04-05 16:13:58] main.INFO: got {\"queue\":\"default\",\"id\":\"99f6c3d3d4517312810b650c8330812f\",\"class\":\"EventShell\",\"args\":[[\"publish\",\"2390\",null,\"7610\",\"1\"]]} {\"type\":\"got\",\"args\":\"[object] (Resque_Job: {\\\"queue\\\":\\\"default\\\",\\\"id\\\":\\\"99f6c3d3d4517312810b650c8330812f\\\",\\\"class\\\":\\\"EventShell\\\",\\\"args\\\":[[\\\"publish\\\",\\\"2390\\\",null,\\\"7610\\\",\\\"1\\\"]]})\",\"worker\":\"misp.ip-plus.net:1593\"} []\r\n[2016-04-05 16:13:58] main.INFO: Processing ID:99f6c3d3d4517312810b650c8330812f in default {\"type\":\"process\",\"worker\":\"misp.ip-plus.net:1593\",\"job_id\":\"99f6c3d3d4517312810b650c8330812f\"} []\r\n[2016-04-05 16:14:02] main.INFO: done ID:99f6c3d3d4517312810b650c8330812f {\"type\":\"done\",\"job_id\":\"99f6c3d3d4517312810b650c8330812f\",\"time\":3482,\"worker\":\"misp.ip-plus.net:1593\"} []\r\n\r\nStill no event created on the remote instance using 2.4.31."}}