Database: Refactor MP1 database for multi seat usage (2 Viewers)

Anthony Vaughan

MP Donator
  • Premium Supporter
  • June 25, 2015
    584
    292
    Home Country
    United Kingdom United Kingdom
    OK, I will try this and report back (probably tomorrow).
    I have temporarily disabled database updates from this version because I want to ensure that we concentrate on making sure that the main functionality of the application works. Then, when I know that the app is working and everyone is on-board, I'll concentrate on making the database upgrade process work. This is by far the most complex task because I've normalized the databases and I cannot be sure, at this point, what people have in their databases. I expect database upgrades to be the most troublesome part of this upgrade.

    As a result of this, the refactored app will only create a database when one is not already there. If you tried installing the refactored app earlier then there may be an old version of the V6 database still lying around. The best way to guarantee that only the latest database layouts get used is for users to remove any existing client databases before running the either the client app or the GUI.

    Sorry, I did not make this clear. I use the "Bootit Bare Metal" boot manager to maintain multiple primary partitions on my HTPC. Each of these partitions hosts a separate copy of the OS and (usually) a different version of MP. Each OS partition sees only the data partitions in the HTPC -- the other OS partitions are hidden from the booted OS partition. The test partition is a copy of my MP 1.29 production partition.
    It's a long time since I used dual-boot but I think that is a neat way to handle testing. The install BAT file should have copied the correct exe.config files over for you. Please check that all files copied over successfully before continuing. Also, the script assumes that you have installed MP1 in the standard folders. If that is not the case then you will need to edit the script to point to your set-up. I've used variables to hold the locations (toFolder and toDataFolder).

    Loading of Utils.dll and Core.dll has been made optional in case anyone is using MPTray. The changes I have made in those two DLLs is more to do with suppressing annoying error messages than to do with functionality (I've changed the messages from ERROR to DEBUG when they aren't errors that we can do anything about).
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    If you tried installing the refactored app earlier then there may be an old version of the V6 database still lying around.
    I have just finished installing and testing the version 14 files. Unfortunately, there is no improvement. :(

    I have attached a zip file containing some screen shots, the MP log file, and the CONFIG file. If you need to see any other files, just ask.

    -- from CyberSimian in the UK
     

    Attachments

    • dblog2.zip
      906.2 KB

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    584
    292
    Home Country
    United Kingdom United Kingdom
    I have just finished installing and testing the version 14 files. Unfortunately, there is no improvement. :(
    This is very strange because the databases have been created correctly and all of the tables and indexes look right. They are generated using SQLite Client. The bit that goes wrong is the bit that gets data from the database and that uses EntityFramework. Now I know that the database is empty but the code that accesses the database is using LINQ to get any existing data in the database to place it is a cache. The failure occurs is in executing that fetch.

    The config file looks correct as well but there has to be a problem with the set-up. Could you make sure that the following files exist in C:\Program Files (x86)\Team MediaPortal\MediaPortal:

    EntityFramework.dll
    SQLite.Interop.dll
    System.Data.SQLite.dll
    System.Data.SQLite.EF6.dll
    System.Data.SQLite.Linq.dll

    When I tested renaming any of these, MP1 crashed out rather than hanging. But if you can check anyway then I can definitely rule that out.

    I know it's a pain, but would you please try the following. Instead of copying your current configuration to the partition, would you please install a fresh single seat installation of MP1.29, then run the BAT file and then delete the databases and run the GUI. By doing this, you will be mirroring exactly what I have been doing and we will identify whether you are using something that isn't compatible with the refactored version.

    If you've already done that then let me know and we'll have to start going through the files one at a time.

    I've performed this procedure on over five separate machines and it's never gone wrong for me. Therefore, I suspect there may be a basic configuration difference between your initial set-up and a fresh install of 1.29.

    Thanks.

    Tony
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    Could you make sure that the following files exist in C:\Program Files (x86)\Team MediaPortal\MediaPortal:
    Those files are present in the update package and are copied by the BAT file, but they don't show in the screen shot as I limited the files listed to those changed in 2022. I will check tomorrow (Friday).

    Instead of copying your current configuration to the partition, would you please install a fresh single seat installation of MP1.29, then run the BAT file and then delete the databases and run the GUI.
    One of the drive images that I have stored is Windows 7 64 bit with nothing installed on it. I can restore that to some empty space and perform a first-time install of MP.

    -- from CyberSimian in the UK
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    584
    292
    Home Country
    United Kingdom United Kingdom
    One of the drive images that I have stored is Windows 7 64 bit with nothing installed on it. I can restore that to some empty space and perform a first-time install of MP.
    Believe it or not, I still have a machine running under Windows 7 32 bit. I need it to be able create and manage help files because the development software for help files stopped working under Windows 10 (and I don't like Windows 8).

    I already had MP1 1.27 installed on that machine. I ran an install of 1.29 updating the existing version and then ran the BAT file. I got no errors. So, the refactored version install and runtime runs under the 32 bit version. Let's hope it works for 64 bit as well - can't see why it wouldn't.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    Great! That should do the trick - with a following wind ;) .
    Unfortunately we are still experiencing headwinds. :(

    I restored my 64-bit Win 7 drive image, performed a first-time install of MP 1.29, and then installed the updates. I checked the sqlite files in the MP folder in "Program Files" (see screen shot in zip file).

    I confirmed that the MP database folder was empty, and that there was no "MediaPortal.xml".

    I then started "MP Config", but I did not make any changes. On exit, there were a couple of pop-ups warning me that TV Server would not work because some setup values were undefined.

    I checked that there was now a "MediaPortal.xml" file and database files in the MP database folder, and started MP. The "Home" panel appeared, but I exited immediately using ALT_F4. The MP log file is included in the zip file, and it seems to show the same or a similar error as previously:
    CreateDatabase is not supported by the provider.

    I started "MP Config" again and browsed around. "Videos", "Music", and "Pictures" all have default values for their respective folders and various other settings. Strangely, although I selected QUIT to exit "MP Config", the "MediaPortal.xml" file was still rewritten, and it had changed (some previously null sections now had values, even though I had not changed anything). I don't think that this behaviour is desirable -- appropriate default values should be set by MP regardless of whether I have visited the relevant panels in "MP Config" (this is not related to your changes, of course).

    -- from CyberSimian in the UK
     

    Attachments

    • dblog3.zip
      120.8 KB

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    584
    292
    Home Country
    United Kingdom United Kingdom
    I confirmed that the MP database folder was empty, and that there was no "MediaPortal.xml".
    I'm flumoxed. Are you using a centralized configuration (i.e. do you have MediaPortalDirs.xml in the users/documents folder)? Does MediaPortalDirs.xml contain what you would normally expect?

    The thing is that I have never seen the 'CreateDatabase is not supported by the provider.' error before, but it does point to EntityFramework not finding the databases - which should be found in the config file. The fact that the databases were created means that the config file was found but this error means that the EntityFramework configuration is not working for some reason.

    When I installed the refactored version on my Windows 7 machine it worked with no issues.

    I wonder whether the fact that you are using dual-boot is affecting what the path would be. It's a stretch, but I'm getting desperate :) . Do you have a machine available that you could use as a test machine that boots straight into Windows?

    It's the only suggestion I can make because I cannot reproduce what you are seeing?

    Also, are you installing any extensions?
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    584
    292
    Home Country
    United Kingdom United Kingdom
    Just a thought, but what version of the .NET Framework runtime do you have installed?

    I wonder whether you need to install 4.5.1 Multi-targeting pack (at least). My Windows 7 machine has .NET Framework 4.8 and 4 Multi-targeting pack. My client Windows 10 client machines have .NET Runtime 5.0.9 (x64).
     

    Users who are viewing this thread

    Top Bottom