Scope-IT / marksman

Windows agent for Snipe-IT asset management system
Apache License 2.0
132 stars 23 forks source link

Issue with asset's checking in when custom status #33

Open Joshuaharry120 opened 4 years ago

Joshuaharry120 commented 4 years ago

So, following on from setting the status of a device to Damaged - Water Damage.

the script is now treated with the following error.

C:\Program Files (x86)\Scope-IT\Marksman>Marksman.exe
06/07/2020 09:43:16: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: Gigabyte Technology Co., Ltd.
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Category
Instance name: Desktop
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Model
Instance name: AX370-Gaming K5
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Company
Instance name: Partnerize
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.StatusLabel
Instance name: Ready to Deploy
Already exists in DB
Attempting to create type: SnipeSharp.Endpoints.Models.Location
Instance name: NCL
Already exists in DB

Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: Damaged - Water Damage Is an invalid status label.  Use undeployable, deployable, pending, archived, in production, ready to deploy
   at SnipeSharp.Endpoints.Models.StatusLabel.set_Type(String value)
   at SnipeSharp.Endpoints.Models.StatusLabel..ctor(String name)
   at Void .ctor(System.String)(Object[] )
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
   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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   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 Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at SnipeSharp.Endpoints.ExtendedManagers.AssetEndpointManager.FindBySerial(String serial)
   at Marksman.Broker.SyncAll(SnipeItApi snipe, Asset currentAsset, Model currentModel, Manufacturer currentManufacturer, Category currentCategory, Company currentCompany, StatusLabel currentStatusLabel, Location currentLocation)
   at Marksman.Marksman.Main(String[] args)

C:\Program Files (x86)\Scope-IT\Marksman>pause
Press any key to continue . . .

image

danielhogg commented 4 years ago

Thanks for raising this issue. I'll take a look at it this weekend.