gabriel
gabriel

Reputation: 384

msdeploy - Cannot create a file when that file already exists

We are trying to migrate IIS 10 from one server to another server with the command:

msdeploy -verb:sync -source:webServer,computername=academicApp01T -dest:webServer,computername=WEBAAPPT01WA, -enablelink:AppPoolExtension -disableLink:Content -replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue="ServerBindings",match=sourceIP,replace=newdestinationIP

but we keep getting the error below. We installed msdeploy "complete" (as opposed to custom or typical)

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy -verb:sync -source:webServer,computername=academicApp01T -dest:webServer,computername=WEBAAPPT01WA, -enablelink:AppPoolExtension -disableLink:Content -replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue="ServerBindings",match=sourceIP,replace=newdestinationIP
Info: Using ID 'ab29a6b0-c2d7-4e0c-afad-f410a54db50c' for connections to the remote server.
Info: Using ID '830a233d-98f3-4a9a-ab8e-c4437cb94b92' for connections to the remote server.
Info: Updating section (MSDeploy.webServer/webServer/appHostConfig[@path='']/configSections/sectionGroup[@name='system.webServer']/section[@name='httpCompression']).
Info: Adding child appHostConfig (MSDeploy.webServer/webServer/appHostConfig[@path='']/location[@path='']).
Error: (12/28/2023 9:36:54 AM) An error occurred when the request was processed on the remote computer.
Error: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

Upvotes: 2

Views: 509

Answers (2)

deadlydog
deadlydog

Reputation: 24424

Error: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

This sometimes means that a port on the destination server is already in use by a different website. For example, the Default Web Site may be using port 80, and the problem can be fixed by removing the bindings from the IIS website on the destination server, changing the bindings port number, or deleting the website altogether.

Blog article with a bit more info

Upvotes: 1

samwu
samwu

Reputation: 5215

Cause:

Duplicate schema configuration xml file exists in "C:\Windows\System32\inetsrv\config\schema" folder.

Resolution:

Remove the duplicate schema configuration xml file from "C:\Windows\System32\inetsrv\config\schema" folder and restart WAS service.

NOTE: This same error shown when WAS fails to start can happen for different but similar schema file related issues, so it is imperative to identify which schema file is causing the issue - and Procmon trace can help with that.

More information you can refer to this link: Cannot create a file when that file already exists.

Upvotes: 0

Related Questions