{"action":"opened","issue":{"url":"https://api.github.com/repos/jhuckaby/Cronicle/issues/66","repository_url":"https://api.github.com/repos/jhuckaby/Cronicle","labels_url":"https://api.github.com/repos/jhuckaby/Cronicle/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/jhuckaby/Cronicle/issues/66/comments","events_url":"https://api.github.com/repos/jhuckaby/Cronicle/issues/66/events","html_url":"https://github.com/jhuckaby/Cronicle/issues/66","id":331446156,"node_id":"MDU6SXNzdWUzMzE0NDYxNTY=","number":66,"title":"Crash: TypeError: Cannot read property 'test' of undefined","user":{"login":"dropthemic","id":20729448,"node_id":"MDQ6VXNlcjIwNzI5NDQ4","avatar_url":"https://avatars3.githubusercontent.com/u/20729448?v=4","gravatar_id":"","url":"https://api.github.com/users/dropthemic","html_url":"https://github.com/dropthemic","followers_url":"https://api.github.com/users/dropthemic/followers","following_url":"https://api.github.com/users/dropthemic/following{/other_user}","gists_url":"https://api.github.com/users/dropthemic/gists{/gist_id}","starred_url":"https://api.github.com/users/dropthemic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropthemic/subscriptions","organizations_url":"https://api.github.com/users/dropthemic/orgs","repos_url":"https://api.github.com/users/dropthemic/repos","events_url":"https://api.github.com/users/dropthemic/events{/privacy}","received_events_url":"https://api.github.com/users/dropthemic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-12T05:50:36Z","updated_at":"2018-06-12T05:50:36Z","closed_at":null,"author_association":"NONE","body":"<!-- Please provide the following information for your Cronicle issue. -->\r\n<!-- The more details I have, the more likely I can solve the problem. -->\r\n<!-- These HTML comments will not be visible in your bug report, so you can leave them in. -->\r\n\r\n## Summary\r\nCronicle crashes fatally when a child job does not exist. \r\n\r\nTo fix: \r\nhttps://github.com/jhuckaby/Cronicle/blob/06a6e6c4e6313c59cec6d434fe5d1104e6ca3c72/lib/scheduler.js#L285\r\n\r\nChange to:\r\n`if (err || event == null) {`\r\n\r\nIt would be helpful if you fixed the api add/update event to validate the chain and give hard error if child job doesn't exist.\r\n\r\n## Steps to reproduce the problem\r\n\r\n1. Create two jobs: job1 and job2. Make job2 run after job1 completes. \r\n2. Delete job2.\r\n3. Run job1. Crash.\r\n\r\n## Your Setup\r\n### Operating system and version?\r\nMacOS\r\n\r\n### Node.js version?\r\nv9.5\r\n\r\n### Cronicle software version?\r\n0.8.6\r\n\r\n### Are you using a multi-server setup, or just a single server?\r\nSingle\r\n\r\n### Are you using the filesystem as back-end storage, or S3/Couchbase?\r\nfs\r\n\r\n### Can you reproduce the crash consistently?\r\nYes\r\n\r\n## Log Excerpts\r\n\r\n> pixl-server-storage/list.js:610\r\n> \t\t\t\t\t\t\t\t\tif (criteria[k].test) {\r\n> \t\t\t\t\t\t\t\t\t                ^\r\n> \r\n> TypeError: Cannot read property 'test' of undefined\r\n>     at /Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:610:26\r\n>     at /Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:85:5\r\n>     at constructor.get (/Users/bman/git/Cronicle/node_modules/pixl-server-storage/storage.js:326:11)\r\n>     at constructor._listLoadPage (/Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:82:8)\r\n>     at /Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:604:12\r\n>     at Object.whilst (/Users/bman/git/Cronicle/node_modules/async/dist/async.js:5213:5)\r\n>     at /Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:601:11\r\n>     at /Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:58:5\r\n>     at constructor.get (/Users/bman/git/Cronicle/node_modules/pixl-server-storage/storage.js:326:11)\r\n>     at constructor._listLoad (/Users/bman/git/Cronicle/node_modules/pixl-server-storage/list.js:55:8)\r\n> "}}
{"actor":{"display_login":"dropthemic"}}