{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/737","repository_url":"https://api.github.com/repos/Microsoft/vsts-agent","labels_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/737/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/737/comments","events_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/737/events","html_url":"https://github.com/Microsoft/vsts-agent/issues/737","id":197903033,"number":737,"title":"Agent fails to fetch sources when a task is re-using the GitHub service endpoint","user":{"login":"jessehouwing","id":4173387,"avatar_url":"https://avatars.githubusercontent.com/u/4173387?v=3","gravatar_id":"","url":"https://api.github.com/users/jessehouwing","html_url":"https://github.com/jessehouwing","followers_url":"https://api.github.com/users/jessehouwing/followers","following_url":"https://api.github.com/users/jessehouwing/following{/other_user}","gists_url":"https://api.github.com/users/jessehouwing/gists{/gist_id}","starred_url":"https://api.github.com/users/jessehouwing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessehouwing/subscriptions","organizations_url":"https://api.github.com/users/jessehouwing/orgs","repos_url":"https://api.github.com/users/jessehouwing/repos","events_url":"https://api.github.com/users/jessehouwing/events{/privacy}","received_events_url":"https://api.github.com/users/jessehouwing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-28T19:21:30Z","updated_at":"2016-12-28T19:35:43Z","closed_at":null,"body":"## **Agent version and platform**\r\nVersion of your agent?\r\n2.107.0.\r\n\r\nOS of the machine running the agent? OSX/Windows/Linux...\r\nWindows\r\n\r\n## **VSTS type and version**\r\nVisualStudio.com \r\nIf VisualStudio.com, what is your account name? \r\nhttp://jessehouwing-dev.visualstudio.com\r\n\r\n\r\n## **What's not working?** \r\nWhen I create a build task that uses the GitHub service endpoint type (in order to do further integration into GitHub), like this:\r\n```\r\n{\r\n  \"id\": \"123d700-cd1b-11e6-8ad3-3b209c1bb8f6\",\r\n  \"name\": \"VSTSGithubReleaseTask\",\r\n  \"friendlyName\": \"GitHub Release Task\",\r\n  \"description\": \"Publish or update a release on Github\",\r\n  \"author\": \"jessehouwing\",\r\n  \"helpMarkDown\": \"\",\r\n  \"category\": \"Deploy\",\r\n  \"visibility\": [\r\n    \"Build\",\r\n    \"Release\"\r\n  ],\r\n  \"minimumAgentVersion\": \"1.95.0\",\r\n  \"inputs\": [\r\n    {\r\n      \"name\": \"serviceEndpoint\",\r\n      \"type\": \"connectedService:github\",\r\n      \"label\": \"Github Account\",\r\n      \"defaultValue\": \"\",\r\n      \"required\": true,\r\n      \"helpMarkDown\": \"Select or configure the service endpoint to provide your Github account.\"\r\n    }\r\n  ],\r\n  \"execution\": {\r\n    \"Node\": {\r\n      \"target\": \"vsts-github-release.js\"\r\n    }\r\n  }\r\n}\r\n```\r\nThe task itself doesn't even get executed, adding the task and setting the service endpoint to any GitHub account (doesn't have to match the current repos endpoint) will cause the Sync Sources step to fail:\r\n\r\n```\r\nSyncing repository: 35dca4e7-a104-4c4b-984d-9284a042bf6f (GitHub)\r\nPrepending Path environment variable with directory containing 'git.exe'.\r\ngit version\r\ngit init \"C:\\TfsData\\Build-Dev-v2\\_work\\11\\s\"\r\nInitialized empty Git repository in C:/TfsData/Build-Dev-v2/_work/11/s/.git/\r\ngit remote add origin http://github.com/\r\ngit config gc.auto 0\r\ngit config --get-all http.http://github.com/.extraheader\r\ngit remote set-url origin http://OAuth:********@github.com/\r\ngit remote set-url --push origin http://OAuth:********@github.com/\r\ngit fetch --tags --prune --progress origin\r\nfatal: repository 'https://github.com/' not found\r\nGit fetch failed with exit code: 128\r\n```\r\n\r\nI was hoping to give my users the ability to re-use the existing service endpoint, so they won't have to re-authenticate and so that I can piggy-back on the existing OAuth dialog implementation.\r\n\r\nWhen I remove or disable the task, everything works as expected.\r\n\r\n## **Agent and Worker's diag log**\r\nLogs are located at the `_diag` under agent root folder, agent log prefix with `Agent_`, worker log prefix with `Worker_`. all sensitive information should already be masked out, please double check before paste here. \r\n\r\n[Worker_20161228-190707-utc.txt](https://github.com/Microsoft/vsts-agent/files/676134/Worker_20161228-190707-utc.txt)\r\n\r\nExtension that shows this issue:\r\n[jessehouwing.vsts-github-tasks-DEV-0.0.6.vsix.zip](https://github.com/Microsoft/vsts-agent/files/676141/jessehouwing.vsts-github-tasks-DEV-0.0.6.vsix.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/comments/269528354","html_url":"https://github.com/Microsoft/vsts-agent/issues/737#issuecomment-269528354","issue_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/737","id":269528354,"user":{"login":"ericsciple","id":12102068,"avatar_url":"https://avatars.githubusercontent.com/u/12102068?v=3","gravatar_id":"","url":"https://api.github.com/users/ericsciple","html_url":"https://github.com/ericsciple","followers_url":"https://api.github.com/users/ericsciple/followers","following_url":"https://api.github.com/users/ericsciple/following{/other_user}","gists_url":"https://api.github.com/users/ericsciple/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsciple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsciple/subscriptions","organizations_url":"https://api.github.com/users/ericsciple/orgs","repos_url":"https://api.github.com/users/ericsciple/repos","events_url":"https://api.github.com/users/ericsciple/events{/privacy}","received_events_url":"https://api.github.com/users/ericsciple/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T19:35:43Z","updated_at":"2016-12-28T19:35:43Z","body":"[this looks](https://github.com/Microsoft/vsts-agent/blob/1195c0f9858acf7deeb57bb4534236c8b130dec8/src/Agent.Worker/Build/BuildJobExtension.cs#L264) like the bug in the agent"}}
{"actor":{"display_login":"ericsciple"}}