Failed to deploy component - "Cannot deserialize current JSON object ..."

Background Information

  • TFS 2015 RC2
  • Release Management Server 2015
  • Azure VM with Deployment Agent 2015
  • Physical Local Machine with Deployment Agent 2015

Both machines need a drag location using the Through Release Management Server over HTTP(S) option. We are currently using the HTTP portion of things over port 1000.

Workflow

  • Stop application pool (working)
  • Stop the site (working)
  • Copy website directory to backup folder (working)
  • Reserve database (operational)
  • Expand the component (doesn't work) using
    • hsooru
    • msdeploy (web deployment package)

Error (TL; DR)
The same error is accepted every time, it does not matter which machine or which deployment method. The component always fails with the JSON.NET problem.

 7/22/2015 3:03:39 PM - Error - (13704, 104) - Cannot deserialize the current JSON object (eg {"name":"value"}) into type 'System.String[]' because the type requires a JSON array (eg [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (eg [1,2,3]) or change the deserialized type so that it is a normal .NET type (eg not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'ErrorMessage', line 1, position 16.: \r\n\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseDeploymentControllerServiceProxy.GetPackageFileInfos(String packageLocation) at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.HttpPackageDownloader.CopyPackageAndUnpackIt(String packageSourceLocation, String filesDestinationLocation) at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.CopyComponentFiles() at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.ComponentProcessor.DeployComponent() 

Update (workaround)
How does it work, if I edit the assembly configuration to have a UNC path as the delete location, the deployment will succeed. However, I want to use the Copy build output to server option.

+7
ms-release-management
source share
3 answers

The removal of the deployment installation and the installation of RM 2015 to deploy RTM should solve this problem.

In previous versions of RM, there was a problem when the NewtonSoft.Json dll was not updated during the deployment system upgrade.

0
source share

I don’t think MS really checked the agent releases with Update 1. I got the same error, which is actually just a general error message when using deployment via HTTP. When I converted it to deployment via UNC paths, I found out what the problem was.

As you might know with TFS 2015, you had to name the release components in exactly the same way as the names of the artifacts. Thus, the “WebApp X” artifact has a release component called “WebApp X” in RM, with a sub-path “WebApp X”.

In my release configuration, I have 3 different components (and artifacts). So, on disk, it was:

  • '\ build \ WebApp X'
  • '\ build \ WebApp Y'
  • '\ build \ WebApp Z'

Worked fine with 2015 RTM. Now after update 1, he is looking for the following:

  • '\ build \ WebApp X \ WebApp X'
  • '\ build \ WebApp X \ WebApp Y \'
  • '\ build'WebApp X \ WebApp Z'

I don’t know why he does it and how to solve it, but I manually changed the folders in the artifact removal folder, and RM picked it up perfectly. So I'm still looking at how to fix this so that it works correctly.

0
source share

This json problem occurs if the user under the RM server application pool does not have access to the component uninstall location, and you selected the option "Through the RM server URL"

Thus, as a fix, you can grant access to the drop to the permissions of the application pool users. You can see the correct error in the server logs. "Package location" \ share "does not exist or the application pool user does not have access"

0
source share

All Articles