[Won't Fix] svn6775 is not compatible with old user-made presets

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

[Won't Fix] svn6775 is not compatible with old user-made presets

Post by Lazyncoder »

OK, this started by svn6765. i just killed all the presets I made before. I recovered them from a backup file. reinstalled svn6759 and everything went fine. I tried svn6775, same thing happened:

Image

Code: Select all

HandBrake has detected a problem with your presets.
HandBrake has detected a problem with your presets.
Your old presets file has been renamed so that it doesn't get loaded on next launch.
Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Int32'. Path '[0].Task.PreviewEncodeStartAt', line 121, position 35. ---> 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) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 877
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 888
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 312
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 912
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1981
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 445
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 280
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 912
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1981
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 445
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 280
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1440
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 797
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 282
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 186
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonSerializer.cs:line 710
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonConvert.cs:line 846
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) in c:\Development\Releases\Json\Working\Newtonsoft.Json\Src\Newtonsoft.Json\JsonConvert.cs:line 805
   at HandBrakeWPF.Services.Presets.PresetService.LoadPresets() in c:\HandBrake\Hudson\workspace\WindowsGui64\trunk\win\CS\HandBrakeWPF\Services\Presets\PresetService.cs:line 505
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: svn6775 is not compatible with old user-made presets

Post by s55 »

There is no upgrade support for presets, so when the underlying models change, presets need to be re-created.

Given the regular changes that get made to models, especially in the nightly builds I don't see any easy way of maintaining compatibility.

I will however improve that error message. I'm also going to change that failed property to nullable. It may import then assuming nothing else breaks it. If not I'll just bump the version number so it doesn't even try. It'll just archive.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: svn6775 is not compatible with old user-made presets

Post by s55 »

Word of warning. I'm refactoring the video tab at the moment which will break user presets again in the next few days.

Best keep a note of your settings :)
lcm121
Posts: 15
Joined: Tue Feb 28, 2012 8:39 pm

Re: svn6775 is not compatible with old user-made presets

Post by lcm121 »

Hi. I've got >10 user settings and it would be a bit cumbersome to re-create them with the GUI every time the compatibility breaks. My idea is to export the user settings to a file, figure out what changed and make the settings "compatible" again (after all its just an XML file), and re-import to the new HB version.

However, the export and import button only support one user preset at a time. Is there a chance to make the export and import button work with multiple/all user presets?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: svn6775 is not compatible with old user-made presets

Post by s55 »

It's not on the cards for the moment. Way too much else to work on first.

Frankly, import/export barely works properly at the best of times, so it needs some much needed TLC as well.
gamecaptor
Experienced
Posts: 87
Joined: Tue Nov 23, 2010 10:32 pm

Re: svn6775 is not compatible with old user-made presets

Post by gamecaptor »

Yup, same issue here. Upgraded to svn6783 and my user presets are all gone. I noticed a file called user_presets.xml.archive.4488 (assumingly these are my old presets at my user_presets.xml was no longer there). I recreated one of the presets and it made a new file called user_presets.json. I'm assuming that is the new format (i.e. this is the file I should be backing up moving forward)?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: svn6775 is not compatible with old user-made presets

Post by s55 »

JSON is the new format, but backing it up won't help if I make additional format changes. IT simply won't load. There is no upgrade support even between minor changes.

You can export via the GUI to a plist format. But that is also subject to change to the point that you'll need to manually update the plist format with any changes that get made. (i.e by comparing old to new)
gamecaptor
Experienced
Posts: 87
Joined: Tue Nov 23, 2010 10:32 pm

Re: [Won't Fix] svn6775 is not compatible with old user-made presets

Post by gamecaptor »

Ah, ok. I will write down all my settings then for any future changes. Thanks for the info.
Lazyncoder
Novice
Posts: 63
Joined: Wed Dec 17, 2014 11:19 am

Re: svn6775 is not compatible with old user-made presets

Post by Lazyncoder »

s55 wrote:Word of warning. I'm refactoring the video tab at the moment which will break user presets again in the next few days.

Best keep a note of your settings :)
Excuse me, is it OK now to create user presets? or should we wait more?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: [Won't Fix] svn6775 is not compatible with old user-made presets

Post by s55 »

There is nothing stopping you creating user presets. They are just not ever guaranteed to work with the next build, hence my suggestion to keep a note of the settings.

The Video Tab re-factor is done and I don't have any major changes pending to the models at the moment, so in theory, they should be fine for a while atleast. No promises though.
Post Reply