• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 LogicException: xf_widget already exists, but the structure does not match. (During 1.5 -> 2.0 upgrade)

Static-Xbox

Active member
#1
Hey,

Trying to upgrade my test install to 2.0b1, but after clicking the upgrade button, I get the following error:

LogicException: xf_widget already exists, but the structure does not match. in src/XF/Db/Schema/Create.php at line 51

  1. XF\Db\Schema\Create->getQuery() in src/XF/Db/Schema/AbstractDdl.php at line 132
  2. XF\Db\Schema\AbstractDdl->apply() in src/XF/Db/SchemaManager.php at line 171
  3. XF\Db\SchemaManager->createTable() in src/XF/Install/Upgrade/2000010-200a.php at line 446
  4. XF\Install\Upgrade\Version2000010->step3() in src/XF/Install/Controller/Upgrade.php at line 152
  5. XF\Install\Controller\Upgrade->actionRun() in src/XF/Mvc/Dispatcher.php at line 232
  6. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 85
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1771
  9. XF\App->run() in src/XF.php at line 319
  10. XF::runApp() in install/index.php at line 14

Not entirely sure on the next step from here, any help would be greatly appreciated!

(1.5.12 -> 2.0b1)
 

Chris D

XenForo developer
Staff member
#2
Do you have an existing add on which adds widgets? Which add on and which version is it? I’m not certain it’s Wisgwt Framework as I think that names its tables correctly iirc.
 

Static-Xbox

Active member
#3
Do you have an existing add on which adds widgets? Which add on and which version is it? I’m not certain it’s Wisgwt Framework as I think that names its tables correctly iirc.
I do have XenPorta 2 installed, as well as [bd]Widget Framework, could it be XenPorta?
 

Chris D

XenForo developer
Staff member
#4
Are they both recent versions? Could be unless my memory is wrong about WF using sensible table names.
 

Case

Active member
#6
Upgrading via CLI and got the same error: xf_widget already exists, but the structure does not match.

I have previously installed [bd] Widget Framework (although it has been disabled for some time). Never used XenPorta.
 

Mike

XenForo developer
Staff member
#7
It appears that the widget framework causes a conflict with the upgrade. Looking at the tables here, the other table has a prefix, but xf_widget doesn't.
 

Static-Xbox

Active member
#9
Considering that Widget Framework isn't going to work after the upgrade, is there a workaround to remove or replace the table for an upgrade in progress? Would dropping the table and running the upgrade again potentially solve the issue?
 

Mike

XenForo developer
Staff member
#10
If you aren't going to use an add-on after upgrading, it's strongly recommended that you uninstall it before upgrading. Otherwise, you're very likely to leave orphaned data.
 

Mike

XenForo developer
Staff member
#12
No, they will be disabled automatically. That's independent from add-ons that conflict with the upgrade though -- those would need to be uninstalled (or a patched version of them will need to be released and installed before upgrading).
 

xfrocks

Well-known member
#13
Hey,

Trying to upgrade my test install to 2.0b1, but after clicking the upgrade button, I get the following error:

LogicException: xf_widget already exists, but the structure does not match. in src/XF/Db/Schema/Create.php at line 51

  1. XF\Db\Schema\Create->getQuery() in src/XF/Db/Schema/AbstractDdl.php at line 132
  2. XF\Db\Schema\AbstractDdl->apply() in src/XF/Db/SchemaManager.php at line 171
  3. XF\Db\SchemaManager->createTable() in src/XF/Install/Upgrade/2000010-200a.php at line 446
  4. XF\Install\Upgrade\Version2000010->step3() in src/XF/Install/Controller/Upgrade.php at line 152
  5. XF\Install\Controller\Upgrade->actionRun() in src/XF/Mvc/Dispatcher.php at line 232
  6. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 85
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1771
  9. XF\App->run() in src/XF.php at line 319
  10. XF::runApp() in install/index.php at line 14

Not entirely sure on the next step from here, any help would be greatly appreciated!

(1.5.12 -> 2.0b1)
Sorry for the legacy table name. It's best to uninstall the add-on before attempting to upgrade to XenForo 2.
 

Fred.

Well-known member
#14
I just ran into the same issue with widget framework.

Code:
Running upgrade to 2.0.0 Alpha, step 1... done.
Running upgrade to 2.0.0 Alpha, step 2... done.
Running upgrade to 2.0.0 Alpha, step 3...
                                                              
  [LogicException]                                             
  xf_widget already exists, but the structure does not match.
Let's start over again. :coffee:
 

xfrocks

Well-known member
#15
I just ran into the same issue with widget framework.

Code:
Running upgrade to 2.0.0 Alpha, step 1... done.
Running upgrade to 2.0.0 Alpha, step 2... done.
Running upgrade to 2.0.0 Alpha, step 3...
                                                              
  [LogicException]                                             
  xf_widget already exists, but the structure does not match.
Let's start over again. :coffee:
Actually you don't need to. Just do a rename and run cmd.php again.

Code:
RENAME TABLE xf_widget TO _xf1_xf_widget;
Or just drop it.
 

Fred.

Well-known member
#17
I also had to drop xf_upgrade_job because this error.

Code:
 [LogicException]                                                
  xf_upgrade_job already exists, but the structure does not match.
If you drop it it works.
Upgrade complete. :cool:
 
#18
In my case I decided to wipe, re-install everything on the test site, remove the Widget Framework and then run the upgrade. Everything went as smooth as silk.

Thanks so much for the help :)