Installation Problem - Problem with New Blog Template

After the installation of multi-db, I get following error trying to activate new blog:

Insertion Error: Table 'sportsli_global.wp_151_PO_groups' doesn't exist - The template was not applied. (New Blog Templates - With CREATE TABLE query for Additional Tables)

When I first checked the Blog Template settings, I first noticed that all of the tables in the advanced options were not there.

A few hours later, the list of checked tables are now in options. But I get the above error.

Please Help

  • antKat

    Help!

    We have not resolved the problem. Since I did not feel confident to do the multi-db myself and no-one responded to job posting at WPMUdev.org; VPS.net felt this was something they "could" do for me. I requested the 4,096 setup. Unfortunately, they decided to do a "test" run on Friday morning with 16. We had problems connecting afterwords to the sub-sites (subdirectories) but ultimately that problem was resolved. However, I was left with a major problem with the Blog Template - or probably anything that needs to create tables. Since it was the end of the week/week-end, this has stalled.

    Again, the error is:

    Insertion Error: Table 'sportsli_global.wp_151_PO_groups' doesn't exist - The template was not applied. (New Blog Templates - With CREATE TABLE query for Additional Tables)

    I originally stated in this thread "When I first checked the Blog Template settings, I first noticed that all of the tables in the advanced options were not there and then a few hours later they were back "- actually the never were "back" - another programmer tried to manually fix that problem - but it did not work. There are no tables indicated on the Advanced options in the Blog Template settings.

    Also, I assume that the 16 needs to be moved back to 1 before we can run the 4,096. Is that correct? But we need to understand what was done wrong in the "test" before we do this again.

  • antKat

    So that I could temporarily work on the site pending the instructions to fix problem, the vps tech told me to rename the dbconfig.php and db.php in wp-content. I did; however, now the Blog Template advanced tables show the following error:
    Fatal error: Cannot use object of type stdClass as array in /home/sportsli/public_html/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 1543

  • antKat

    Is anyone there???

    Without hearing from anyone here, I tried to convey what I thought was a misconception that the technical person helping with the MD install had after receiving some of his recommendations. I wrote to him the following - although I do not know if I amtotally correct:

    Me: "Reading through your response and recommendation, I believe that it is not clear to you what the multi-db plugin does - which splits the reads and writes; we will always be writing to one database but reading from many/any. In order to do this, you need to start with one database and establish the total databases at that time; in other words, if you start with 16 and max out, then you will need to put all 16 back into one to expand to 256 or 4096. In addition, I need to understand what was not set-up properly in the "test" setup that is currently causing the creating tables problem. In any case, I need you to put the system back to the original 1 database.

    I've attached an article written by the developer in which he shares how he scaled Edublogs to 500,000 blogs. Obviously, we are only trying to do the prep work at this time. But please note in the article, even for the 500,l000 blogs and 8,000,000 page views per month, their system resides on: 3x web-tier servers, 2x database servers and 1x file server. We should be able to continue to scale to this level using their approach-but we do not need to start with excess server capacity to start with."

    He wrote back with the following:
    "Can you please point me to instructions where it is said that multi-DB can split write/read queries to different database servers? In this case mysql replication can really helps."

    If you will note this whole thread may have been avoided if I could have gotten more response to my previous thread related to expectations and what specifically the tool and plugin does.
    Please help now.

  • antKat

    Barry,
    You may recall my participation in the live support on Friday regarding this. The confusion regarding the couple posts that you are seeing is that the first thread was a few days before the second, the first was trying to clarify a few issues prior to installation. Without getting the clarification, we went ahead anyway and here we are.

    They were supposed to setup and install for the 4096 databases. As I previously wrote, they decided to test with 16. The "test" created problems, some solved others not. We have stopped until we can get better clarification from you. I understand that we probably have to try to start from scratch, but this time I want to make sure we know what was setup wrong the first time - hopefully with your help. The db-config.php is as follows:

    <?php
    //	Plugin Name: Multi-DB
    //	Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    //	Author: Andrew Billits (Incsub), S H Mohanjith (Incsub)
    //  Version: 2.9.2
    //------------------------------------------------------------------------//
    //---DB Scaling-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	16,256,4096
    define ('DB_SCALING', '16');
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Usage: add_dc_ip(IP, DC)
    //	EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('174.127.121.231', 'dc1');
    //------------------------------------------------------------------------//
    //---Global Tables--------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Do not include default global tables
    //	Leave off base prefix (eg: wp_)
    //
    //	Usage: add_global_table(TABLE_NAME)
    //	EX: add_global_table('something');
    add_global_table('affiliatedata');
    add_global_table('affiliatereferrers');
    add_global_table('am_actions');
    add_global_table('am_queue');
    add_global_table('am_schedule');
    add_global_table('autoblog');
    
    add_global_table('bp_activity');
    add_global_table('bp_activity_meta');
    add_global_table('bp_friends');
    add_global_table('bp_groups');
    add_global_table('bp_groups_groupmeta');
    add_global_table('bp_groups_members');
    add_global_table('bp_messages_messages');
    add_global_table('bp_messages_notices');
    
    add_global_table('bp_messages_recipients');
    add_global_table('bp_notifications');
    add_global_table('bp_user_blogs');
    add_global_table('bp_user_blogs_blogmeta');
    add_global_table('bp_xprofile_data');
    add_global_table('bp_xprofile_fields');
    add_global_table('bp_xprofile_groups');
    
    add_global_table('domain_mapping');
    
    //------------------------------------------------------------------------//
    //---DB Servers-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Database servers grouped by dataset.
    //	R can be 0 (no reads) or a positive integer indicating the order
    //	in which to attempt communication (all locals, then all remotes)
    //
    //	Usage: add_db_server(DS, DC, READ, WRITE, HOST, LAN_HOST, NAME, USER, PASS)
    //	EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser',  'globalpassword');
    //
    //	Note: you can also place this section in a file called db-list.php in wp-content
    //  EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser',  'globalpassword');
    add_db_server('global', 'dc1', 1, 1,'localhost','localhost', 'sportsli_global', 'sportsli_wp1',  'sdf9798_3dfsd');
    
    add_db_server('0', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_0', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('1', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_1', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('2', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_2', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('3', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_3', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('4', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_4', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('5', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_5', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('6', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_6', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('7', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_7', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('8', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_8', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('9', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_9', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('a', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_a', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('b', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_b', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('c', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_c', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('d', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_d', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('e', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_e', 'sportsli_wp1',  'sdf9798_3dfsd');
    add_db_server('f', 'dc1', 1, 1,'127.0.0.1','localhost', 'sportsli_f', 'sportsli_wp1',  'sdf9798_3dfsd');
    
    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Usage: add_vip_blog(BLOG_ID, DS)
    //	EX: add_vip_blog(1, 'vip1');
    
    ?>
  • Barry

    Hi
    Most of that looks ok, Line 23 is wrong:
    add_dc_ip('174.127.121.231', 'dc1');
    It shouldn't have the last 3 characters in it (see the example on the line above).
    I would change all your 127.0.0.1 to localhost as they are the same thing anyway, so may as well call them the same thing.

    What plugin is using the table po_groups? Does the po part ring a bell for you? The error seems to have multi-db looking for it in the global database, which is wrong though 151 should be coming from database a

  • antKat

    Barry, thanks for the response. I'm sure we will ultimately get this resolved - but as you know - it doesn't take much to creat havoc.

    I should have probably done all of this myself - now I've got too many people on different timezones to try to coordinate availability. I will make the changes on the db-config.php.

    In regards to the po_groups, I do not recall which plugin is creating them.I'll do more investigation on it. I do have a total of 55 plugins of which about half are WPMUdev. It's interesting that prior to the attempt of the multi-db process, the blog templates listed probably ten tables; now that section is completely blank. If I could access the pre-migration system that I've tried to move to a different domain at GoDaddy, I would be able to quickly see - unfortunately, that changeover isn't going smoothly either and I get the "can't access the database" error over there.

    I would really like to try to resolve this "tonite" - how late might you be accessible if I need to try to get ahold of my programmer in a different timezone?

  • antKat

    Barry,
    1. I made the changes to the db-config.php as directed.
    2. I found the plugin with the po_groups (I don't know why I passed over it by name initially - I was looking for something more like communities that would create groups. Anyway, the plugin was "Plugin Organizer" - a plugin for specifying the load order of plugins. I've deactivated it.
    3. I went back to check the New Blog Template - it still shows none of the advanced tables; so I deactivated and reactivated that plugin - but no change on that front.

  • antKat

    I just tried to create a new site and got the following error even with the deactivated plugin:
    "Insertion Error: Table 'sportsli_global.wp_152_PO_groups' doesn't exist - The template was not applied. (New Blog Templates - With CREATE TABLE query for Additional Tables)

    Since I cannot access the New Blog advanced table selection; I'm going to try to remove the new blog as default and try to create a new site and rebuild the template. I hope this is the correct approach to this. What do you think? Did you see anything in regards to the databases I posted earlier?

  • Barry

    Does this look right to you?

    I assume the sportsli_db was the old main one, yes?

    3. I went back to check the New Blog Template - it still shows none of the advanced tables; so I deactivated and reactivated that plugin - but no change on that front.

    Not sure what you mean by that? Can you give a screenshot?

    I suggest clearing out the blog templates you have and creating a simple one and see if that works first, that way we can narrow down issues. The blog template plugin isn't my area of expertise, but the multi-db plugin is so i'm concentrating on that area initially.

    All plugins should work with multi-db, they shouldn't even know it's there in the majority of cases.

  • antKat

    Although I tried creating a new blog template last night to see if starting fresh would make a difference; it made no difference. In any case, selecting any of the created blog templates show no additional tables in advanced as shown in attached screenshot. Notice that the advanced tables section indicates that there are no plugins requiring the database tables; there are close to a dozen tables that should be listed here. Again, prior to the multi-db, they were listed and copied over to new sites.

    I will try again and create a new, simpler template.

  • antKat

    Aaron,
    Thank you for your response. We do have a couple of plugins that have database tables. There has never been any documentation that I've seen that says that one should avoid this, in fact, the New Blog Template provides for this. This had not been a problem when in the single database with these plugins; it only arose after. I'm not certain that the database replication was even done properly, that's what I'm trying to get to the bottom of - It was great when it was working. So, what really changes in the multi-db that may be causing the problem or what could have been done wrong in the replication process that is the impediment. Hopefully we can work this out.

  • Vladislav

    Hi,

    I managed to replicate the environment to an extent and went through how the plugin behaves in this scenario. I believe this is what's going on - the plugin does select the tables as Aaron described, but at that point they most likely won't be found, as it looks in the site database (not the global one). Since only the basic tables are replicated in databases outside of the global one, the other tables aren't found.

    I have edited the plugin code a bit to make it work in your environment - it does in mine, but it would be awesome if you could test it too and verify we're actually onto something here. It will also need a specific template setup, and these are the required steps:

    1) Update the plugin with the attached code
    2) Create a new template using your *main site* (side id = 1) as template site. This is important, as that site should use the global database, which is where the extra tables you want are located.
    3) Edit your template - it should show the extra tables in Advanced section, and you can select any number of them to be copied over to your new sites database.

    Any new site based on this template should have all the extra tables you selected copied.

    If you wish to use a different site for your template (not your main site), you'll still need to do the steps 1-3 above first. Next, create a new site using the template you just created (from your main site). This will create a site you can use as a template instead of your main site and copy over the data and tables you want to use. After that, create a new template based on your new site and select any extra tables you want. Once you're done, you can safely delete the template based on your main site, as now you have another one you can use with the tables you want.

  • antKat

    Hi,
    We are making some progress . . . . I think! I forwarded your instructions to my programmer. This is his remarks from the test:

    "I setup everything as WPMUdev mentioned. Now the additional table are displaying in the Advanced section of Blog Template
    I make the main site as Default Template and select the tables that we need replicate in the new blogs Now everything is setup according the WPMUdev.
    Then I try to create the new blog but in the second step, after submitting website details it is giving me the error(screen shot is attached).

    Then I thought to set the general sports (our original default template) as Default Template.
    and created a new blog, what I see everything working fine i created 2 blogs and both are working fine, you can check it.

    can you ask WPMUdev, if there is any strong reason to set the main site as Default Template for first time.
    if we will do this then we need to set all the setting from generalsports blog to newly created blog for making that as default.

    Please respond. It looks like there may be a solution that helps both of us. Thank you for addressing the problem. I have been working on this site since February and had hoped for a soft, friends & family beta June 1 with a full launch in August. A primary requirement for our site is ease of use and that is why there is such an importance of the New Blog Template - but since it is a free, public site we need to promote and be prepared to scale and that is why we are trying to use your multi-db. Since we had put in substantial time building the template, it was a big surprise when we first found that it may not work with multi-db. I've probably tested out the majority of your plug-ins with some working within our requirements and are adding some nice features and functionality and some, unfortunately needed further customization and needed to find alternatives or be put on the back burner. We are anxious to finally launch the soft beta. It looks like it may be possible with this combination; need to still understand any implications.

  • antKat

    VeBailovity, Barry
    We seem to have gotten through the advanced plugin tables. We now have a new error message. I didn't know whether to start a new thread in the New Blog Template or whether this is related, but since Vebailovity has revised the template plugin code through the troubleshooting of the multi-db/new blog template problem - I thought I would continue here.

    I'm getting the following error on activation:
    Deletion Error: Table 'sportsli_global.wp_202_options' doesn't exist - The template was not applied. (New Blog Templates - While removing auto-generated settings)

  • antKat

    OK - We found the problem.
    1. It is not associated to the New Template Plugin.

    2. The error was not happening with every activation After lots of effort we have found that In the Multi-DB plugin code and our server data base, there were 4 of the 16 databases missing. We still do not know what caused the mismatch between the db-config.php and the number of databases generated using the tool provided with the multi-db plugin. But since the plugin randomly writes to the different databases, and most of them were there, it was only happening when the randomness hit the databases that had not been created. I hope I am describing this OK. After creating the 4 missing databases, we have been able to consistently successfully add new blogs. We will continue to test throughout the next few hours. Since it is my understanding that the tool was used to create the databases and then used again with the plugin, I don't know what caused the mismatch. Something to be aware of.

    You may recall that our intent is to set-up the 4096 configuration and this had been a test using 16. If our testing still shows no problems throughout the day- now successfully using the New Blog Template with the multi-db, we will attempt to try the 4096 tomorrow. My understanding is that we MUST merge back into 1 first. Please confirm.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.