{"action":"created","issue":{"url":"https://api.github.com/repos/kelseyhightower/confd/issues/216","repository_url":"https://api.github.com/repos/kelseyhightower/confd","labels_url":"https://api.github.com/repos/kelseyhightower/confd/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/kelseyhightower/confd/issues/216/comments","events_url":"https://api.github.com/repos/kelseyhightower/confd/issues/216/events","html_url":"https://github.com/kelseyhightower/confd/issues/216","id":59841970,"number":216,"title":"Key Not Found Stops Template ","user":{"login":"mpchlets","id":826638,"avatar_url":"https://avatars.githubusercontent.com/u/826638?v=3","gravatar_id":"","url":"https://api.github.com/users/mpchlets","html_url":"https://github.com/mpchlets","followers_url":"https://api.github.com/users/mpchlets/followers","following_url":"https://api.github.com/users/mpchlets/following{/other_user}","gists_url":"https://api.github.com/users/mpchlets/gists{/gist_id}","starred_url":"https://api.github.com/users/mpchlets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpchlets/subscriptions","organizations_url":"https://api.github.com/users/mpchlets/orgs","repos_url":"https://api.github.com/users/mpchlets/repos","events_url":"https://api.github.com/users/mpchlets/events{/privacy}","received_events_url":"https://api.github.com/users/mpchlets/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kelseyhightower/confd/labels/resource/template","name":"resource/template","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-03-04T18:46:02Z","updated_at":"2016-02-24T18:46:37Z","closed_at":"2016-02-24T07:28:26Z","body":"When a key is missing or not found, the entire template stops processing. I saw there was an old issue about this and it was decided to continue generating the template - was that abandoned?\r\n\r\nI am doing:\r\n\r\n{{range $server := gets \"/servers/*\"}}\r\n\r\nIf the /servers/ directory is empty, I get:\r\n\r\nexecuting \"haproxy.cfg.tmpl\" at <gets \"/servers/...>: error calling gets: no keys match\r\n\r\nconfd then stops processing.\r\n\r\nI would expect this to continue executing and throw the error or have a way for me to check that keys exists in there before running the gets. exists does not work because I will not know what would or would not exist in that servers dir."},"comment":{"url":"https://api.github.com/repos/kelseyhightower/confd/issues/comments/188401352","html_url":"https://github.com/kelseyhightower/confd/issues/216#issuecomment-188401352","issue_url":"https://api.github.com/repos/kelseyhightower/confd/issues/216","id":188401352,"user":{"login":"mpchlets","id":826638,"avatar_url":"https://avatars.githubusercontent.com/u/826638?v=3","gravatar_id":"","url":"https://api.github.com/users/mpchlets","html_url":"https://github.com/mpchlets","followers_url":"https://api.github.com/users/mpchlets/followers","following_url":"https://api.github.com/users/mpchlets/following{/other_user}","gists_url":"https://api.github.com/users/mpchlets/gists{/gist_id}","starred_url":"https://api.github.com/users/mpchlets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpchlets/subscriptions","organizations_url":"https://api.github.com/users/mpchlets/orgs","repos_url":"https://api.github.com/users/mpchlets/repos","events_url":"https://api.github.com/users/mpchlets/events{/privacy}","received_events_url":"https://api.github.com/users/mpchlets/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T18:46:37Z","updated_at":"2016-02-24T18:46:37Z","body":"@kelseyhightower using `exists` or `ls`/`lsdir` does not solve the race condition of a key getting removed between the two - I would not want my template to crash because of a race condition."}}