XF 2.0 Get this error during update from 1.5 to XF Beta 3

bosss

Member
Code:
XF\Db\Exception: MySQL statement prepare error [1146]: Table 'mysite_xenforo.xf_thread_field' doesn't exist in src/XF/Db/AbstractStatement.php at line 183

    XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 34
    XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 44
    XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 67
    XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1139
    XF\Mvc\Entity\Finder->fetch() in src/XF/Repository/AbstractField.php at line 109
    XF\Repository\AbstractField->getFieldCacheData() in src/XF/Repository/AbstractField.php at line 138
    XF\Repository\AbstractField->rebuildFieldCache() in src/XF/Job/CoreCacheRebuild.php at line 31
    XF\Job\CoreCacheRebuild->run() in src/XF/Job/Atomic.php at line 38
    XF\Job\Atomic->run() in src/XF/Job/Manager.php at line 241
    XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 187
    XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 138
    XF\Job\Manager->runUnique() in src/XF/Install/Controller/AbstractController.php at line 25
    XF\Install\Controller\AbstractController->manualJobRunner() in src/XF/Install/Controller/Upgrade.php at line 225
    XF\Install\Controller\Upgrade->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 249
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 89
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1787
    XF\App->run() in src/XF.php at line 326
    XF::runApp() in install/index.php at line 14

Some help?

regards

Bosss
 
I'm pretty confused how a whole table can be missing without another error being triggered before this point. If there was an error creating this table, then you should have had an error before this. Equally, if that whole step hadn't run for some reason, you likely would've had a different error too.

Can you try reverting to a backup and trying the upgrade again?
 
