Scope-IT / marksman

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

issue running agent #17

Closed mdesnoyers closed 5 years ago

mdesnoyers commented 5 years ago

When we run the agent, we get the following error....

C:\Program Files (x86)\Scope-IT\Marksman>marksman 5/15/2019 9:47:44 AM: Started application. HTTP 200: Connection to Snipe-IT instance succeded. Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer Instance name: LENOVO 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: 10MR0004US Already exists in DB Attempting to create type: SnipeSharp.Endpoints.Models.Company Instance name: PACT

Unhandled Exception: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) 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.EndpointManager1.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)

danielhogg commented 5 years ago

Looks like it's having an issue with creating the company. What is the value of your company key in the appSettings block of your config file? It will look something like this:

<add key="Company" value="YOUR_COMPANY_HERE"/>
mdesnoyers commented 5 years ago

This is what we have

<?xml version="1.0" encoding="utf-8" ?>

mdesnoyers commented 5 years ago

<?xml version="1.0" encoding="utf-8" ?>

mdesnoyers commented 5 years ago
<add key="BaseURI" value="YOUR ENDPOINT HERE (edited for security)"/>
<add key="DefaultStatusLabel" value="In Production"/>
<add key="Company" value="PACT"/>
<add key="Location" value="MSO"/>
<add key="OUEnabled" value="false"/>
<add key="OULevel" value="1"/>
<add key="Interactive" value="false"/>
<add key="WarrantyMonths" value="60"/>
<add key="AssetTagPrefix" value="001"/>

mdesnoyers commented 5 years ago

ok i set my value to "" and it work.... but we would like to be able to set per location or divisions

danielhogg commented 5 years ago

If you go to your SnipeIT frontend web interface, and go into Settings -> Companies, what entries are present currently?

mdesnoyers commented 5 years ago

companies PACT GCC MCMA PSS CKC WHMG Ortho

mdesnoyers commented 5 years ago

it works for now, cant wait for future updates. thanks again for your help