{"action":"opened","issue":{"url":"https://api.github.com/repos/idea2-platform/pepito-test/issues/110","repository_url":"https://api.github.com/repos/idea2-platform/pepito-test","labels_url":"https://api.github.com/repos/idea2-platform/pepito-test/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/idea2-platform/pepito-test/issues/110/comments","events_url":"https://api.github.com/repos/idea2-platform/pepito-test/issues/110/events","html_url":"https://github.com/idea2-platform/pepito-test/issues/110","id":168784461,"number":110,"title":"IP-3922. Problem in router with some requests","user":{"login":"idea2-pepito","id":20704124,"avatar_url":"https://avatars.githubusercontent.com/u/20704124?v=3","gravatar_id":"","url":"https://api.github.com/users/idea2-pepito","html_url":"https://github.com/idea2-pepito","followers_url":"https://api.github.com/users/idea2-pepito/followers","following_url":"https://api.github.com/users/idea2-pepito/following{/other_user}","gists_url":"https://api.github.com/users/idea2-pepito/gists{/gist_id}","starred_url":"https://api.github.com/users/idea2-pepito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idea2-pepito/subscriptions","organizations_url":"https://api.github.com/users/idea2-pepito/orgs","repos_url":"https://api.github.com/users/idea2-pepito/repos","events_url":"https://api.github.com/users/idea2-pepito/events{/privacy}","received_events_url":"https://api.github.com/users/idea2-pepito/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/idea2-platform/pepito-test/labels/state/released","name":"state/released","color":"e6e6e6"},{"url":"https://api.github.com/repos/idea2-platform/pepito-test/labels/type/bug","name":"type/bug","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"dgaviola","id":190500,"avatar_url":"https://avatars.githubusercontent.com/u/190500?v=3","gravatar_id":"","url":"https://api.github.com/users/dgaviola","html_url":"https://github.com/dgaviola","followers_url":"https://api.github.com/users/dgaviola/followers","following_url":"https://api.github.com/users/dgaviola/following{/other_user}","gists_url":"https://api.github.com/users/dgaviola/gists{/gist_id}","starred_url":"https://api.github.com/users/dgaviola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgaviola/subscriptions","organizations_url":"https://api.github.com/users/dgaviola/orgs","repos_url":"https://api.github.com/users/dgaviola/repos","events_url":"https://api.github.com/users/dgaviola/events{/privacy}","received_events_url":"https://api.github.com/users/dgaviola/received_events","type":"User","site_admin":false},"assignees":[{"login":"dgaviola","id":190500,"avatar_url":"https://avatars.githubusercontent.com/u/190500?v=3","gravatar_id":"","url":"https://api.github.com/users/dgaviola","html_url":"https://github.com/dgaviola","followers_url":"https://api.github.com/users/dgaviola/followers","following_url":"https://api.github.com/users/dgaviola/following{/other_user}","gists_url":"https://api.github.com/users/dgaviola/gists{/gist_id}","starred_url":"https://api.github.com/users/dgaviola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgaviola/subscriptions","organizations_url":"https://api.github.com/users/dgaviola/orgs","repos_url":"https://api.github.com/users/dgaviola/repos","events_url":"https://api.github.com/users/dgaviola/events{/privacy}","received_events_url":"https://api.github.com/users/dgaviola/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/idea2-platform/pepito-test/milestones/7","html_url":"https://github.com/idea2-platform/pepito-test/milestones/iteration%20118","labels_url":"https://api.github.com/repos/idea2-platform/pepito-test/milestones/7/labels","id":1896841,"number":7,"title":"iteration 118","description":"","creator":{"login":"dgaviola","id":190500,"avatar_url":"https://avatars.githubusercontent.com/u/190500?v=3","gravatar_id":"","url":"https://api.github.com/users/dgaviola","html_url":"https://github.com/dgaviola","followers_url":"https://api.github.com/users/dgaviola/followers","following_url":"https://api.github.com/users/dgaviola/following{/other_user}","gists_url":"https://api.github.com/users/dgaviola/gists{/gist_id}","starred_url":"https://api.github.com/users/dgaviola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgaviola/subscriptions","organizations_url":"https://api.github.com/users/dgaviola/orgs","repos_url":"https://api.github.com/users/dgaviola/repos","events_url":"https://api.github.com/users/dgaviola/events{/privacy}","received_events_url":"https://api.github.com/users/dgaviola/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"closed","created_at":"2016-07-21T15:35:48Z","updated_at":"2016-08-02T02:14:51Z","due_on":null,"closed_at":"2016-07-21T15:35:48Z"},"comments":0,"created_at":"2016-08-02T02:14:51Z","updated_at":"2016-08-02T02:14:51Z","closed_at":null,"body":"Joe was having issues with the Docusign endpoint webhooks. After some investigation we figured out the issue was that Idea2 was closing the connection due to an error. Looking at the router logs we found this:\r\n\r\n```\r\n*http*outgoing.js:335\r\n    throw new Error('Can\\'t set headers after they are sent.');\r\n          ^\r\nError: Can't set headers after they are sent.\r\n    at ClientRequest.OutgoingMessage.setHeader (*http*outgoing.js:335:11)\r\n    at ProxyServer.<anonymous> (/app/router.js:90:18)\r\n    at ProxyServer.emit (/app/node*modules/http-proxy/node*modules/eventemitter3/index.js:119:35)\r\n    at ClientRequest.<anonymous> (/app/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:114:27)\r\n    at ClientRequest.emit (events.js:129:20)\r\n    at tickOnSocket (*http*client.js:493:7)\r\n    at *http*client.js:504:7\r\n    at process._tickCallback (node.js:355:11)\r\n```\r\n\r\nSo the problem seems to be that we are setting headers after they sent. Checking the code this headers are not needed anymore because they were there for the time we had custom domains working alongside with the old domain. Now that each app has it's own resources and handle only one app, we don't need to pass this information anymore.\r\n\r\nYou can reproduce the error by making this call:\r\n\r\n```\r\ncurl -vX POST -H \"content-type: text/xml; charset=utf-8\" \"https://foto.idea2.io/prod/endpoints/docusign\" --data \"@doctest.xml\"\r\n```\r\n\r\nYou need to have the attached file in the current directory where you are executing the command.\n\n**Attachments**\n\n[doctest.xml](https://pepito.idea2.io/dev/runtime/api/files/57a0021ae4b039556a4bf9e7)\n"}}
{"actor":{"display_login":"idea2-pepito"}}