error in Step 4: Database Changes

Started by Marcelo Mika, November 23, 2014, 04:02:26 AM

Previous topic - Next topic

Marcelo Mika

upgrading from 2.0.9 to 2.1 some errors.

2.0.9 installed clean to test the update.

The process stops : Step 4: Database Changes

Database Changes
Executing database changes


Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made!
Executing upgrade script 2 of 2.
Executing: "Membergroup icons changes" (16 of 40 - of this script)




Error!
Server has not responded for 30 seconds. It may be worth waiting a little longer or otherwise please click here to try this step again



I click here, retries unsuccessfully and it is impossible to continue ..

margarett

http://www.simplemachines.org/community/index.php?topic=530273.0

Probably your server fails to withstand the beating the upgrader imposes him :P

Who is your host?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Marcelo Mika

Grazie mille !

Hostingmontevideo.com

a hosting which you no longer use.
He has been limited so far.
Unlimited plan ever worked with smf and 20,000 members, now you install a test site and hit the limit with one connection ...

margarett

It's not the same thing... The upgrade process is a quite intense one... Several queries are thrown at the server, far more difficult to handle than the normal forum navigation...

Can you try it at localhost?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

lc62003

I get the same error on a very small test site.  Taking the site out of maintenance mode manually gives this error: 

Table 'salvage.smf_moderator_groups' doesn't exist


Checking the database this is true, though there is a table smf_group_moderators



Are these items related?   8)

Marcelo Mika


Oldiesmann

The "smf_moderator_groups" table is a new table in 2.1. If it doesn't exist, that means the upgrader never completed properly.
Michael Eshom
Christian Metal Fans

lc62003

Quote from: Oldiesmann on November 24, 2014, 11:55:28 AM
The "smf_moderator_groups" table is a new table in 2.1. If it doesn't exist, that means the upgrader never completed properly.

Right.  Perhaps I should ask it a different way. 

Is there supposed to be a table named smf_moderator_groups and a table named smf_group_moderators?  Or is one of those misnamed in the script so it can't complete? 

Arantor

There are supposed to be both tables, yes.

lc62003

Quote from: Arantor on November 24, 2014, 12:28:18 PM
There are supposed to be both tables, yes.

Roger that.  Thanks Arantor.   8) 

lc62003

#10
The hangup is due to the script attempting to remove the "Core" theme.   The workaround is easy.  Edit the "upgrade_2-1_mysql.sql" file and remove the following:



/******************************************************************************/
--- Cleaning up after old themes...
/******************************************************************************/
---# Checking for "core" and removing it if necessary...
---{
// Do they have "core" installed?
if (file_exists($GLOBALS['boarddir'] . '/Themes/core'))
{
$core_dir = $GLOBALS['boarddir'] . '/Themes/core';
$theme_request = upgrade_query("
SELECT id_theme
FROM {$db_prefix}themes
WHERE variable = 'theme_dir'
AND value ='$core_dir'");

// Don't do anything if this theme is already uninstalled
if ($smcFunc['db_num_rows']($theme_request) == 1)
{
// Only one row, so no loop needed
$row = $smcFunc['db_fetch_array']($theme_request);
$id_theme = $row[0];
$smcFunc['db_free_result']($theme_request);

$known_themes = explode(', ', $modSettings['knownThemes']);

// Remove this value...
$known_themes = array_diff($known_themes, array($id_theme));

// Change back to a string...
$known_themes = implode(', ', $known_themes);

// Update the database
upgrade_query("
REPLACE INTO {$db_prefix}settings (variable, value)
VALUES ('knownThemes', '$known_themes')");

// Delete any info about this theme
upgrade_query("
DELETE FROM {$db_prefix}themes
WHERE id_theme = $id_theme");
}
}
---}
---#



  Barring other issues the script will run from beginning to completion.   8)  Hope this helps someone.   :D

Illori

That is a database query not ftp action. Removing from ftp has no effect on getting that query run.

lc62003

Quote from: Illori on November 26, 2014, 09:53:13 AM
That is a database query not ftp action. Removing from ftp has no effect on getting that query run.

Corrected.  Thanks! 

Kindred

ummm....  the first bit of that CHECKS for the core...
if (file_exists($GLOBALS['boarddir'] . '/Themes/core'))
if the core theme is there, it needs to be removed.
if the core theme is not there, this code should be ignored, because of the if statement...


what was the issue in your case? Why did you need to remove the check?

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

The reason is that this is buggy.

It's using db_fetch_array which doesn't exist. It should be db_fetch_row in this case.

Filed on GitHub.

Kindred

ahy. good catch form the coder's eye.

Wonder why it never failed on our tests?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Oldiesmann

Fixed on github now. I'm not sure why none of us ran into this issue either.
Michael Eshom
Christian Metal Fans

lc62003

Quote from: Arantor on November 26, 2014, 11:02:54 AM
The reason is that this is buggy.

It's using db_fetch_array which doesn't exist. It should be db_fetch_row in this case.

Filed on GitHub.

I'm no coder so I would never have gotten that.  Confirmed this works.   :)

Paracelsus

Just to say that I've also stumbled on this error, went to upgrade_2-1_mysql.sql, edited db_fetch_array to db_fetch_row on the suggested code a few posts above and the rest worked nicely to the end.

Advertisement: