{"action":"created","issue":{"url":"https://api.github.com/repos/cuckoobox/cuckoo/issues/624","labels_url":"https://api.github.com/repos/cuckoobox/cuckoo/issues/624/labels{/name}","comments_url":"https://api.github.com/repos/cuckoobox/cuckoo/issues/624/comments","events_url":"https://api.github.com/repos/cuckoobox/cuckoo/issues/624/events","html_url":"https://github.com/cuckoobox/cuckoo/issues/624","id":101656616,"number":624,"title":"Deleting analysis through REST API also deletes machines from the DB","user":{"login":"mkmanwich","id":13657366,"avatar_url":"https://avatars.githubusercontent.com/u/13657366?v=3","gravatar_id":"","url":"https://api.github.com/users/mkmanwich","html_url":"https://github.com/mkmanwich","followers_url":"https://api.github.com/users/mkmanwich/followers","following_url":"https://api.github.com/users/mkmanwich/following{/other_user}","gists_url":"https://api.github.com/users/mkmanwich/gists{/gist_id}","starred_url":"https://api.github.com/users/mkmanwich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkmanwich/subscriptions","organizations_url":"https://api.github.com/users/mkmanwich/orgs","repos_url":"https://api.github.com/users/mkmanwich/repos","events_url":"https://api.github.com/users/mkmanwich/events{/privacy}","received_events_url":"https://api.github.com/users/mkmanwich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-18T13:37:24Z","updated_at":"2015-08-18T20:52:51Z","closed_at":null,"body":"Hi,\r\nWhen I delete an analysis using the REST API:\r\ncurl http://localhost:8090/tasks/delete/1\r\nIt also deletes all the machines that have the same tag as the deleted analysis.\r\nWhen doing a machines/list API request it had some missing machines.\r\n\r\nI confirmed it by using cuckoo with MySQL and deleting an analysis.\r\nAfter delete, the \"machines\" table in the DB doesn't contain anymore all the machines that have the same tags as the analysis. (before delete it had 9 machines, now it has 4).\r\nSo its a real issue, caused by a faulty delete sql command that is sent to the DB when calling the delete API.\r\n\r\nIt's worth mentioning that restarting cuckoo \"solves\" the problem since it parses the configuration file again and adds all machines back.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cuckoobox/cuckoo/issues/comments/132347448","html_url":"https://github.com/cuckoobox/cuckoo/issues/624#issuecomment-132347448","issue_url":"https://api.github.com/repos/cuckoobox/cuckoo/issues/624","id":132347448,"user":{"login":"jbremer","id":1148773,"avatar_url":"https://avatars.githubusercontent.com/u/1148773?v=3","gravatar_id":"","url":"https://api.github.com/users/jbremer","html_url":"https://github.com/jbremer","followers_url":"https://api.github.com/users/jbremer/followers","following_url":"https://api.github.com/users/jbremer/following{/other_user}","gists_url":"https://api.github.com/users/jbremer/gists{/gist_id}","starred_url":"https://api.github.com/users/jbremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbremer/subscriptions","organizations_url":"https://api.github.com/users/jbremer/orgs","repos_url":"https://api.github.com/users/jbremer/repos","events_url":"https://api.github.com/users/jbremer/events{/privacy}","received_events_url":"https://api.github.com/users/jbremer/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T20:52:51Z","updated_at":"2015-08-18T20:52:51Z","body":"As @KillerInstinct said this is a duplicate of #573. I'll be pushing the proposed patch upstream soon! :)"}}