Deploy sync error: maximum number of sync passes '5' has been exceeded
Asked Answered
T

5

14

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?

Tympan answered 25/1, 2012 at 21:13 Comment(0)
S
30

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.

Symptomatology answered 6/10, 2015 at 14:3 Comment(4)
Aah you champion, I always work out of Dropbox and I often get this error. Makes perfect sense now.Xylon
It seemed unlikely but you're right on! Sorry to doubt you :) I exited the dropbox process on my machine and everything worked.Pyroxene
Brilliant! Put my dropbox sync on pause, and it worked. Thanks a ton!Subalpine
Not just dropbox, even with onedrive I faced the same issue. I paused the sync, it worked.Farver
S
13

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.

Steeve answered 15/7, 2014 at 16:44 Comment(3)
I'm getting the same error when I try to publish a single folder, such as ~/Content/themes/base. However, when I check out all the files in the folder first, the publish succeeds. Seems like a bug in VS 2013 to me.Brueghel
I have this problem when publishing files which are read-only. As I use Perforce, simply checking the file out allowed the publish to work.Petulia
Worked for me, simple case of saving the file again before publishing. (The file that had the issue was a sass file that includes the files I work on hence I've never really needed to save it.)Nubbly
K
2

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.

By default Web Deploy sets the ACL of the sites anonymous user to read only while also overwriting Control Panel access to your website.

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.

Kerakerala answered 1/6, 2015 at 13:36 Comment(1)
This worked for me. I modified a file from an external application, and then faced this problem. Then I deleted the file on destination server and run web deploy. It worked.Dictaphone
F
1

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).

Freeman answered 16/3, 2012 at 4:45 Comment(0)
D
1

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!

Davinadavine answered 17/10, 2017 at 9:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.