Does someone have an idea what is going wrong here? The error message is not very specific.
Deploy a Web App to App Service using the Zip Deploy HTTP API (documented here: https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file).
The app is an ASP.NET Core app; the zip file contains the output of dotnet publish. I can give the exact zip file if necessary.
I get an HTTP status code 500 and some json describing a .NET exception. The same information is included below (copied from a trace xml-file on the web server). The existing deployment appears untouched and the app remains running.
<step title="Error occurred" date="2018-04-25T09:53:59.663" type="error" text="Operation is not valid due to the current state of the object." stackTrace=" at Kudu.Core.SourceControl.NullRepository.GetChangeSet(String id) in C:\Kudu Files\Private\src\master\Kudu.Core\SourceControl\NullRepository.cs:line 70
at Kudu.Core.Deployment.FetchDeploymentManager.<PerformDeployment>d__9.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 235
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Kudu.Core.Deployment.FetchDeploymentManager.<>c__DisplayClass8_0.<<FetchDeploy>b__0>d.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 115
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Kudu.Contracts.Infrastructure.LockExtensions.<LockOperationAsync>d__5`1.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Contracts\Infrastructure\LockExtensions.cs:line 100
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Kudu.Core.Deployment.FetchDeploymentManager.<FetchDeploy>d__8.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 108
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Kudu.Services.Deployment.PushDeploymentController.<PushDeployAsync>d__10.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Services\Deployment\PushDeploymentController.cs:line 147
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Kudu.Services.Deployment.PushDeploymentController.<ZipPushDeploy>d__8.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Services\Deployment\PushDeploymentController.cs:line 80
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()" />
The name of the web app is progresselections.
The app was previously deployed using webdeploy (from Visual Studio). The deploy is initiated by AppVeyor (as documented here: https://www.appveyor.com/docs/deployment/azure-app-service-zip-push-deploy/).
Have not seen this one before. A few things to test to help isolate:
Ok, I understand the problem now. If you look at your D:\home\site\deployments\settings.xml, it has:
<deployment>
<add key="branch" value="productie" />
</deployment>
This is likely some remnant of some previous deployment flow that you were using, and it is confusing zipdeploy. Just yank the add tag and you'll be ok.
@suwatch, it's probably a general issue with all scenarios that use NullRepository. The code expects the branch to be 'master' and it doesn't play well when a different branch is set in settings.xml.
But at least it's easy to workaround.
Should the NullRepository be independent of or simply ignore branch settings?
@davidebbo Thanks for the clarification. I did indeed try to set up continuous deployment from GitHub earlier, using that exact branch.
@suwatch it probably should ignore it, but I don't know the history behind that logic.
Another angle is that if you have a GitHub (or whatever) CI set up, and then you disconnect it, we should be cleaning up the branch as part of that, which would have avoided this issue.
But let's keep in perspective: this is a rare situation with an easy workaround. So I don't think this is high priority given everything else we have going.
zipdeploy is working as expected now.
thanks @davidebbo the same thing happened to me, modify the settings file pointing to the correct repository and it works correctly,
Most helpful comment
Ok, I understand the problem now. If you look at your
D:\home\site\deployments\settings.xml, it has:This is likely some remnant of some previous deployment flow that you were using, and it is confusing zipdeploy. Just yank the
addtag and you'll be ok.@suwatch, it's probably a general issue with all scenarios that use NullRepository. The code expects the branch to be 'master' and it doesn't play well when a different branch is set in settings.xml.
But at least it's easy to workaround.