在VSTS版本上部署Service Fabric服务版本升级失败 [英] Deployment for Service Fabric service version upgrade fails on VSTS Release

查看:94
本文介绍了在VSTS版本上部署Service Fabric服务版本升级失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下错误出现在日志中.

The following error appears at log.

The content in ConfigPackage Name:Config and Version:1.0.0.20180315.2 in Service Manifest 'TwoServicePkg' has changed, but the version number is the same.

我只更改了其中一项服务的代码,所以我只更改了清单中代码的一个版本.

I changed only the code of one of the services, so I changed only one version of the code in the manifest.

在这种情况下,通过Visual Studio升级没有问题.

In this case, there is no problem with the upgrade through Visual Studio.

但是,通过VSTS升级会导致上述错误.

However, upgrading via VSTS will cause the above error.

默认情况下,我为Service Fabric创建了VSTS CI/CD. (管道:VSTS Git Repo->构建->发布)

I created VSTS CI/CD for Service Fabric as default. (Pipeline: VSTS Git Repo -> Build -> Release)

首先提交>构建>发布"是可以的.

First 'Commit > Build > Release' is Okay.

服务结构清单版本

MyAppType: 1.0.0
  OneService: Pkg 1.0.0 / Code 1.0.0 / Config 1.0.0
  TwoService: Pkg 1.0.0 / Code 1.0.0 / Config 1.0.0

现在,我仅修复OneService代码.并编辑服务结构清单清单.

Now, I fix OneService Code only. And Edit verisons of service fabric manifest.

服务结构清单版本

MyAppType: 1.0.1(*)
  OneService: Pkg 1.0.1(*) / Code 1.0.1(*) / Config 1.0.0
  TwoService: Pkg 1.0.0 / Code 1.0.0 / Config 1.0.0

第二次提交>构建正常.但是释放失败. 在日志中出现以下错误.

Second Commit > Build is Okay. But Release is Failed. The following error appears at log.

The content in ConfigPackage Name:Config and Version:1.0.0.20180315.2 in Service Manifest 'TwoServicePkg' has changed, but the version number is the same.

但是我没有修改TwoService Pkg(两个代码,都配置).

But I didn't modify TwoService Pkg (Both Code, Config).

此外,最好通过VS2017 IDE立即发布到"Azure Cloud Service Fabric群集". (当然,已选中升级应用程序"选项.)

Moreover, It's good to Publish To 'Azure Cloud Service Fabric Cluster' through VS2017 IDE, Immediately. (Of course, 'Upgrade the Application' option checked.)

当前的临时解决方案是对所有版本(全部pkg/代码/配置)进行如下版本.

Current temporary solution is to version up all (all pkg / code / config) like below.

服务结构清单版本

MyAppType: 1.0.1(*)
  OneService: Pkg 1.0.1(*) / Code 1.0.1(*) / Config 1.0.1(*)
  TwoService: Pkg 1.0.1(*) / Code 1.0.1(*) / Config 1.0.1(*)

我想构建构建管道,但这很令人困惑.

I want to construct build pipeline, But It's Confusing.

我只使用默认的VSTS Service Fabric模板.

I just use default VSTS Service Fabric template.

仅修改发布配置文件名称(Cloud.xml-> Cloud.Development.xml).

And modify only Publish Profile name (Cloud.xml -> Cloud.Development.xml).

发布任务屏幕截图

推荐答案

错误消息提示您得到的错误:

The error you get as the error message suggest :

' ConfigPackage 服务清单' PackageName '中的内容具有 更改,但版本号相同.

'The content in ConfigPackage Service Manifest 'PackageName' has changed, but the version number is the same.

这意味着:我们在此软件包中发现了与先前版本不匹配的其他内容,因为您已经说过版本应该相同,它们应该匹配,所以我不知道该怎么办,它会让您解决它.

That means: we found something different in this package that does not match the previous version, because you've said the version should be the same, they should match, so I don't know what to do and will let you fix that.

该消息不是很有启发性,因此乍一看您会迷路.

The message is not very suggestive, so at first glance you get lost.

我在这里已经回答了相同的问题

I have answered the same questions here error-while-upgrading-azure-service-fabric-through-vsts-ci-cd, please check if the answer help you solve your problem.

我将解释更多:

无论何时注册应用程序,服务结构都会将正在注册的新版本与服务器中当前的版本进行比较,如果已经存在相同的服务版本,它将对程序包,配置程序包,代码程序包等进行比较.开启,如果其中任何一个都不匹配,将导致部署失败.

Whenever you register an application, service fabric will compare the new version being registered with the versions currently in the server, if the same service version is already there, it will compare the packages, the config packages, the code package and so on, if any of them doesn't match it will fail the deployment.

其中任何一个小小的改动都将触发版本升级,例如,如果在Setting.xml中添加或删除配置设置,则必须升级配置文件的版本以及服务清单中的一个.

Every small change on any of these, should trigger a version upgrade, for example, if you add or remove a config setting in the Setting.xml you have to upgrade the version of your config file and one in the service manifest.

之前:

app1 -------> 1.0.0
  service1 -> 1.0.0
    code ---> 1.0.0
    config -> 1.0.0

之后

app1 -------> 1.0.1
  service1 -> 1.0.1
    code ---> 1.0.0
    config -> 1.0.1

对于代码包,也会发生同样的情况,如果同时升级代码和配置,则仅应升级服务清单一个版本,例如:

For the code package the same happens, and if you upgrade the code and config at same time, you should only upgrade the service manifest only one version, like:

app1 -------> 1.0.1
  service1 -> 1.0.1
    code ---> 1.0.1
    config -> 1.0.1

这里最棘手的挑战是代码更改,每当触发新的构建时,该构建都会下载源代码并编译所有内容,您知道基于提交更改所做的更改,但是对于构建,所有内容都会生成一个程序集,因此不管它是否更改,它都将生成一个新的程序集,尽管代码与以前的版本相同,但大多数情况下输出二进制文件会有所不同.

The trickiest challenge here are the code changes, whenever a new build is triggered, the build will download the source and compile everything, you know what has changed based on commit changes, but for the build everything will generate an assembly, so it does not care if it changed or not, it will generate a new assembly, despite the code being the same from previous build the output binary on most of the times will be different.

通过应用程序注册,如果版本保持不变,则这些二进制文件应与现有二进制文件匹配,否则将不会发生.为了解决这个问题,差异包装参加了会议,在此我不做过多介绍,因为此答案超出了范围,但是您可以在以下链接上获得更多信息:

Going through the Application Registration, if the version keep the same, these binaries should match the existing ones, what is not gonna happen. To solve this, the differential packaging join the party, I won't give too much details here because is out of scope for this answer, but you can get more information on these links:

带有差异包的Service Fabric应用程序

StackOverflow问题:差异包装

这篇关于在VSTS版本上部署Service Fabric服务版本升级失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