Problems importing project

I had to reinstall Octopus for a few reasons, in order not to lose any work done, I’ve exported my only project to a JSON file but now I’ve a problem importing it back.

both versions were the latest (Octopus 3.3.9)

C:\rxtfs>octo import --server=http://localhost/api --apiKey=API-3PJ8LQVDTQBRUFJR
XXJPQURE --type=project --filePath=“C:\rxtfs\ocProject.json”
Octopus Deploy Command Line Tool, version 3.3.11+Branch.master.Sha.9fe1e5688698d
749fe85e52e3f7be7c98249f194

Handshaking with Octopus server: http://localhost/api
Handshake successful. Octopus version: 3.3.9; API version: 3.0.0
Authenticated as: pedro <>
Finding importer ‘project’
Validating the import
Export file successfully loaded
Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use
for type Octopus.Client.Model.PropertyValueResource. A class should either have
a default constructor, one constructor with arguments or a constructor marked wi
th the JsonConstructor attribute. Path ‘DeploymentProcess.Steps[0].Actions[0].Pr
operties.Password.HasValue’, line 1, position 2890.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject
(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMem
ber, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCr
eator)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Js
onReader reader, Type objectType, JsonContract contract, JsonProperty member, Js
onContainerContract containerContract, JsonProperty containerMember, Object exis
tingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDiction
ary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract,
JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Js
onReader reader, Type objectType, JsonContract contract, JsonProperty member, Js
onContainerContract containerContract, JsonProperty containerMember, Object exis
tingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValu
e(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract
containerContract, JsonProperty containerProperty, JsonReader reader, Object tar
get)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(
Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty m
ember, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Js
onReader reader, Type objectType, JsonContract contract, JsonProperty member, Js
onContainerContract containerContract, JsonProperty containerMember, Object exis
tingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IL
ist list, JsonReader reader, JsonArrayContract contract, JsonProperty containerP
roperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(Json
Reader reader, Type objectType, JsonContract contract, JsonProperty member, Obje
ct existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValu
e(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract
containerContract, JsonProperty containerProperty, JsonReader reader, Object tar
get)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(
Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty m
ember, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Js
onReader reader, Type objectType, JsonContract contract, JsonProperty member, Js
onContainerContract containerContract, JsonProperty containerMember, Object exis
tingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IL
ist list, JsonReader reader, JsonArrayContract contract, JsonProperty containerP
roperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(Json
Reader reader, Type objectType, JsonContract contract, JsonProperty member, Obje
ct existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValu
e(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract
containerContract, JsonProperty containerProperty, JsonReader reader, Object tar
get)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(
Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty m
ember, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Js
onReader reader, Type objectType, JsonContract contract, JsonProperty member, Js
onContainerContract containerContract, JsonProperty containerMember, Object exis
tingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValu
e(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract
containerContract, JsonProperty containerProperty, JsonReader reader, Object tar
get)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(
Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty m
ember, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Js
onReader reader, Type objectType, JsonContract contract, JsonProperty member, Js
onContainerContract containerContract, JsonProperty containerMember, Object exis
tingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInte
rnal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty mem
ber, JsonContainerContract containerContract, JsonProperty containerMember, Obje
ct existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Jso
nReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type
objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, Jso
nSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSeriali
zerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at Octopus.Cli.Importers.FileSystemImporter.Import[T](String filePath, String
entityType)
at Octopus.Cli.Importers.ProjectImporter.Validate(Dictionary`2 paramDictionar
y)
at Octopus.Cli.Importers.BaseImporter.Validate(String[] parameters)
at Octopus.Cli.Commands.ImportCommand.Execute()
at Octopus.Cli.Commands.ApiCommand.Execute(String[] commandLineArguments)
at Octopus.Cli.Program.Main(String[] args)
Exit code: -3

ocProject.json (28 KB)

Hi Pedro,

Thanks for getting in touch and sending your project.

I have fixed the issue and will deploy a new version of octo.exe today.

Cheers,
Shane

Got a similar error here. Do you need a sample project? I’d prefer to avoid it for security reasons as I’ll have to scrub it, but it could be done. I’m on the latest octo.exe, file modify date of 03/07/2016.

Finding importer 'project’
Validating the import
Export file successfully loaded
Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type Octopus.Client.M
odel.PropertyValueResource. A class should either have a default constructor, one constructor with argume
nts or a constructor marked with the JsonConstructor attribute. Path ‘DeploymentProcess.Steps[2].Actions[
0].Properties.[‘Octopus.Action.IISWebSite.ApplicationPoolPassword’].HasValue’, line 1, position 20838.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonO
bjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Bo
olean& createdFromNonDefaultCreator)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type obj
ectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonPropert
y containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionar
y, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type obj
ectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonPropert
y containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property,
JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty,
JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonRea
der reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type obj
ectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonPropert
y containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader read
er, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objec
tType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property,
JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty,
JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonRea
der reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type obj
ectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonPropert
y containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader read
er, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objec
tType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property,
JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty,
JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonRea
der reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type obj
ectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonPropert
y containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property,
JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty,
JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonRea
der reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type obj
ectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonPropert
y containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, T
ype objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type obje
ctType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings setti
ngs)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at Octopus.Cli.Importers.FileSystemImporter.Import[T](String filePath, String entityType)
at Octopus.Cli.Importers.ProjectImporter.Validate(Dictionary`2 paramDictionary)
at Octopus.Cli.Importers.BaseImporter.Validate(String[] parameters)
at Octopus.Cli.Commands.ImportCommand.Execute()
at Octopus.Cli.Commands.ApiCommand.Execute(String[] commandLineArguments)
at Octopus.Cli.Program.Main(String[] args)
Exit code: -3

This has become a low priority for us. Turns out the DB Import feature is far more robust and effective than the octo.exe import utility, and accomplished what we needed here.