Scope-IT / marksman

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

Issue when adding asset - v1.5.0 #24

Closed 1TF0rward closed 5 years ago

1TF0rward commented 5 years ago

Hi,

I am getting this error when trying to run the agent.

15/07/2019 08:52:56: Started application. HTTP 200: Connection to Snipe-IT instance succeded. Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer Instance name: Hewlett-Packard 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: HP Compaq Elite 8300 Touch All-in-One PC Already exists in DB Attempting to create type: SnipeSharp.Endpoints.Models.Company Instance name: Bowland High Already exists in DB Attempting to create type: SnipeSharp.Endpoints.Models.StatusLabel Instance name: ready to deploy

Unhandled Exception: SnipeSharp.Exceptions.InvalidStatusLabelTypeException: Ready to Deploy (deployed) 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, ObjectConstructor1 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.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.EndpointManager1.FindOne(ISearchFilter filter) at SnipeSharp.Endpoints.EndpointManager`1.Create(T toCreate) 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)

I have tried to change the status label and still get the same issue. The old one still works but would rather have the auto updater.

1TF0rward commented 5 years ago

Fixed it.

There were multiple "Ready to Deploy"'s in Snipe IT. Removed them. Purged deleted records as it still thought it was already an asset.