MG 2.1 Error with XFMG Update 2.4.1

AnjaC

Active member
Hi there,

it would be fantastic to get help.

The update to the latest version of XFMG stopped with this error:

  • XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'like_users' in 'where clause'
  • src/XF/Db/AbstractStatement.php:217
  • Generiert von: klaus harms
  • 27 September 2019 um 18:22
Stack-Trace
UPDATE xf_mg_album SET like_users = ? WHERE like_users = ?
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(326): XF\Db\AbstractAdapter->query('UPDATE `xf_mg_...', Array)
#5 src/XF/Install/InstallHelperTrait.php(85): XF\Db\AbstractAdapter->update('xf_mg_album', Array, 'like_users = ?', Array)
#6 src/XF/Install/InstallHelperTrait.php(43): XF\AddOn\AbstractSetup->tableColumnsToJson('xf_mg_album', Array, Array, 0, Array, false, '^([abCdioOsS]:|...', 1000)
#7 src/addons/XFMG/Setup.php(2410): XF\AddOn\AbstractSetup->entityColumnsToJson('XFMG:Album', Array, 0, Array)
#8 src/XF/AddOn/StepRunnerUpgradeTrait.php(122): XFMG\Setup->upgrade902010010Step1(Array)
#9 src/XF/AddOn/StepRunnerUpgradeTrait.php(71): XFMG\Setup->upgradeStepRunner(902010010, 1, Array, NULL)
#10 src/XF/Admin/Controller/AddOn.php(576): XFMG\Setup->upgrade(Array)
#11 src/XF/Mvc/Dispatcher.php(321): XF\Admin\Controller\AddOn->actionUpgrade(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Upgrade', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
#13 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
#14 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#15 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#16 src/XF.php(390): XF\App->run()
#17 admin.php(13): XF::runApp('XF\\Admin\\App')
#18 {main}
Status der Anfrage
array(4) {
["url"] => string(37) "/forum/admin.php?add-ons/XFMG/upgrade"
["referrer"] => string(62) "https:***/admin.php?add-ons/XFMG/upgrade"
["_GET"] => array(1) {
["add-ons/XFMG/upgrade"] => string(0) ""
}
["_POST"] => array(7) {
["_xfProcessing"] => string(1) "1"
["continue"] => string(1) "1"
["confirm"] => string(1) "1"
["params"] => string(2) "[]"
["count"] => string(1) "1"
["finished"] => string(1) "0"
["_xfToken"] => string(8) "****"
}
}

Any idea how to fix this?

Greetings

Klaus
 
Last edited:
Thanks for your help!

We tried to update from the version before 2.1.3 to 2.1.4

Here is the table content:

xf_mg_album Create Table: CREATE TABLE xf_mg_album ( album_id int(10) unsigned NOT NULL AUTO_INCREMENT, category_id int(10) unsigned NOT NULL DEFAULT '0', album_hash varchar(32) DEFAULT NULL, title text NOT NULL, description text NOT NULL, create_date int(10) unsigned NOT NULL DEFAULT '0', last_update_date int(10) unsigned NOT NULL DEFAULT '0', view_privacy enum('public','members','private','shared','inherit') DEFAULT 'private', view_users mediumblob, add_privacy enum('public','members','private','shared','inherit') DEFAULT 'private', add_users mediumblob, album_state enum('visible','moderated','deleted') NOT NULL DEFAULT 'visible', user_id int(10) unsigned NOT NULL DEFAULT '0', username varchar(50) NOT NULL DEFAULT '', ip_id int(10) unsigned NOT NULL DEFAULT '0', reaction_score int(11) NOT NULL DEFAULT '0', reactions blob, reaction_users blob, media_count int(10) unsigned NOT NULL DEFAULT '0', view_count int(10) unsigned NOT NULL DEFAULT '0', rating_count int(10) unsigned NOT NULL DEFAULT '0', rating_sum int(10) unsigned NOT NULL DEFAULT '0', rating_avg float unsigned NOT NULL DEFAULT '0', rating_weighted float unsigned NOT NULL DEFAULT '0', comment_count int(10) unsigned NOT NULL DEFAULT '0', last_comment_date int(10) unsigned NOT NULL DEFAULT '0', last_comment_id int(10) unsigned NOT NULL DEFAULT '0', last_comment_user_id int(10) unsigned NOT NULL DEFAULT '0', last_comment_username varchar(50) NOT NULL DEFAULT '', warning_id int(11) NOT NULL DEFAULT '0', warning_message varchar(255) NOT NULL DEFAULT '', default_order enum('','custom') NOT NULL DEFAULT '', thumbnail_date int(10) unsigned NOT NULL DEFAULT '0', custom_thumbnail_date int(10) unsigned NOT NULL DEFAULT '0', media_item_cache mediumblob, PRIMARY KEY (album_id), KEY album_create_date (create_date), KEY album_user_id_album_create_date (user_id,create_date) ) ENGINE=InnoDB AUTO_INCREMENT=568 DEFAULT CHARSET=utf8
 
Field name Type Allow nulls? Key Default value Extras
album_idint(10) unsignedNoPrimaryNULLauto_increment
category_idint(10) unsignedNoNone0
album_hashvarchar(32)YesNoneNULL
titletextNoNoneNULL
descriptiontextNoNoneNULL
create_dateint(10) unsignedNoIndexed0
last_update_dateint(10) unsignedNoNone0
view_privacyenum('public','members','private','shared','inherit')YesNoneprivate
view_usersmediumblobYesNoneNULL
add_privacyenum('public','members','private','shared','inherit')YesNoneprivate
add_usersmediumblobYesNoneNULL
album_stateenum('visible','moderated','deleted')NoNonevisible
user_idint(10) unsignedNoIndexed0
usernamevarchar(50)NoNone
ip_idint(10) unsignedNoNone0
reaction_scoreint(11)NoNone0
reactionsblobYesNoneNULL
reaction_usersblobYesNoneNULL
media_countint(10) unsignedNoNone0
view_countint(10) unsignedNoNone0
rating_countint(10) unsignedNoNone0
rating_sumint(10) unsignedNoNone0
rating_avgfloat unsignedNoNone0
rating_weightedfloat unsignedNoNone0
comment_countint(10) unsignedNoNone0
last_comment_dateint(10) unsignedNoNone0
last_comment_idint(10) unsignedNoNone0
last_comment_user_idint(10) unsignedNoNone0
last_comment_usernamevarchar(50)NoNone
warning_idint(11)NoNone0
warning_messagevarchar(255)NoNone
default_orderenum('','custom')NoNone
thumbnail_dateint(10) unsignedNoNone0
custom_thumbnail_dateint(10) unsignedNoNone0
 
When we tried to update via the package file we got this:

  • ErrorException: Failed to write files for XFMG action, including src/addons/XFMG/hashes.json
  • src/XF/Error.php:75
  • Generiert von: klaus harms
  • 27 September 2019 um 20:22
Stack-Trace
#0 src/XF.php(187): XF\Error->logError('Failed to write...', false)
#1 src/XF/Job/AddOnInstallBatch.php(157): XF::logError('Failed to write...')
#2 src/XF/Job/AddOnInstallBatch.php(78): XF\Job\AddOnInstallBatch->stepInit(Object(XF\Timer))
#3 src/XF/Job/Manager.php(253): XF\Job\AddOnInstallBatch->run(G)
#4 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#5 src/XF/Job/Manager.php(111): XF\Job\Manager->runJobEntry(Array, G)
#6 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#7 src/XF/Mvc/Dispatcher.php(321): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#9 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#10 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#12 src/XF.php(390): XF\App->run()
#13 admin.php(13): XF::runApp('XF\\Admin\\App')
#14 {main}
Status der Anfrage
array(4) {
["url"] => string(30) "/forum/admin.php?tools/run-job"
["referrer"] => string(169) "https://www.nikon-club.de/forum/adm...-ons/install-from-archive-complete&batch_id=2"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(90) "https://www.nikon-club.de/forum/admin.php?add-ons/install-from-archive-complete&batch_id=2"
["_xfToken"] => string(8) "****"
["only_ids"] => string(2) "86"
}
}

Löschen
 
When trying to save a new thread this error happens:


XF\Db\Exception: MySQL query error [1364]: Field 'like_users' doesn't have a default value in src/XF/Db/AbstractStatement.php at line 217
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 77
  3. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  4. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 221
  5. XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1452
  6. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1184
  7. XF\Mvc\Entity\Entity->save() in src/XF/Mvc/Entity/Entity.php at line 1202
  8. XF\Mvc\Entity\Entity->save() in src/XF/Service/Thread/Creator.php at line 285
  9. XF\Service\Thread\Creator->_save() in src/XF/Service/ValidateAndSavableTrait.php at line 40
  10. XF\Service\Thread\Creator->save() in src/XF/Pub/Controller/Forum.php at line 750
  11. XF\Pub\Controller\Forum->actionPostThread() in src/XF/Mvc/Dispatcher.php at line 321
  12. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
  13. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  14. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  15. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2178
  16. XF\App->run() in src/XF.php at line 390
  17. XF::runApp() in index.php at line 20
 
Something has gone very wrong with your database if it's missing columns, etc.

At this point I would probably recommend restoring from a backup.

Then you can look at verifying the table structure and rectifying any issues before attempting to upgrade again.
 
Back
Top Bottom