部署同步错误:最大同步传递次数“5”已超过
当对特定 IIS 站点运行 Web 部署时,出现以下错误:
Error: The synchronization is being stopped because the maximum number of sync passes '5' has been exceeded even though all the changes could not be applied. This could occur if there are external changes being made to the destination.
At C:\Code\.....\deploy.ps1:185 char:10
+ & <<<< ($appDeployCmd) $type /M:$url /U:$user /P:$pass /A:Basic -allowUntrusted -useCheckSum
+ CategoryInfo : NotSpecified: (Error: The sync...he destination.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Web 部署在此环境中针对其他 IIS 站点运行正常,并且文件同步也正常运行。我以前能够使用 Web 部署来部署此特定站点,不会出现任何问题。突然间,这个问题开始发生,我无法再部署该网站。
我正在使用从 msbuild 构建的包进行基本站点部署。我认为具体细节并不那么重要,因为正如我所说,这一切之前都可以正常工作,并且目前可以在同一服务器场上的其他站点上正常工作,没有任何问题。
错误消息显示:
“如果对目标进行外部更改,则可能会发生这种情况。”
但我不确定如何追踪这个问题,或者这是否是一个问题。我已确保所有远程会话中的所有资源管理器窗口均已关闭。我尝试过重新启动网站和应用程序池。我唯一没有尝试过的是重新启动服务器,但目前这是不可能的。
有什么想法可能会导致此 Web 部署失败吗?
When running a web deploy to a specific IIS site I get the following error:
Error: The synchronization is being stopped because the maximum number of sync passes '5' has been exceeded even though all the changes could not be applied. This could occur if there are external changes being made to the destination.
At C:\Code\.....\deploy.ps1:185 char:10
+ & <<<< ($appDeployCmd) $type /M:$url /U:$user /P:$pass /A:Basic -allowUntrusted -useCheckSum
+ CategoryInfo : NotSpecified: (Error: The sync...he destination.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Web Deploy is working fine on this environment against other IIS sites and file syncs are also working. I have previously been able to use web deploy to deploy this specific site without issue. All of the sudden out of nowhere, this issue started happening and I can no longer deploy this site.
I'm doing a basic site deploy with a package built from msbuild. I don't think the specifics are that important because as I said this was all working before and currently works against other sites on the same server farm without issues.
The error message says:
"This could occur if there are external changes being made to the destination."
but I'm not sure how to track this down or if it is even the issue to begin with. I've made sure all explorer windows are closed in all remote sessions. I've tried restarting the site and the app pool. The only thing I have not tried is rebooting the server which is not possible at moment.
Any ideas what might be cause this web deploy to fail?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我遇到了同样的错误,问题出在我的保管箱上。
我直接在我的 dropbox 文件夹中工作,当您发布时,它会导致 dropbox 同时同步,从而导致错误。
在工作时禁用 Dropbox 同步解决了该问题。
我发现 Onedrive、Google Drive 等也可能出现此问题。
I had the same error and the problem was my dropbox.
I was working directly in my dropbox folder, and when you publish, it causes dropbox to syncronize at the same time, which caused the error.
Disabling dropbox sync while working solved the problem.
I recon the problem also could happen with onedrive, google drive and so on.
我们在从以前的临时服务部署转换为 MSDeploy 时遇到了这个问题,并发现是否有文件
,那么我们会在部署时收到“最大同步传递数”错误。
一旦我们修复了属性/ACL,我们就能够同步。
We had this problem when converting from a previously adhoc deploy of a service to MSDeploy, and found that if there were files that were either
then we would get the "maximum number of sync passes" error on deploying.
Once we fixed the attributes/ACLs, we were able to sync.
解决此问题的快速而简单的方法是删除目标中的文件并重新运行 Web 部署。
该问题似乎与 Web 部署的 ACL 步骤有关,该步骤尝试更改网站文件的权限,作为一项安全措施,以确保它们在部署期间不会更改。
来源
如果您愿意,您可以在将来关闭 ACL 以避免这种情况,但这并不值得。这也将加速网络部署——但这是一个单独的问题。
Quick and easy way to resolve this issue is to delete the files in the destination and re-run the web deploy.
The issue seems to revolve around the ACL step of the web deploy, which attempts to change the permissions of your websites files as a safety measure intended to ensure they are not changed during a deployment.
Source
You can turn of ACL in future to avoid this if you wish, but it's not really worth it. This will also speed up web deploys - but that is a separate issue.
这并不是真正的答案,但如果您使用 Web 部署,您可以尝试一种解决方法 目录路径, 文件路径,或 contentPath 提供程序是
ignoreErrors
提供程序设置。如果您知道自己始终遇到某个错误编号,则可以指定在遇到该错误时忽略该错误。有关完整详细信息,请参阅 dirPath 提供程序文章 (和注意事项)。Not really an answer, but one workaround you can try if you are using the Web Deploy dirPath, filePath, or contentPath providers is the
ignoreErrors
provider setting. If you know that you are consistently hitting a certain error number, you can specify that that error be ignored when it's hit. See the dirPath provider article for full details (and caveats).就我而言,我无法修复它,但意识到无论如何部署都有效。
如果您正在阅读本文,我不建议您假设它有效,并且如果确实有效,则它已完全部署,但请考虑这可能是误报!
In my case I couldn't fix it but realised the deployment worked regardless.
If you are reading this I wouldn't suggest to just assume it worked, and if it did that it deployed fully, but consider that it may be a false alarm!