{"action":"created","issue":{"url":"https://api.github.com/repos/projectkudu/kudu/issues/1815","labels_url":"https://api.github.com/repos/projectkudu/kudu/issues/1815/labels{/name}","comments_url":"https://api.github.com/repos/projectkudu/kudu/issues/1815/comments","events_url":"https://api.github.com/repos/projectkudu/kudu/issues/1815/events","html_url":"https://github.com/projectkudu/kudu/issues/1815","id":118888846,"number":1815,"title":"GitHub webhook deployments and manually triggered deployments fail with \"Cannot create directory '.ssh'\"","user":{"login":"breiter","id":3965197,"avatar_url":"https://avatars.githubusercontent.com/u/3965197?v=3","gravatar_id":"","url":"https://api.github.com/users/breiter","html_url":"https://github.com/breiter","followers_url":"https://api.github.com/users/breiter/followers","following_url":"https://api.github.com/users/breiter/following{/other_user}","gists_url":"https://api.github.com/users/breiter/gists{/gist_id}","starred_url":"https://api.github.com/users/breiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breiter/subscriptions","organizations_url":"https://api.github.com/users/breiter/orgs","repos_url":"https://api.github.com/users/breiter/repos","events_url":"https://api.github.com/users/breiter/events{/privacy}","received_events_url":"https://api.github.com/users/breiter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-11-25T17:41:28Z","updated_at":"2015-12-01T10:13:36Z","closed_at":null,"body":"I'm having a problem on a new Kudu S47 with Git 2.6.3 deployment on an in-house server. Builds succeed when pushed to the http git endpoint.\r\n\r\nUnfortunately, deployments triggered by GitHub webhook or the \"Trigger Deployment\" feature of the deployments tab fail with \"Cannot create directory '.ssh'\".\r\n\r\nI have set up an ssh key for the application and the .ssh directory exists and contains a key and known_hosts and GitHub shows the API key having been accessed. GitHub webhook API ping works but an actual deployment trigger fails with 500.\r\n\r\nThe HOME environment variable says it is \"C:\\inetpub\\apps\\pims\" in the service console for the site.\r\n\r\nI'm at a loss to figure out why git ssh can't find the .ssh directory in c:\\inetpub\\apps\\pims when invoked by Kudu.\r\n\r\nThanks in advance for your help.\r\n\r\n```\r\ncd /c/inetpub/apps/pims\r\n$ ssh -i .ssh/id_rsa -vv git@github.com\r\nOpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug2: ssh_connect: needpriv 0\r\ndebug1: Connecting to github.com [192.30.252.130] port 22.\r\ndebug1: Connection established.\r\ndebug1: identity file .ssh/id_rsa type 1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file .ssh/id_rsa-cert type -1\r\ndebug1: Enabling compatibility mode for protocol 2.0\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.1\r\ndebug1: Remote protocol version 2.0, remote software version libssh-0.7.0\r\ndebug1: no match: libssh-0.7.0\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: Authenticating to github.com:22 as 'git'\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1\r\ndebug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519\r\ndebug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: none,zlib@openssh.com,zlib\r\ndebug2: kex_parse_kexinit: none,zlib@openssh.com,zlib\r\ndebug2: kex_parse_kexinit:\r\ndebug2: kex_parse_kexinit:\r\ndebug2: kex_parse_kexinit: first_kex_follows 0\r\ndebug2: kex_parse_kexinit: reserved 0\r\ndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: kex_parse_kexinit: ssh-dss,ssh-rsa\r\ndebug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc\r\ndebug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc\r\ndebug2: kex_parse_kexinit: hmac-sha1,hmac-sha2-256,hmac-sha2-512\r\ndebug2: kex_parse_kexinit: hmac-sha1,hmac-sha2-256,hmac-sha2-512\r\ndebug2: kex_parse_kexinit: none,zlib,zlib@openssh.com\r\ndebug2: kex_parse_kexinit: none,zlib,zlib@openssh.com\r\ndebug2: kex_parse_kexinit:\r\ndebug2: kex_parse_kexinit:\r\ndebug2: kex_parse_kexinit: first_kex_follows 0\r\ndebug2: kex_parse_kexinit: reserved 0\r\ndebug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none\r\ndebug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none\r\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\r\ndebug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8\r\ndebug1: Host 'github.com' is known and matches the RSA host key.\r\ndebug1: Found key in /c/Users/Administrator/.ssh/known_hosts:1\r\nWarning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.\r\ndebug2: set_newkeys: mode 1\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug2: set_newkeys: mode 0\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug1: Roaming not allowed by server\r\ndebug1: SSH2_MSG_SERVICE_REQUEST sent\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug2: key: .ssh/id_rsa (0x60006bbc0), explicit\r\ndebug1: Authentications that can continue: publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Offering RSA public key: .ssh/id_rsa\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug1: Server accepts key: pkalg ssh-rsa blen 279\r\ndebug2: input_userauth_pk_ok: fp SHA256:QKdOsCcWCjKhRQbNG266z4aPe3ijBR7zoJii7mkNazE\r\ndebug1: Authentication succeeded (publickey).\r\nAuthenticated to github.com ([192.30.252.130]:22).\r\ndebug1: channel 0: new [client-session]\r\ndebug2: channel 0: send open\r\ndebug1: Entering interactive session.\r\ndebug2: callback start\r\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug2: client_session2_setup: id 0\r\ndebug2: channel 0: request pty-req confirm 1\r\ndebug2: channel 0: request shell confirm 1\r\ndebug2: callback done\r\ndebug2: channel 0: open confirm rwindow 32000 rmax 35000\r\ndebug2: channel_input_status_confirm: type 100 id 0\r\nPTY allocation request failed on channel 0\r\ndebug2: channel_input_status_confirm: type 99 id 0\r\ndebug2: shell request accepted on channel 0\r\ndebug2: channel 0: rcvd ext data 102\r\ndebug1: client_input_channel_req: channel 0 rtype exit-status reply 0\r\ndebug2: channel 0: rcvd eof\r\ndebug2: channel 0: output open -> drain\r\ndebug2: channel 0: rcvd close\r\ndebug2: channel 0: close_read\r\ndebug2: channel 0: input open -> closed\r\ndebug2: channel 0: obuf_empty delayed efd 6/(102)\r\nHi WolfeReiter/msh-pims! You've successfully authenticated, but GitHub does not provide shell access.\r\ndebug2: channel 0: written 102 to efd 6\r\ndebug2: channel 0: obuf empty\r\ndebug2: channel 0: close_write\r\ndebug2: channel 0: output drain -> closed\r\ndebug2: channel 0: almost dead\r\ndebug2: channel 0: gc: notify user\r\ndebug2: channel 0: gc: user detached\r\ndebug2: channel 0: send close\r\ndebug2: channel 0: is dead\r\ndebug2: channel 0: garbage collecting\r\ndebug1: channel 0: free: client-session, nchannels 1\r\nConnection to github.com closed.\r\nTransferred: sent 3388, received 1804 bytes, in 0.7 seconds\r\nBytes per second: sent 4765.0, received 2537.2\r\ndebug1: Exit status 1\r\n```\r\n\r\n```\r\nLog Name:      Application\r\nSource:        ASP.NET 4.0.30319.0\r\nDate:          11/25/2015 5:15:21 PM\r\nEvent ID:      1309\r\nTask Category: Web Event\r\nLevel:         Warning\r\nKeywords:      Classic\r\nUser:          N/A\r\nComputer:      WIN-B93U6E5AP0S\r\nDescription:\r\nEvent code: 3005 \r\nEvent message: An unhandled exception has occurred. \r\nEvent time: 11/25/2015 5:15:21 PM \r\nEvent time (UTC): 11/25/2015 5:15:21 PM \r\nEvent ID: 5bceb99971f14474ac8251f3f0e053c6 \r\nEvent sequence: 8 \r\nEvent occurrence: 1 \r\nEvent detail code: 0 \r\n \r\nApplication information: \r\n    Application domain: /LM/W3SVC/2/ROOT-1-130929453022812398 \r\n    Trust level: Full \r\n    Application Virtual Path: / \r\n    Application Path: C:\\inetpub\\Kudu.Services.Web\\ \r\n    Machine name: WIN-B93U6E5AP0S \r\n \r\nProcess information: \r\n    Process ID: 3756 \r\n    Process name: w3wp.exe \r\n    Account name: IIS APPPOOL\\pims \r\n \r\nException information: \r\n    Exception type: CommandLineException \r\n    Exception message: Could not create directory '/.ssh'.\r\nHost key verification failed.\r\nfatal: Could not read from remote repository.\r\n\r\nPlease make sure you have the correct access rights\r\nand the repository exists.\r\n\r\nC:\\Program Files (x86)\\Git\\bin\\git.exe fetch external --progress\r\n   at Kudu.Core.Infrastructure.Executable.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func`1 action, Int32 retries, Int32 delayBeforeRetry, Func`2 shouldRetry)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.FetchWithoutConflict(String remote, String branchName)\r\n   at Kudu.Core.SourceControl.Git.LibGit2SharpRepository.FetchWithoutConflict(String remoteUrl, String branchName)\r\n   at Kudu.Services.ServiceHookHandlers.ServiceHookHandlerBase.Fetch(IRepository repository, DeploymentInfo deploymentInfo, String targetBranch, ILogger logger)\r\n   at Kudu.Services.FetchHandler.<PerformDeployment>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.FetchHandler.<>c__DisplayClass10_1.<<ProcessRequestAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Contracts.Infrastructure.LockExtensions.<TryLockOperationAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Kudu.Services.FetchHandler.<ProcessRequestAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)\r\n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)\r\n\r\n \r\n \r\nRequest information: \r\n    Request URL: http://localhost:30075/deploy/ \r\n    Request path: /deploy/ \r\n    User host address: 127.0.0.1 \r\n    User: WIN-B93U6E5AP0S\\kudu \r\n    Is authenticated: True \r\n    Authentication Type: Basic \r\n    Thread account name: IIS APPPOOL\\pims \r\n \r\nThread information: \r\n    Thread ID: 8 \r\n    Thread account name: IIS APPPOOL\\pims \r\n    Is impersonating: False \r\n    Stack trace:    at Kudu.Core.Infrastructure.Executable.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func`1 action, Int32 retries, Int32 delayBeforeRetry, Func`2 shouldRetry)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.FetchWithoutConflict(String remote, String branchName)\r\n   at Kudu.Core.SourceControl.Git.LibGit2SharpRepository.FetchWithoutConflict(String remoteUrl, String branchName)\r\n   at Kudu.Services.ServiceHookHandlers.ServiceHookHandlerBase.Fetch(IRepository repository, DeploymentInfo deploymentInfo, String targetBranch, ILogger logger)\r\n   at Kudu.Services.FetchHandler.<PerformDeployment>d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.FetchHandler.<>c__DisplayClass10_1.<<ProcessRequestAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Contracts.Infrastructure.LockExtensions.<TryLockOperationAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Kudu.Services.FetchHandler.<ProcessRequestAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)\r\n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)\r\n \r\n \r\nCustom event details: \r\n\r\nEvent Xml:\r\n<Event xmlns=\"http://schemas.microsoft.com/win/2004/08/events/event\">\r\n  <System>\r\n    <Provider Name=\"ASP.NET 4.0.30319.0\" />\r\n    <EventID Qualifiers=\"32768\">1309</EventID>\r\n    <Level>3</Level>\r\n    <Task>3</Task>\r\n    <Keywords>0x80000000000000</Keywords>\r\n    <TimeCreated SystemTime=\"2015-11-25T17:15:21.000000000Z\" />\r\n    <EventRecordID>13775</EventRecordID>\r\n    <Channel>Application</Channel>\r\n    <Computer>WIN-B93U6E5AP0S</Computer>\r\n    <Security />\r\n  </System>\r\n  <EventData>\r\n    <Data>3005</Data>\r\n    <Data>An unhandled exception has occurred.</Data>\r\n    <Data>11/25/2015 5:15:21 PM</Data>\r\n    <Data>11/25/2015 5:15:21 PM</Data>\r\n    <Data>5bceb99971f14474ac8251f3f0e053c6</Data>\r\n    <Data>8</Data>\r\n    <Data>1</Data>\r\n    <Data>0</Data>\r\n    <Data>/LM/W3SVC/2/ROOT-1-130929453022812398</Data>\r\n    <Data>Full</Data>\r\n    <Data>/</Data>\r\n    <Data>C:\\inetpub\\Kudu.Services.Web\\</Data>\r\n    <Data>WIN-B93U6E5AP0S</Data>\r\n    <Data>\r\n    </Data>\r\n    <Data>3756</Data>\r\n    <Data>w3wp.exe</Data>\r\n    <Data>IIS APPPOOL\\pims</Data>\r\n    <Data>CommandLineException</Data>\r\n    <Data>Could not create directory '/.ssh'.\r\nHost key verification failed.\r\nfatal: Could not read from remote repository.\r\n\r\nPlease make sure you have the correct access rights\r\nand the repository exists.\r\n\r\nC:\\Program Files (x86)\\Git\\bin\\git.exe fetch external --progress\r\n   at Kudu.Core.Infrastructure.Executable.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func`1 action, Int32 retries, Int32 delayBeforeRetry, Func`2 shouldRetry)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.FetchWithoutConflict(String remote, String branchName)\r\n   at Kudu.Core.SourceControl.Git.LibGit2SharpRepository.FetchWithoutConflict(String remoteUrl, String branchName)\r\n   at Kudu.Services.ServiceHookHandlers.ServiceHookHandlerBase.Fetch(IRepository repository, DeploymentInfo deploymentInfo, String targetBranch, ILogger logger)\r\n   at Kudu.Services.FetchHandler.&lt;PerformDeployment&gt;d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.FetchHandler.&lt;&gt;c__DisplayClass10_1.&lt;&lt;ProcessRequestAsync&gt;b__0&gt;d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Contracts.Infrastructure.LockExtensions.&lt;TryLockOperationAsync&gt;d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Kudu.Services.FetchHandler.&lt;ProcessRequestAsync&gt;d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)\r\n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)\r\n\r\n</Data>\r\n    <Data>http://localhost:30075/deploy/</Data>\r\n    <Data>/deploy/</Data>\r\n    <Data>127.0.0.1</Data>\r\n    <Data>WIN-B93U6E5AP0S\\kudu</Data>\r\n    <Data>True</Data>\r\n    <Data>Basic</Data>\r\n    <Data>IIS APPPOOL\\pims</Data>\r\n    <Data>8</Data>\r\n    <Data>IIS APPPOOL\\pims</Data>\r\n    <Data>False</Data>\r\n    <Data>   at Kudu.Core.Infrastructure.Executable.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.Execute(ITracer tracer, String arguments, Object[] args)\r\n   at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func`1 action, Int32 retries, Int32 delayBeforeRetry, Func`2 shouldRetry)\r\n   at Kudu.Core.SourceControl.Git.GitExeRepository.FetchWithoutConflict(String remote, String branchName)\r\n   at Kudu.Core.SourceControl.Git.LibGit2SharpRepository.FetchWithoutConflict(String remoteUrl, String branchName)\r\n   at Kudu.Services.ServiceHookHandlers.ServiceHookHandlerBase.Fetch(IRepository repository, DeploymentInfo deploymentInfo, String targetBranch, ILogger logger)\r\n   at Kudu.Services.FetchHandler.&lt;PerformDeployment&gt;d__11.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.FetchHandler.&lt;&gt;c__DisplayClass10_1.&lt;&lt;ProcessRequestAsync&gt;b__0&gt;d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Contracts.Infrastructure.LockExtensions.&lt;TryLockOperationAsync&gt;d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Kudu.Services.FetchHandler.&lt;ProcessRequestAsync&gt;d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)\r\n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)\r\n</Data>\r\n  </EventData>\r\n</Event>\r\n```"},"comment":{"url":"https://api.github.com/repos/projectkudu/kudu/issues/comments/160924606","html_url":"https://github.com/projectkudu/kudu/issues/1815#issuecomment-160924606","issue_url":"https://api.github.com/repos/projectkudu/kudu/issues/1815","id":160924606,"user":{"login":"breiter","id":3965197,"avatar_url":"https://avatars.githubusercontent.com/u/3965197?v=3","gravatar_id":"","url":"https://api.github.com/users/breiter","html_url":"https://github.com/breiter","followers_url":"https://api.github.com/users/breiter/followers","following_url":"https://api.github.com/users/breiter/following{/other_user}","gists_url":"https://api.github.com/users/breiter/gists{/gist_id}","starred_url":"https://api.github.com/users/breiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breiter/subscriptions","organizations_url":"https://api.github.com/users/breiter/orgs","repos_url":"https://api.github.com/users/breiter/repos","events_url":"https://api.github.com/users/breiter/events{/privacy}","received_events_url":"https://api.github.com/users/breiter/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T10:13:36Z","updated_at":"2015-12-01T10:13:36Z","body":"I can reproduce the exact behavior from a normal `cmd` session if I `set HOME=` to make it null.\r\n\r\nIt seems like the git.exe process is not inheriting the environment when it is started by Kudu or in the DebugConsole.\r\n\r\nI think it is a permissions problem somehow. I got it to work by setting the AppPool to run as local system. "}}