XF 2.0 XF\Db\Exception: MySQL statement prepare error [1932]: Table 'edawgcom_website.xf_template_phrase' doesn't exist in engine in src/XF/Db/AbstractStatem

DoogiePC

Member
I try to rebuild an addon or even just installing an addon and I get this error:

190546

It also seems to happen for other things like creating a node
 
If this table is missing, your database is corrupted.

While there are expert ways to fix this, usually the best advice is to reload the last backup.
 
Honestly, your best choice may be to restore the site to the 1x backup, or hire someone to possibly fix the site up from a backup. Maybe a XF developer might have better news for you.
 
On phpmyadmin I find the xf_template_phrase and it's there, but when I click on it, it says "#1932 - Table 'edawgcom_website.xf_template_phrase' doesn't exist in engine"
 
I have re-installed the backup many times and I always end up with the error:
XF\Db\Exception: MySQL statement prepare error [1932]: Table 'edawgcom_xen.xf_template_phrase' doesn't exist in engine in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() insrc/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() insrc/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.phpat line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.phpat line 79
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 217
  6. XF\Db\AbstractAdapter->delete() insrc/XF/Service/Template/Compile.php at line 84
  7. XF\Service\Template\Compile->updatePhrasesUsed() insrc/XF/Entity/Template.php at line 427
  8. XF\Entity\Template->_postSave() in src/XF/Mvc/Entity/Entity.php at line1165
  9. XF\Mvc\Entity\Entity->save() in src/XF/AddOn/DataType/Template.phpat line 96
  10. XF\AddOn\DataType\Template->importAddOnData() insrc/XF/Job/AddOnData.php at line 108
  11. XF\Job\AddOnData->run() in src/XF/Job/Manager.php at line 241
  12. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line187
  13. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 103
  14. XF\Job\Manager->runByIds() in src/XF/Admin/Controller/Tools.php at line 120
  15. XF\Admin\Controller\Tools->actionRunJob() insrc/XF/Mvc/Dispatcher.php at line 249
  16. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line88
  17. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line41
  18. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1934
  19. XF\App->run() in src/XF.php at line 333
  20. XF::runApp() in admin.php at line 13
 
Did you find out anything more about this, @DoogiePC ? I am seeing this happen on a new server when doing a test install and upgrade to XF 2.0. Interestingly, I did the except same upgrade on a test install on our old server and a local docker setup and this never happened with either of those. I'm guessing it's a config issue on the new server (CentOS 7.6, MariaDB, Apache) vs the other two (old server: CentOS 6, MySQL 5.6.x, Apache, and local: Debian, MySQL 5.7.x, Apache).
 
This error message is related to database corruption (generally from a damaged MySQL install), recovery can be "fun" there are posts on stackoverflow on what to-do.

But TL;DR is hope you have backups.
 
This isn't our live install, fortunately. We purchased a new server so I'm doing test imports on the new server with the same .sql export I used on our current staging server and locally on my own machine. I figure something must be getting borked during the import or because of the new server config, I'm just not sure what it is.
 
Did you install Enhanced Search or Media Gallery by any chance ? I have only those addons installed and have tried uninstalling XFMG and now getting this error as well.
 
Media Gallery, yes. I did a fresh install again using the same DB export and so far haven't got this to happen. The only add-on I didn't install this time around was "[Widget] Popular threads and posts 1.1.2". Steps from this most recent test:

  1. Create new db
  2. Import db export via shell
  3. Upgrade to XF2 via CLI
  4. Install/Upgrade all add-ons via CLI (sans the one mentioned above)
  5. Import custom style
  6. Make edit to a template and save to test
 
MySQL version5.5.5 (10.2.20-MariaDB), which is interesting since I thought MariaDB was based on the newest version of MySQL. During my furious Google searching of the last day or so I read there was a bug in pre 5.6 versions of MySQL that could cause that issue with a table being stuck in use.

Also, the fresh install I did that was working fine last night is now giving the same error again when trying to save a template. Pretty sure since it's xmas that no one other than myself has been making changes.

Code:
XF\Db\Exception: MySQL statement prepare error [1932]: Table 'dev_xf.xf_template_phrase' doesn't exist in engine in src/XF/Db/AbstractStatement.php at line 212
 
In my case I made some MySQL/MariaDB config changes to /etc/my.cnf, nuked the db, imported our XF1.x import and upgraded again - no more error like before. This is just a guess, but I think our innodb_buffer_pool_size was too small for the size of the table. It's that or it was a timeout issue, since I upped some of those as well.
 
Back
Top Bottom