Kudu: ExceptionMessage":"ChangeSetId does not match

Created on 18 Oct 2019  路  10Comments  路  Source: projectkudu/kudu

Hi All, I am trying to do zip deploy on Azure App Service Environment with below command.
curl -X POST -u $AZDUSERNAME:$AZDPASSWORD https://AppServiceEnvirnmentSCMURL/api/wardeploy?name=catalyst-notification1-service --data-binary @warfilepath
but I am seeing below error.
"Message":"An error has occurred.","ExceptionMessage":"ChangeSetId(release-1.0) does not match d9b1c74611e947759da28b84f1c21a07, 'master' or 'HEAD'","ExceptionType":"System.InvalidOperationException","StackTrace":" at Kudu.Core.SourceControl.NullRepository.GetChangeSet(String id) in C:\Kudu Files\Private\src\master\Kudu.Core\SourceControl\NullRepository.cs:line 73\r\n at Kudu.Core.Deployment.FetchDeploymentManager.d__9.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 235\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Kudu.Core.Deployment.FetchDeploymentManager.<>c__DisplayClass8_0.<b__0>d.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 116\r\n--- End of stack trace from previous location where exception was thrown ---\r\n .

My repo is GITLAB and project version is release-2.0 . I build the war file as part of CI process in GITLAB on branch release-2.0. I cloned this release-2.0 branch from release-1.0.
I did verified my yml and POM file to check if there any references to release-1.0 branch but could not see any references.
Any help on this would be greatly appreciated.

Thanks,
Shekar

Most helpful comment

@tonykaralis @lshekarrao One of the reasons why you would run in to this issue is if you already have CICD configured with the app and if you try to deploy something out of band and/or change your deployment source without disconnecting. If you are still running in to this issue, we would need to collect some more information.

But my first recommendation would be for you to disconnect and re-connect to your source control.

All 10 comments

Disclaimer: I am not a projectkudu team member

I am also using a private gitlab to deploy to Azure app services.

I recommend using "External Git" as your deployment method.

image

  1. Set up a special "Deployment" branch within your repo, with the desired deployment payload

  2. in the app service, go to deployment center, select "External Git"

  3. Select Kudu build service
  4. Provide the "Clone with SSH" url as the source
  5. Provide the name of your deployment branch
  6. Assuming your repo is private, provide either your credentials, or the credentials of a neutral "deployment user" (our solution)

image

Ok now time to tell Gitlab what the deal is:

Every app service will happily provide it's RSA key if you go to the following url

  • Log in if prompted
    https://your-app.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1

NOTE: Replace your-app with the name of your app service

THIS (without the double quotes) is the deployment key (ssh key) you need to give to your project in gitlab, so that gitlab will allow kudu to pull.

image

That's it!

You can manually tell azure to deploy your branch by clicking the "Sync" button that is now present in the deployment center.


But we're lazy developers right? Why do I have to go click a thing when I JUST updated my deployment branch? Fortunately Both Azure App Services and Gitlab made this part pretty painless


image

  1. On the app overview page in the Azure Portal, download publish profile

    • Look for the password in the file
    • Recommended if using vscode:
    • set vscode to treat the file as an html file
    • apply document formatting from the command palette (F1)
  2. In gitlab, in the project, go to Settings > Integrations

image

  1. Add URL https://$your-app:[email protected]/deploy

  2. Test:

    • Make a small change and push it into the deploy branch
    • In the deployment center make sure the deploy commit # is the same

I am getting the same error as above. Has anyone solved the real issue here?

@tonykaralis Have you tried the solution suggested by @carson-nr above? also if this is still occurring, can you please post the exception message here?

@tonykaralis @lshekarrao One of the reasons why you would run in to this issue is if you already have CICD configured with the app and if you try to deploy something out of band and/or change your deployment source without disconnecting. If you are still running in to this issue, we would need to collect some more information.

But my first recommendation would be for you to disconnect and re-connect to your source control.

@nertim Thanks for getting back to me. I did realise at the time I had configured for deployment via an external git source. Once I disconnected the zipdeploy worked. It would be great if the error messages were slightly more verbose.

Thanks though, I did get it working in the end.

Hello. I am experiencing the same behavior. Previously I used "local git" deployment. Now I try to perform a zip-deployment. I have disconnected the "local git" deployment source. But the same error as above:

_ChangeSetId(azure_dev) does not match 876813da8c5c46ed8ee160b35fc4eea7, 'master' or 'HEAD'_

happens. It seems, that Kudu tries to use "local git" deployment furthermore. How could the "local git" deployment be completely turned off?

deploymentlog.xml.txt

Remove "d:\home\site\repository" directory and retry.

@suwatch thank you, unfortunately it did not help. But I solved the problem.

I had a configuration setting

_deployment_branch=azure_dev_

After deleting it, zip-deployment started to work.

@suwatch thank you, unfortunately it did not help. But I solved the problem.

I had a configuration setting

_deployment_branch=azure_dev_

After deleting it, zip-deployment started to work.
I couldn't find deployment branch settings . But removing settings.xml from D:\home\site\deployments> worked for me

The common cause for this is when a site or slot have 2 conflicting types of deployments (eg. zipdeploy as well as git such as localgit or CI/CD for GitHub, etc.). Wonder if your issue fall into this category?

Was this page helpful?
0 / 5 - 0 ratings