{"action":"created","comment":{"url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/comments/33215163","id":33215163,"diff_hunk":"@@ -480,3 +484,80 @@ def is_preferred(offered_challb, satisfied,\n                 different=True):\n             return False\n     return True\n+\n+\n+_ERROR_HELP_COMMON = (\n+    'To fix these errors, please make sure that your domain name was entered '\n+    'correctly and the DNS A/AAAA record(s) for that domain contains the '\n+    'right IP address.')\n+\n+\n+_ERROR_HELP = {\n+    'connection' :\n+        _ERROR_HELP_COMMON + ' Additionally, please check that your computer '\n+        'has publicly routable IP address and no firewalls are preventing the '\n+        'server from communicating with the client.',\n+    'dnssec' :\n+        _ERROR_HELP_COMMON + ' Additionally, if you have DNSSEC enabled for '\n+        'your domain, please ensure the signature is valid.',\n+    'malformed' :\n+        'To fix these errors, please make sure that you did not provide any '\n+        'invalid information to the client and try running Let\\'s Encrypt '\n+        'again.',\n+    'serverInternal' :\n+        'Unfortunately, an error on the ACME server prevented you from completing '\n+        'authorization. Please try again later.',\n+    'tls' :\n+        _ERROR_HELP_COMMON + ' Additionally, please check that you have an up '\n+        'to date TLS configuration that allows the server to communicate with '\n+        'the Let\\'s Encrypt client.',\n+    'unauthorized' : _ERROR_HELP_COMMON,\n+    'unknownHost' : _ERROR_HELP_COMMON,}\n+\n+\n+def _report_failed_challs(failed_achalls):\n+    \"\"\"Notifies the user about failed challenges.\n+\n+    :param set failed_achalls: A set of failed\n+        :class:`letsencrypt.achallenges.AnnotatedChallenge`.\n+\n+    \"\"\"\n+    problems = dict()\n+    for achall in failed_achalls:\n+        if achall.error:\n+            problems.setdefault(achall.error.typ, []).append(achall)\n+\n+    reporter = zope.component.getUtility(interfaces.IReporter)\n+    for achalls in problems.itervalues():\n+        reporter.add_message(\n+            _generate_failed_chall_msg(achalls), reporter.MEDIUM_PRIORITY, True)\n+\n+\n+def _generate_failed_chall_msg(failed_achalls):\n+    \"\"\"Creates a user friendly error message about failed challenges.\n+\n+    :param list failed_achalls: A list of failed\n+        :class:`letsencrypt.achallenges.AnnotatedChallenge` with the same error\n+        type.\n+\n+    :returns: A formatted error message for the client.\n+    :rtype: str\n+\n+    \"\"\"\n+    typ = failed_achalls[0].error.typ\n+    msg = [\n+        \"The following '{0}' errors were reported by the server:\".format(typ)]\n+\n+    problems = dict()\n+    for achall in failed_achalls:\n+        problems.setdefault(achall.error.description, set()).add(achall.domain)\n+    for problem in problems:\n+        msg.append('\\n\\nDomains: ')\n+        msg.append(', '.join(sorted(problems[problem])))\n+        msg.append('\\nError: {0}'.format(problem))\n+\n+    if typ in _ERROR_HELP:\n+        msg.append('\\n\\n')\n+        msg.append(_ERROR_HELP[typ])","path":"letsencrypt/auth_handler.py","position":null,"original_position":102,"commit_id":"f35d8a5228bb825470bac4ab048ee711119742f5","original_commit_id":"76d12e5e346a1b11f9fe03817ea268ca6750d8b6","user":{"login":"bradmw","id":6504915,"avatar_url":"https://avatars.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bradmw","html_url":"https://github.com/bradmw","followers_url":"https://api.github.com/users/bradmw/followers","following_url":"https://api.github.com/users/bradmw/following{/other_user}","gists_url":"https://api.github.com/users/bradmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bradmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradmw/subscriptions","organizations_url":"https://api.github.com/users/bradmw/orgs","repos_url":"https://api.github.com/users/bradmw/repos","events_url":"https://api.github.com/users/bradmw/events{/privacy}","received_events_url":"https://api.github.com/users/bradmw/received_events","type":"User","site_admin":false},"body":"No problem! Just wanted to make sure we were on the same page.","created_at":"2015-06-25T01:28:42Z","updated_at":"2015-06-25T01:28:42Z","html_url":"https://github.com/letsencrypt/letsencrypt/pull/547#discussion_r33215163","pull_request_url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547","_links":{"self":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/comments/33215163"},"html":{"href":"https://github.com/letsencrypt/letsencrypt/pull/547#discussion_r33215163"},"pull_request":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547"}}},"pull_request":{"url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547","id":38496589,"html_url":"https://github.com/letsencrypt/letsencrypt/pull/547","diff_url":"https://github.com/letsencrypt/letsencrypt/pull/547.diff","patch_url":"https://github.com/letsencrypt/letsencrypt/pull/547.patch","issue_url":"https://api.github.com/repos/letsencrypt/letsencrypt/issues/547","number":547,"state":"open","locked":false,"title":"Validation errors","user":{"login":"bradmw","id":6504915,"avatar_url":"https://avatars.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bradmw","html_url":"https://github.com/bradmw","followers_url":"https://api.github.com/users/bradmw/followers","following_url":"https://api.github.com/users/bradmw/following{/other_user}","gists_url":"https://api.github.com/users/bradmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bradmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradmw/subscriptions","organizations_url":"https://api.github.com/users/bradmw/orgs","repos_url":"https://api.github.com/users/bradmw/repos","events_url":"https://api.github.com/users/bradmw/events{/privacy}","received_events_url":"https://api.github.com/users/bradmw/received_events","type":"User","site_admin":false},"body":"This builds off #536 and should close #350. Now when the client fails authorization challenges, output such as the following is generated:\r\n\r\n>IMPORTANT NOTES:\r\n> - The following 'unauthorized' errors were reported by the server:\r\n>\r\n>   Domains: letsencrypt.org\r\n>   Error: The client lacks sufficient authorization\r\n>\r\n>   To fix these errors, please make sure that your domain name was \r\n>   entered correctly and the DNS A/AAAA record(s) for that domain\r\n>   contains the right IP address.\r\n> - The following 'unknownHost' errors were reported by the server:\r\n>\r\n>   Domains: bar.bar, foo.foo\r\n>   Error: The server could not resolve a domain name\r\n>\r\n>   To fix these errors, please make sure that your domain name was \r\n>   entered correctly and the DNS A/AAAA record(s) for that domain\r\n>   contains the right IP address.\r\n\r\nThe messages I wrote for each error type can be found in auth_handler.py. If anyone has any ideas about how to better present these errors to the user, let me know and I'll be happy to implement them.","created_at":"2015-06-24T22:55:31Z","updated_at":"2015-06-25T01:28:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e75d518aa3816128385759a76bd3b004010fb18c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547/commits","review_comments_url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547/comments","review_comment_url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/letsencrypt/letsencrypt/issues/547/comments","statuses_url":"https://api.github.com/repos/letsencrypt/letsencrypt/statuses/f35d8a5228bb825470bac4ab048ee711119742f5","head":{"label":"bradmw:errors","ref":"errors","sha":"f35d8a5228bb825470bac4ab048ee711119742f5","user":{"login":"bradmw","id":6504915,"avatar_url":"https://avatars.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bradmw","html_url":"https://github.com/bradmw","followers_url":"https://api.github.com/users/bradmw/followers","following_url":"https://api.github.com/users/bradmw/following{/other_user}","gists_url":"https://api.github.com/users/bradmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bradmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradmw/subscriptions","organizations_url":"https://api.github.com/users/bradmw/orgs","repos_url":"https://api.github.com/users/bradmw/repos","events_url":"https://api.github.com/users/bradmw/events{/privacy}","received_events_url":"https://api.github.com/users/bradmw/received_events","type":"User","site_admin":false},"repo":{"id":37490368,"name":"lets-encrypt-preview","full_name":"bradmw/lets-encrypt-preview","owner":{"login":"bradmw","id":6504915,"avatar_url":"https://avatars.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bradmw","html_url":"https://github.com/bradmw","followers_url":"https://api.github.com/users/bradmw/followers","following_url":"https://api.github.com/users/bradmw/following{/other_user}","gists_url":"https://api.github.com/users/bradmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bradmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradmw/subscriptions","organizations_url":"https://api.github.com/users/bradmw/orgs","repos_url":"https://api.github.com/users/bradmw/repos","events_url":"https://api.github.com/users/bradmw/events{/privacy}","received_events_url":"https://api.github.com/users/bradmw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bradmw/lets-encrypt-preview","description":"An ACME client that can update Apache/nginx configurations (developer preview) ","fork":true,"url":"https://api.github.com/repos/bradmw/lets-encrypt-preview","forks_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/forks","keys_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/teams","hooks_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/hooks","issue_events_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/issues/events{/number}","events_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/events","assignees_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/assignees{/user}","branches_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/branches{/branch}","tags_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/tags","blobs_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/git/refs{/sha}","trees_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/statuses/{sha}","languages_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/languages","stargazers_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/stargazers","contributors_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/contributors","subscribers_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/subscribers","subscription_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/subscription","commits_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/commits{/sha}","git_commits_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/git/commits{/sha}","comments_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/comments{/number}","issue_comment_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/issues/comments{/number}","contents_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/contents/{+path}","compare_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/merges","archive_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/downloads","issues_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/issues{/number}","pulls_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/pulls{/number}","milestones_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/milestones{/number}","notifications_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/labels{/name}","releases_url":"https://api.github.com/repos/bradmw/lets-encrypt-preview/releases{/id}","created_at":"2015-06-15T20:45:56Z","updated_at":"2015-06-15T20:45:57Z","pushed_at":"2015-06-25T01:28:11Z","git_url":"git://github.com/bradmw/lets-encrypt-preview.git","ssh_url":"git@github.com:bradmw/lets-encrypt-preview.git","clone_url":"https://github.com/bradmw/lets-encrypt-preview.git","svn_url":"https://github.com/bradmw/lets-encrypt-preview","homepage":"","size":3554,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"letsencrypt:master","ref":"master","sha":"138ebc6d4e1c838af937bbb14074a83397b82f0b","user":{"login":"letsencrypt","id":9289019,"avatar_url":"https://avatars.githubusercontent.com/u/9289019?v=3","gravatar_id":"","url":"https://api.github.com/users/letsencrypt","html_url":"https://github.com/letsencrypt","followers_url":"https://api.github.com/users/letsencrypt/followers","following_url":"https://api.github.com/users/letsencrypt/following{/other_user}","gists_url":"https://api.github.com/users/letsencrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/letsencrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letsencrypt/subscriptions","organizations_url":"https://api.github.com/users/letsencrypt/orgs","repos_url":"https://api.github.com/users/letsencrypt/repos","events_url":"https://api.github.com/users/letsencrypt/events{/privacy}","received_events_url":"https://api.github.com/users/letsencrypt/received_events","type":"Organization","site_admin":false},"repo":{"id":26516210,"name":"letsencrypt","full_name":"letsencrypt/letsencrypt","owner":{"login":"letsencrypt","id":9289019,"avatar_url":"https://avatars.githubusercontent.com/u/9289019?v=3","gravatar_id":"","url":"https://api.github.com/users/letsencrypt","html_url":"https://github.com/letsencrypt","followers_url":"https://api.github.com/users/letsencrypt/followers","following_url":"https://api.github.com/users/letsencrypt/following{/other_user}","gists_url":"https://api.github.com/users/letsencrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/letsencrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letsencrypt/subscriptions","organizations_url":"https://api.github.com/users/letsencrypt/orgs","repos_url":"https://api.github.com/users/letsencrypt/repos","events_url":"https://api.github.com/users/letsencrypt/events{/privacy}","received_events_url":"https://api.github.com/users/letsencrypt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/letsencrypt/letsencrypt","description":"An ACME client that can update Apache/nginx configurations (developer preview) ","fork":false,"url":"https://api.github.com/repos/letsencrypt/letsencrypt","forks_url":"https://api.github.com/repos/letsencrypt/letsencrypt/forks","keys_url":"https://api.github.com/repos/letsencrypt/letsencrypt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/letsencrypt/letsencrypt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/letsencrypt/letsencrypt/teams","hooks_url":"https://api.github.com/repos/letsencrypt/letsencrypt/hooks","issue_events_url":"https://api.github.com/repos/letsencrypt/letsencrypt/issues/events{/number}","events_url":"https://api.github.com/repos/letsencrypt/letsencrypt/events","assignees_url":"https://api.github.com/repos/letsencrypt/letsencrypt/assignees{/user}","branches_url":"https://api.github.com/repos/letsencrypt/letsencrypt/branches{/branch}","tags_url":"https://api.github.com/repos/letsencrypt/letsencrypt/tags","blobs_url":"https://api.github.com/repos/letsencrypt/letsencrypt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/letsencrypt/letsencrypt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/letsencrypt/letsencrypt/git/refs{/sha}","trees_url":"https://api.github.com/repos/letsencrypt/letsencrypt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/letsencrypt/letsencrypt/statuses/{sha}","languages_url":"https://api.github.com/repos/letsencrypt/letsencrypt/languages","stargazers_url":"https://api.github.com/repos/letsencrypt/letsencrypt/stargazers","contributors_url":"https://api.github.com/repos/letsencrypt/letsencrypt/contributors","subscribers_url":"https://api.github.com/repos/letsencrypt/letsencrypt/subscribers","subscription_url":"https://api.github.com/repos/letsencrypt/letsencrypt/subscription","commits_url":"https://api.github.com/repos/letsencrypt/letsencrypt/commits{/sha}","git_commits_url":"https://api.github.com/repos/letsencrypt/letsencrypt/git/commits{/sha}","comments_url":"https://api.github.com/repos/letsencrypt/letsencrypt/comments{/number}","issue_comment_url":"https://api.github.com/repos/letsencrypt/letsencrypt/issues/comments{/number}","contents_url":"https://api.github.com/repos/letsencrypt/letsencrypt/contents/{+path}","compare_url":"https://api.github.com/repos/letsencrypt/letsencrypt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/letsencrypt/letsencrypt/merges","archive_url":"https://api.github.com/repos/letsencrypt/letsencrypt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/letsencrypt/letsencrypt/downloads","issues_url":"https://api.github.com/repos/letsencrypt/letsencrypt/issues{/number}","pulls_url":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls{/number}","milestones_url":"https://api.github.com/repos/letsencrypt/letsencrypt/milestones{/number}","notifications_url":"https://api.github.com/repos/letsencrypt/letsencrypt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/letsencrypt/letsencrypt/labels{/name}","releases_url":"https://api.github.com/repos/letsencrypt/letsencrypt/releases{/id}","created_at":"2014-11-12T02:52:20Z","updated_at":"2015-06-25T00:39:53Z","pushed_at":"2015-06-25T01:28:11Z","git_url":"git://github.com/letsencrypt/letsencrypt.git","ssh_url":"git@github.com:letsencrypt/letsencrypt.git","clone_url":"https://github.com/letsencrypt/letsencrypt.git","svn_url":"https://github.com/letsencrypt/letsencrypt","homepage":"","size":7421,"stargazers_count":2485,"watchers_count":2485,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":131,"forks":188,"open_issues":131,"watchers":2485,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547"},"html":{"href":"https://github.com/letsencrypt/letsencrypt/pull/547"},"issue":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/issues/547"},"comments":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/issues/547/comments"},"review_comments":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547/comments"},"review_comment":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/pulls/547/commits"},"statuses":{"href":"https://api.github.com/repos/letsencrypt/letsencrypt/statuses/f35d8a5228bb825470bac4ab048ee711119742f5"}}}}