[confirm] Exception while exporting settings (1 Viewer)

doskabouter

Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    Just updated to MP 1.6.0, and was about to upgrade mysql.
    First step that was needed was create a backup of the settings, through Tvserver config/ImportExport/Export now
    Did that, but it never finishes. After inspecting the logs and do some debugging, it seems that in the export methid
    Code:
      AddAttribute(nodeMap, "ChannelName", map.ReferencedChannel().DisplayName);
    is called at "exporting radio channel groups", and that gives me a nice NullReferenceException.
    I don't know if it's just me (never used radio within MP so probably the radio part of the database isn't what is expected), but in this case some extra checks need to be done to ensure proper execution
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Weird...
    I have 1 channel group, TV & Radio channels in them + Webstreams added to the TV Server.
    Just tried export with all checks:
    Export.PNG


    Could the error you're seeing come from unmapped channels?
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Just updated to MP 1.6.0, and was about to upgrade mysql.
    First step that was needed was create a backup of the settings, through Tvserver config/ImportExport/Export now
    Did that, but it never finishes. After inspecting the logs and do some debugging, it seems that in the export methid
    Code:
      AddAttribute(nodeMap, "ChannelName", map.ReferencedChannel().DisplayName);
    is called at "exporting radio channel groups", and that gives me a nice NullReferenceException.
    I don't know if it's just me (never used radio within MP so probably the radio part of the database isn't what is expected), but in this case some extra checks need to be done to ensure proper execution

    Can you try to supply a patch ? i think i have fixed an similar issue but still hard to reproduce :)
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    You could put this
    Code:
      foreach (RadioGroupMap map in maps)
      {
      Channel referencedChannel = map.ReferencedChannel();
      if (referencedChannel != null)
      {
      XmlNode nodeMap = xmlDoc.CreateElement("map");
      AddAttribute(nodeMap, "ChannelName", referencedChannel.DisplayName);
      AddAttribute(nodeMap, "SortOrder", map.SortOrder.ToString());
      nodeRadioGroupMap.AppendChild(nodeMap);
      }
      }

    instead of
    Code:
      foreach (RadioGroupMap map in maps)
      {
      XmlNode nodeMap = xmlDoc.CreateElement("map");
      AddAttribute(nodeMap, "ChannelName", map.ReferencedChannel().DisplayName);
      AddAttribute(nodeMap, "SortOrder", map.SortOrder.ToString());
      nodeRadioGroupMap.AppendChild(nodeMap);
      }

    And some similar probably at the tv groups.
    Should we provide some feedback, as you are losing information if you do an export/import with this patch?

    Edit: and while you have the setuptv open in visual studio: it wouldn't hurt to fill Filter and FilterIndex in the openfiledialog1 and savefiledialog1 :) in ImportExport
     
    Last edited:

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    Well, it was quite an adventure updating mysql. took me a couple of uninstall/install cycles of mysql and tvservice.
    Turned out that after importing settings from previously export.xml triggered an exception
    Code:
    [2013-12-31 18:41:41,367] [Log  ] [SetupTv  ] [ERROR] - Failed to startup cause of exception
    [2013-12-31 18:41:41,367] [Log  ] [SetupTv  ] [ERROR] - Exception  :System.FormatException: Input string was not in a correct format.
      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
      at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
      at SetupTv.Sections.CardDvbC.SetDefaults()
      at SetupTv.Sections.CardDvbC.Init()
      at SetupTv.Sections.CardDvbC..ctor(String name, Int32 cardNumber)
      at SetupTv.SetupTvSettingsForm.AddServerTvCards(Servers servers, IList`1 dbsServers, Boolean reloaded)
      at SetupTv.SetupTvSettingsForm.Init()
      at SetupTv.SetupTvSettingsForm..ctor(Boolean ShowAdvancedSettings)

    And after that, most of the UI of tvserver config was gone...
    Had to do the whole routine of installing tvservice (channel scanning, rec. schedules, paths etc) manually...
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Thanks :)
    TVE3 is in code freeze so not sure about the fix :(.

    I think i run into the same issue and thinking we have fixed that but it seems not.

    Fresh install should work correctly and backup/restore db too, that not cool that you run into such big issue :(
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    Well, it couldn't hurt anyway to do a clean install: gets rid of all the prehistoric stuff that lurked around after all my experiments.

    But I do think this should be thoroughly tested in new tvengine
     

    Users who are viewing this thread

    Top Bottom