0

is there a way in Service Fabric to deploy a new version of an app even though the code hasn't changed?
SF is constantly complaining about this whenever the devs rebuild the repo because something outside of the package changed but don't change the actual code of the app, and the version of the application gets bumped up by the build pipeline.
SF then says "you're trying to deploy a newer version of an application that already exists even though there are no code changes" and then fails.
Any way to change this behaviour?


Edit:

Here's a trace of the actual deployment error:

2018-11-07T06:07:23.1289545Z ##[debug]Processed: ##vso[telemetry.publish 

area=TaskHub;feature=ServiceFabricDeploy]{"OperationId":"GetApplicationType","ExceptionData":"System.Management.Automation.MethodInvocationException;System.Management.Automation.RuntimeException;System.Management.Automation.RuntimeException;|D:\\a\\_tasks\\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\\1.7.27\\ServiceFabricSDK\\Utilities.ps1|597","JobId":"ae65e85b-a04b-4de4-ac32-c9a821fba222","SDKVersion":"3.2.176.9494"}
2018-11-07T06:07:23.5491048Z ##[debug]Leaving D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\deploy.ps1.
2018-11-07T06:07:23.5537752Z ##[debug]Caught exception from task script.
2018-11-07T06:07:23.5570190Z ##[debug]Error record:
2018-11-07T06:07:23.6347435Z ##[debug]Invoke-ActionWithRetries : Exception calling "Invoke" with "1" argument(s): "Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.."
2018-11-07T06:07:23.6359357Z ##[debug]At D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Utilities.ps1:597 char:12
2018-11-07T06:07:23.6371643Z ##[debug]+     return Invoke-ActionWithRetries -Action $getAppTypeAction `
2018-11-07T06:07:23.6383668Z ##[debug]+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-11-07T06:07:23.6395763Z ##[debug]    + CategoryInfo          : NotSpecified: (:) [Invoke-ActionWithRetries], MethodInvocationException
2018-11-07T06:07:23.6408095Z ##[debug]    + FullyQualifiedErrorId : RuntimeException,Invoke-ActionWithRetries
2018-11-07T06:07:23.6420176Z ##[debug] 
2018-11-07T06:07:23.6439430Z ##[debug]Script stack trace:
2018-11-07T06:07:23.6475478Z ##[debug]at Invoke-ActionWithRetries, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ps_modules\PowershellHelpers\Helpers.ps1: line 61
2018-11-07T06:07:23.6487812Z ##[debug]at Wait-ServiceFabricApplicationTypeRegistrationStatus, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Utilities.ps1: line 597
2018-11-07T06:07:23.6500061Z ##[debug]at Register-ServiceFabricApplicationTypeAction, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Utilities.ps1: line 516
2018-11-07T06:07:23.6512541Z ##[debug]at Publish-NewServiceFabricApplication, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1: line 296
2018-11-07T06:07:23.6524254Z ##[debug]at <ScriptBlock>, D:\a\_tasks\ServiceFabricDeploy_c6650aa0-185b-11e6-a47d-df93e7a34c64\1.7.27\deploy.ps1: line 194
2018-11-07T06:07:23.6536298Z ##[debug]at <ScriptBlock>, <No file>: line 1
2018-11-07T06:07:23.6548158Z ##[debug]at <ScriptBlock>, <No file>: line 22
2018-11-07T06:07:23.6559801Z ##[debug]at <ScriptBlock>, <No file>: line 18
2018-11-07T06:07:23.6572215Z ##[debug]at <ScriptBlock>, <No file>: line 1
2018-11-07T06:07:23.6591191Z ##[debug]Exception:
2018-11-07T06:07:23.6634400Z ##[debug]System.Management.Automation.MethodInvocationException: Exception calling "Invoke" with "1" argument(s): "Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.." ---> System.Management.Automation.RuntimeException: Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.. ---> System.Management.Automation.RuntimeException: Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same..
2018-11-07T06:07:23.6646133Z ##[debug]   --- End of inner exception stack trace ---
2018-11-07T06:07:23.6657929Z ##[debug]   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
2018-11-07T06:07:23.6670688Z ##[debug]   at <ScriptBlock>(Closure , FunctionContext )
2018-11-07T06:07:23.6683139Z ##[debug]   at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
2018-11-07T06:07:23.6694796Z ##[debug]   at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.<InvokeWithPipe>b__0()
2018-11-07T06:07:23.6707020Z ##[debug]   at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
2018-11-07T06:07:23.6719153Z ##[debug]   at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List`1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args)
2018-11-07T06:07:23.6731325Z ##[debug]   at System.Management.Automation.ScriptBlock.DoInvoke(Object dollarUnder, Object input, Object[] args)
2018-11-07T06:07:23.6742915Z ##[debug]   at CallSite.Target(Closure , CallSite , ScriptBlock , Object )
2018-11-07T06:07:23.6754590Z ##[debug]   --- End of inner exception stack trace ---
2018-11-07T06:07:23.6766838Z ##[debug]   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
2018-11-07T06:07:23.6778543Z ##[debug]   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6791071Z ##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6802711Z ##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6814797Z ##[debug]   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
2018-11-07T06:07:23.6826406Z ##[debug]   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
2018-11-07T06:07:23.6838645Z ##[debug]   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
2018-11-07T06:07:23.6850253Z ##[debug]   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
2018-11-07T06:07:23.6862534Z ##[debug]   at System.Management.Automation.CommandProcessorBase.Complete()
2018-11-07T06:07:23.6921240Z ##[error]Exception calling "Invoke" with "1" argument(s): "Failed to register application type. Status: Failed. Details: FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR: The content in CodePackage Name:Code and Version:1.0.0.18275.02 in Service Manifest 'App.ApiGateway.WebApiPkg' has changed, but the version number is the same.."

In AzDo / VSTS the option "Use Diff Package" on the "Service Fabric Application Deployment" task is set.

David O'Brien
  • 813
  • 1
  • 9
  • 18
  • Possible duplicate of [Deployment for Service Fabric service version upgrade fails on VSTS Release](https://stackoverflow.com/questions/49316938/deployment-for-service-fabric-service-version-upgrade-fails-on-vsts-release) – Diego Mendes Nov 08 '18 at 10:54

1 Answers1

0

This has been already answered here and here

You should make differencial packaging instead, or update the version of all services.

Answering the main question:

No, it's not possible to change this behaviour, you have to update the versions or do differential packaging.

Diego Mendes
  • 10,631
  • 2
  • 32
  • 36
  • Actually, the pipeline is already configured to "Use Diff Package". So it's probably not that. – David O'Brien Nov 09 '18 at 06:01
  • https://stackoverflow.com/a/34886586/484222 , From the docs > "When you have a deployment system that generates the build layout directly from your application build process, even though the code hasn't changed, newly built assemblies get a different checksum. Using a full application package would require you to update the version on all code packages. Using a diff package, you only provide the files that changed and the manifest files where the version has changed." – Diego Mendes Nov 12 '18 at 11:31