Run this query:
SQL:
CREATE TABLE `xf_thread_field` (
  `field_id` varbinary(25) NOT NULL,
  `display_group` varbinary(25) NOT NULL DEFAULT 'before',
  `display_order` int(10) unsigned NOT NULL DEFAULT 1,
  `field_type` varbinary(25) NOT NULL DEFAULT 'textbox',
  `field_choices` blob NOT NULL,
  `match_type` varbinary(25) NOT NULL DEFAULT 'none',
  `match_params` blob NOT NULL,
  `max_length` int(10) unsigned NOT NULL DEFAULT 0,
  `required` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `user_editable` enum('yes','once','never') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'yes',
  `display_template` text COLLATE utf8mb4_general_ci NOT NULL,
  `moderator_editable` tinyint(3) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`field_id`),
  KEY `display_group_order` (`display_group`,`display_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
 
Now get this error

Code:
XF\Db\Exception: MySQL statement prepare error [1146]: Table 'newlibar_xenforo.xf_widget' doesn't exist in src/XF/Db/AbstractStatement.php at line 183

    XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 34
    XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 44
    XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 67
    XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1139
    XF\Mvc\Entity\Finder->fetch() in src/XF/Repository/Widget.php at line 102
    XF\Repository\Widget->getWidgetCache() in src/XF/Repository/Widget.php at line 149
    XF\Repository\Widget->rebuildWidgetCache() in src/XF/Job/CoreCacheRebuild.php at line 37
    XF\Job\CoreCacheRebuild->run() in src/XF/Job/Atomic.php at line 38
    XF\Job\Atomic->run() in src/XF/Job/Manager.php at line 241
    XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 187
    XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 138
    XF\Job\Manager->runUnique() in src/XF/Install/Controller/AbstractController.php at line 25
    XF\Install\Controller\AbstractController->manualJobRunner() in src/XF/Install/Controller/Upgrade.php at line 225
    XF\Install\Controller\Upgrade->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 249
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 89
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1787
    XF\App->run() in src/XF.php at line 326
    XF::runApp() in install/index.php at line 14
 
SQL:
CREATE TABLE `xf_widget` (
  `widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `widget_key` varbinary(50) NOT NULL,
  `definition_id` varbinary(25) NOT NULL,
  `positions` blob NOT NULL,
  `options` blob NOT NULL,
  PRIMARY KEY (`widget_id`),
  UNIQUE KEY `widget_key` (`widget_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
 
Now this error

Code:
XF\Db\Exception: MySQL query error [1146]: Table 'newlibar_xenforo.xf_thread_field_value' doesn't exist in src/XF/Db/AbstractStatement.php at line 183

    XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 66
    XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 67
    XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 94
    XF\Db\AbstractAdapter->fetchAllKeyed() in src/XF/Install/Upgrader.php at line 281
    XF\Install\Upgrader->runSchemaCompare() in src/XF/Install/Upgrader.php at line 248
    XF\Install\Upgrader->getDefaultSchemaErrors() in src/XF/Install/Controller/Upgrade.php at line 255
    XF\Install\Controller\Upgrade->actionComplete() in src/XF/Mvc/Dispatcher.php at line 249
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 89
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1787
    XF\App->run() in src/XF.php at line 326
    XF::runApp() in install/index.php at line 14
 
SQL:
CREATE TABLE `xf_thread_field_value` (
  `thread_id` int(10) unsigned NOT NULL,
  `field_id` varbinary(25) NOT NULL,
  `field_value` mediumtext NOT NULL,
  PRIMARY KEY (`thread_id`,`field_id`),
  KEY `field_id` (`field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
Let's see if there's any more errors after this. There may be a cut off point where we just have to say it's not worth continuing, though I am sort of intrigued to see if there's a pattern.

BTW, while you're running this query, can you also run the following and let us know the result:
SQL:
SELECT *
FROM xf_addon
 
I run both queries and get now this error

Code:
XF\Db\Exception: MySQL query error [1146]: Table 'newlibar_xenforo.xf_forum_field' doesn't exist in src/XF/Db/AbstractStatement.php at line 183

    XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 66
    XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 67
    XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 94
    XF\Db\AbstractAdapter->fetchAllKeyed() in src/XF/Install/Upgrader.php at line 281
    XF\Install\Upgrader->runSchemaCompare() in src/XF/Install/Upgrader.php at line 248
    XF\Install\Upgrader->getDefaultSchemaErrors() in src/XF/Install/Controller/Upgrade.php at line 255
    XF\Install\Controller\Upgrade->actionComplete() in src/XF/Mvc/Dispatcher.php at line 249
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 89
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1787
    XF\App->run() in src/XF.php at line 326
    XF::runApp() in install/index.php at line 14
 
I get this after

Code:
SQL:

SHOW TABLES LIKE 'xf\_%'

Code:
Tables_in_newlibar_xenforo (xf\_%)    
xf_addon
xf_admin
xf_admin_log
xf_admin_navigation
xf_admin_permission
xf_admin_permission_entry
xf_advertising
xf_advertising_position
xf_approval_queue
xf_arcade_category
xf_arcade_game
xf_arcade_game_play
xf_arcade_session
xf_arcade_vote
xf_attachment
xf_attachment_data
xf_attachment_view
xf_ban_email
xf_bb_code
xf_bb_code_media_site
xf_bdbank_archive
xf_bdbank_attachment_downloaded
xf_bdbank_stats
xf_bdbank_transaction
xf_*******_addon
xf_*******_listener_class
xf_*******_modern_cache
xf_*******_modern_statistic
xf_*******_wnu_activity
xf_*******_wnu_queue_activity
xf_captcha_log
xf_captcha_question
xf_category
xf_change_log
xf_class_extension
xf_code_event
xf_code_event_listener
xf_connected_account_provider
xf_content_spam_cache
xf_content_type_field
xf_conversation_master
xf_conversation_message
xf_conversation_recipient
xf_conversation_user
xf_cron_entry
xf_css_cache
xf_data_registry
xf_deletion_log
xf_draft
xf_edit_history
xf_email_bounce_log
xf_email_bounce_soft
xf_error_log
xf_feed
xf_feed_log
xf_file_check
xf_find_new
xf_find_new_default
xf_flood_check
xf_forum
xf_forum_prefix
xf_forum_prompt
xf_forum_read
xf_forum_watch
xf_help_page
xf_image_proxy
xf_image_proxy_referrer
xf_import_log
xf_ip
xf_ip_match
xf_job
xf_language
xf_liked_content
xf_link_forum
xf_link_proxy
xf_link_proxy_referrer
xf_login_attempt
xf_mail_queue
xf_member_stat
xf_moderator
xf_moderator_content
xf_moderator_log
xf_navigation
xf_navigation_type
xf_news_feed
xf_node
xf_node_type
xf_notice
xf_notice_dismissed
xf_oembed
xf_oembed_referrer
xf_option
xf_option_group
xf_option_group_relation
xf_page
xf_payment_profile
xf_payment_provider
xf_payment_provider_log
xf_pe_admin_center_links
xf_permission
Tables_in_newlibar_xenforo (xf\_%)    
xf_permission_cache_content
xf_permission_combination
xf_permission_combination_user_group
xf_permission_entry
xf_permission_entry_content
xf_permission_interface_group
xf_phrase
xf_phrase_compiled
xf_phrase_map
xf_poll
xf_poll_response
xf_poll_vote
xf_post
xf_profile_post
xf_profile_post_comment
xf_purchasable
xf_purchase_request
xf_registration_spam_cache
xf_report
xf_report_comment
xf_route
xf_route_filter
xf_search
xf_search_index
xf_session
xf_session_activity
xf_session_admin
xf_session_install
xf_sitemap
xf_smilie
xf_smilie_category
xf_spam_cleaner_log
xf_spam_trigger_log
xf_stats_daily
xf_style
xf_style_property
xf_style_property_group
xf_style_property_map
xf_tag
xf_tag_content
xf_tag_result_cache
xf_template
xf_template_history
xf_template_map
xf_template_modification
xf_template_modification_log
xf_template_phrase
xf_tfa_attempt
xf_tfa_provider
xf_thread
xf_thread_field
xf_thread_field_value
xf_thread_prefix
xf_thread_prefix_group
xf_thread_prompt
xf_thread_prompt_group
xf_thread_read
xf_thread_redirect
xf_thread_reply_ban
xf_thread_user_post
xf_thread_view
xf_thread_watch
xf_trophy
xf_upgrade_job
xf_upgrade_log
xf_user
xf_user_alert
xf_user_alert_optout
xf_user_authenticate
xf_user_ban
xf_user_change_temp
xf_user_confirmation
xf_user_connected_account
xf_user_field
xf_user_field_value
xf_user_follow
xf_user_group
xf_user_group_change
xf_user_group_promotion
xf_user_group_promotion_log
xf_user_group_relation
xf_user_ignored
xf_user_option
xf_user_privacy
xf_user_profile
xf_user_reject
xf_user_remember
xf_user_tfa
xf_user_tfa_trusted
xf_user_title_ladder
xf_user_trophy
xf_user_upgrade
xf_user_upgrade_active
xf_user_upgrade_expired
xf_warning
xf_warning_action
xf_warning_action_trigger
xf_warning_definition
xf_widget
xf_widget_definition
Tables_in_newlibar_xenforo (xf\_%)    
xf_widget_position
 
This is still really a mystery as to how this ever happened, but as far as I can tell, you might only need this last table:
SQL:
CREATE TABLE `xf_forum_field` (
  `node_id` int(10) unsigned NOT NULL,
  `field_id` varbinary(25) NOT NULL,
  PRIMARY KEY (`node_id`,`field_id`),
  KEY `field_id` (`field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
 
Top Bottom