Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on first run "Unhandled Exception" #39

Open
AndreBrio opened this issue Feb 18, 2021 · 9 comments
Open

Error on first run "Unhandled Exception" #39

AndreBrio opened this issue Feb 18, 2021 · 9 comments

Comments

@AndreBrio
Copy link

Hello all

on my first client, where i'm testing snipeit and your agent we receive an error as show below. On snipeit I can see only the category "Laptop" has been created

C:\Program Files (x86)\Scope-IT\Marksman>Marksman.exe
18/02/2021 19:44:50: Started application.
HTTP 200: Connection to Snipe-IT instance succeded.
Attempting to create type: SnipeSharp.Endpoints.Models.Manufacturer
Instance name: FUJITSU
Attempting to create type: SnipeSharp.Endpoints.Models.Category
Instance name: Laptop

Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'rows[0].eula', line 1, position 108. ---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
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.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
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)

C:\Program Files (x86)\Scope-IT\Marksman>

@rickardhildingsson
Copy link

I have same issue and really like snipe-it but is needing an automation of this

@FRP974
Copy link

FRP974 commented Feb 27, 2021

Hi, I see the same problem on a first installation of the solution. Also on a Fujitsu workstation, I don't know if it's a common point, but all our computers are on this manufacturer. Too bad, I really want to use this application.

@hatemfares
Copy link

I have same issue

@ReticentRobot
Copy link

This seems to be a bug when running Snipe-IT version 5+ as seen here: #37

I've posted a potential solution at the bottom of that thread.

@ReticentRobot
Copy link

I haven't been able to get in touch with the developer, so have started my own version of the project. You can download it here if you are interested: https://github.com/ReticentRobot/SnipeAgent

@snelzing
Copy link

I haven't been able to get in touch with the developer, so have started my own version of the project. You can download it here if you are interested: https://github.com/ReticentRobot/SnipeAgent

Did you fix the issue?

@ReticentRobot
Copy link

I haven't been able to get in touch with the developer, so have started my own version of the project. You can download it here if you are interested: https://github.com/ReticentRobot/SnipeAgent

Did you fix the issue?

Yes, it has been a long while - but the version I have has the fix in it that I mentioned above.

@snelzing
Copy link

I haven't been able to get in touch with the developer, so have started my own version of the project. You can download it here if you are interested: https://github.com/ReticentRobot/SnipeAgent

Did you fix the issue?

Yes, it has been a long while - but the version I have has the fix in it that I mentioned above.

Cool - out of curiosity how did you wound up fixing it?

@ReticentRobot
Copy link

Lol, nothing too much - I couldn't remember what it was but found this comment I left back then, this is all I did:

"Disclaimer: I am not a programmer

I've found that if you change line 45 in Category.cs in the SnipeSharp project from:

public bool eula { get; set; }

to

public string eula { get; set; }

that this will get the agent working on 5.x"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants