Jeremy Posted September 1, 2022 Posted September 1, 2022 I am trying to run the clean utility but it's coming up with an error all the time..... Quote Error decoding configuration file conf.json : invalid character 'T' looking for beginning of value Please can anyone shed any light on this?
Steve Giller Posted September 1, 2022 Posted September 1, 2022 The error suggests that there is a 'T' where it's expecting something else. I would begin by checking that the JSON is valid with an online validator, and then ensuring that all text values are enclosed in quotes. 2
Jeremy Posted September 1, 2022 Author Posted September 1, 2022 So I have checked and added "s around the True but now there is another error Error decoding configuration file conf.json : json: cannot unmarshal string into Go struct field cleanerConfStruct.CleanAssets of type bool The code is this, we are just clearing out one asset class: { "CleanRequests": false, "RequestServices":[], "RequestCatalogItems":[], "RequestStatuses":[], "RequestTypes":[], "KeepRequestsCancelBPTasks": false, "RequestReferences":[], "RequestLogDateFrom":"", "RequestLogDateTo":"", "RequestClosedDateFrom":"", "RequestClosedDateTo":"", "CleanAssets": "True", "AssetClassID": "mobileDevice", "AssetTypeID": "22", "AssetFilters": [], "CleanUsers":false, "Users":[], "CleanServiceAvailabilityHistory": false, "ServiceAvailabilityServiceIDs": [], "CleanContacts": false, "ContactIDs": [], "CleanOrganisations": false, "OrganisationIDs": [], "CleanSuppliers": false, "SupplierIDs": [], "CleanSupplierContracts": false, "SupplierContractIDs": [], "CleanEmails": false, "EmailFilters": { "FolderIDs": [], "RecipientAddress": "", "RecipientClass": "", "ReceivedFrom": "", "ReceivedTo": "", "Subject": "" } }
Steve Giller Posted September 1, 2022 Posted September 1, 2022 7 minutes ago, Jeremy said: Error decoding configuration file conf.json : json: cannot unmarshal string into Go struct field cleanerConfStruct.CleanAssets of type bool In that case use true as the boolean without any quotes and all lower case. True or "True" are not boolean values
Jeremy Posted September 1, 2022 Author Posted September 1, 2022 So I have changed to "CleanAssets": true, "AssetClassID": "mobileDevice", "AssetTypeID": "22", "AssetFilters": [], But there is still an error Error decoding configuration file conf.json : json: cannot unmarshal string into Go struct field cleanerConfStruct.AssetTypeID of type int
Steve Giller Posted September 1, 2022 Posted September 1, 2022 14 minutes ago, Jeremy said: "AssetTypeID": "22", "22" is not a number. 22 is a number.
Jeremy Posted September 1, 2022 Author Posted September 1, 2022 Thanks, sorry I think I need more coffee!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now