Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: N!c0 on November 24, 2017, 07:05:14 AM

Title: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: N!c0 on November 24, 2017, 07:05:14 AM
Hello,

I have the same problem (https://www.simplemachines.org/community/index.php?topic=557246.0)

Content of the file Sources/Subs-Admin.php line 79 and 80:
$ versions ['db_engine'] = array ('title' => sprintf ($ txt ['database_server'], $ smcFunc ['db_title']), 'version' => '');
$ versions ['db_engine'] ['version'] = $ smcFunc ['db_get_engine'] ();

Packages installed:
- Add security verification to the Login page (version 1.1)
- DisableTemplateEval (version 1.2)
- notCaptcha (version 1.06)
- Stop Spammer (version 2.3.9)
- cb|Emailogin (version 0.6)


I executed upgrade.php

The error message remains the same, but the "note" has disappeared
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: Sir Osis of Liver on November 24, 2017, 11:44:45 AM
Why did you run upgrade.php?  You can upgrade from 2.0.14 to .15 in package manager.
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: N!c0 on November 24, 2017, 12:17:55 PM
I have upgrade with PackerManager.

After, I have this error :

Unknown system variable 'version_comment'
File: ..../Sources/Subs-Admin.php
Line: 80

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.15, while your database is at version 2.0. The above error might possibly go away if you execute the latest version of upgrade.php.


After upgrade.php

Error :
Unknown system variable 'version_comment'
File: .../Sources/Subs-Admin.php
Line: 80

Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: drewactual on November 24, 2017, 12:50:51 PM
it may be a red herring... it's been a long while, but i've seen something like this before and it was a simple manual change of the line that denotes the DB version...

i suspect that the change of that line during update didn't happen because the line wasn't where the manager expected it- due to another change to the file by a mod (some do this for certain)..

if you ran the upgrade.php you may want to make sure you absolutely ran the RIGHT upgrade.php, which is one reason to avoid running it independently... and go look and see what version it printed (or failed to print due to location of that line). 
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: shawnb61 on November 24, 2017, 01:33:46 PM
What version of MySQL are you running?

You can view this under Admin | Support & credits. 

Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: shawnb61 on November 24, 2017, 01:52:40 PM
There are old reports of this being a mysql bug, e.g.:
https://bugs.mysql.com/bug.php?id=15684

The SMF code that is being invoked is in DBExtra-mysql.php:
/**
* Figures out if we are using MySQL, Percona or MariaDB
*
* @return string The database engine we are using
*/
function smf_db_get_engine()
{
global $smcFunc;
static $db_type;

if (!empty($db_type))
return $db_type;

$request = $smcFunc['db_query']('', 'SELECT @@version_comment');
list ($comment) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

// Skip these if we don't have a comment.
if (!empty($comment))
{
if (stripos($comment, 'percona') !== false)
return 'Percona';
if (stripos($comment, 'mariadb') !== false)
return 'MariaDB';
}
else
return 'fail';

return 'MySQL';
}


So I suspect that the proper fix is to patch/upgrade mysql. 

If that is impractical at this time, I'm sure we can come up with a temporary workaround.

In the meanwhile, to confirm, please provide your MySQL version. 
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: shawnb61 on November 24, 2017, 02:23:20 PM
Note there may be no rush - ONLY THE FIRST TWO admin functions make this call - things like administration center, support & credits. 

Package manager and News/Newsletters will work, and I believe everything else under Configuration, Forum, Members & Maintenance. 

Give it a shot.  This may not be very limiting at all... 

(note - this info is also copied on the 'sister' thread where another user is having the same issue:
https://www.simplemachines.org/community/index.php?topic=557246.msg3949111#new
)
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: N!c0 on November 27, 2017, 02:23:39 AM
Hello,

MySQL version : 5.5.31
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: crazyASD on November 29, 2017, 05:06:05 AM
Same error, my version mysqli: 5.7.11-log
Title: Re: 2.0.14 to 2.0.15 upgrade, database different version error
Post by: Aleksi "Lex" Kilpinen on December 22, 2017, 12:13:43 AM
Hi N!c0 is this still an issue, or have you been able to work this out?