XF 2.2 Users can't register - server errors

Alan_SP

Well-known member
First, to explain situation. Our host have moved us to new server. And after that move, we had some errors (I created thread here: https://xenforo.com/community/threads/errors-after-transfer-to-a-new-server.218389/).

Then they have retried to transfer forum database, which solved some errors, and I thought that everything is solved. But now I have noticed server errors, and I also noticed that there's no new user registrations, and I tried to register (yes, I know, I should have tried test registration myself right away).

Is there a way we can repair it? These are errors in server log (I hide registration email):

Code:
XF\Db\Exception: MySQL query error [1048]: Column 'user_id' cannot be null src/XF/Db/AbstractStatement.php:230
Generated by: Unknown account Saturday - 30.12.2023 at 21:00:08
Stack trace
INSERT  INTO `xf_user` (`visible`, `activity_visible`, `user_group_id`, `timezone`, `language_id`, `last_summary_email_date`, `username`, `email`, `user_state`, `privacy_policy_accepted`, `terms_accepted`, `display_style_group_id`, `secondary_group_ids`, `secret_key`, `user_id`, `username_date`, `username_date_visible`, `style_id`, `permission_combination_id`, `message_count`, `question_solution_count`, `alerts_unviewed`, `alerts_unread`, `conversations_unread`, `register_date`, `last_activity`, `trophy_points`, `avatar_date`, `avatar_width`, `avatar_height`, `avatar_highdpi`, `gravatar`, `security_lock`, `is_moderator`, `is_admin`, `is_staff`, `is_banned`, `reaction_score`, `vote_score`, `custom_title`, `warning_points`, `andrew_user_note_count`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1048, '23000')
#1 src/XF/Db/Mysqli/Statement.php(79): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1048, '23000')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(220): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1514): XF\Db\AbstractAdapter->insert('xf_user', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1246): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Service/User/Registration.php(301): XF\Mvc\Entity\Entity->save()
#7 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\User\Registration->_save()
#8 src/XF/Pub/Controller/Register.php(426): XF\Service\User\Registration->save()
#9 src/addons/XenSoluce/AvatarGallery/XF/Pub/Controller/Register.php(79): XF\Pub\Controller\Register->actionRegister()
#10 src/XF/Mvc/Dispatcher.php(352): XenSoluce\AvatarGallery\XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', Object(XF\Mvc\RouteMatch), Object(XenSoluce\AvatarGallery\XF\Pub\Controller\Register), NULL)
#12 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XenSoluce\AvatarGallery\XF\Pub\Controller\Register), NULL)
#13 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
#15 src/XF.php(524): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
  ["url"] => string(34) "/forum/index.php?register/register"
  ["referrer"] => string(42) "https://exiledkingdoms.com/forum/index.php"
  ["_GET"] => array(1) {
    ["register/register"] => string(0) ""
  }
  ["_POST"] => array(16) {
    ["_xfToken"] => string(8) "********"
    ["username"] => string(0) ""
    ["c9a50bcf1afe57596e23d27d56db4e726d81b422"] => string(7) "testreg"
    ["b5ffb9d2d3c393177fa05a0e3d2c8fd98665d976"] => string(0) ""
    ["6669f1e58d40a8129ddb46fbe0271f973a9fe453"] => string(25) "xxxxxxxx"
    ["354c6fd0bb8536d069fff5ea037e2bec4037e766"] => string(8) "********"
    ["gallery_avatar"] => string(41) "gallery_avatars/1 exiled kingdoms/m63.png"
    ["custom_fields"] => array(2) {
      ["cw_user_date"] => string(0) ""
      ["cw_user_time"] => string(0) ""
    }
    ["g-recaptcha-response"] => string(1630) "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.hKdwYXNza2V5xQRgI7Z3-d3POssKJwyZTsAF4b3WvsU3HC9cvam1oQ4AhbpZ9kBjy4oFuAsdOFgLFz6wTgygLR8IoONxFNxpZH4KDjITm0MyCBfWwEXguwGlc4u8BDeFjfbG-2gkaKqwVHN3pyL1SLfp7mMMoozXhwNrmo_RMvB74Qzu-R7Jap2yDBGH8MVPJ-attw8QP0zUwxxcZWdnm25ShN9MOkFl7z8CCUp_f3A77nH6vDM0KB8s5H832txu4nq7ltrSEntYBLxGWc2Hwqx93u6DGocmX7iJ5kkXNw83l18Zo-N0IecRSfQqKx1HZZr7MgqtbWdOE-pbF3owh6caFflqw0P8qjd9O-RIHIXkQ8gcGJZXOO6verdSzpCunm5HFWLOKUmPjyOVCXPzFBUQ6Xa9AZuRSym_Rz98ZHVTiVl7GGKMqKs8LCI28qxJabXb9a8dhB337HgFk9rCSpbS55YLvjKdAjHLQ9Gj-SGTDB8c8dKc6yuChL8-XQ69V7wSuH8aIEVj_hYMWp5QPNGS13I_--WNXDG5fiwDjBeZnTIHTxBqQFKiKkPbGnotsEpl701w9_YZZW00CINvNlyHpcI5foso-au-jfFIhXynRP4og0_5zTvWtYuOHClY1e6jwUbLPhAOdENCcRDGU3PNysb9EpRIqQGK2JyQCvXFMVjuI_qJT6qZluS9r2tLcCrKfInjPTjtj8BJtmCQFtBtYFUjc5K5GaowV95sHo-aFKxZQzXDMs9fZCMc8IEcHNMojm5NirE1HWqAJYbRy3aMhJg74L0ueUgnQ1eH7ecLEmjQ7VBCZMw8Fon8iEFtcv-Vjd4LWMoriUdfWSoepnGw8GDQTnZvCIZ6rXdGSTbdg3SK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zWZd4W9E3ps0RQ2S_9rSxFR56THJFh0pQSndQIMyOsRajmgk5kL8FKFDVtPvpiL2nyyMMVrrUiZIy3nfioxPxxXB_DhLqH4DPHqhMDsf7SWLZewhddFCvS9HLviU3ZNjgfU1qNleHDOZZB3M6hzaGFyZF9pZM4UPIQfonBkAA.OZasb0VMeU09cz0SkETqQoqS-_lfPi2N814rByWymcE"
    ["accept"] => string(1) "1"
    ["reg_key"] => string(16) "gzrpIqeQjHtKyEi3"
    ["f69aa6a4c68d45b4a42aa43fbfc13183184b72b1"] => string(16) "Europe/Amsterdam"
    ["_xfRequestUri"] => string(16) "/forum/index.php"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Hi, I have disabled Avatar gallery, it's this error now (basically the same issue):

Code:
XF\Db\Exception: MySQL query error [1048]: Column 'user_id' cannot be null src/XF/Db/AbstractStatement.php:230
Generated by: Unknown account Saturday - 30.12.2023 at 21:44:39
Stack trace
INSERT  INTO `xf_user` (`visible`, `activity_visible`, `user_group_id`, `timezone`, `language_id`, `last_summary_email_date`, `username`, `email`, `user_state`, `privacy_policy_accepted`, `terms_accepted`, `display_style_group_id`, `secondary_group_ids`, `secret_key`, `user_id`, `username_date`, `username_date_visible`, `style_id`, `permission_combination_id`, `message_count`, `question_solution_count`, `alerts_unviewed`, `alerts_unread`, `conversations_unread`, `register_date`, `last_activity`, `trophy_points`, `avatar_date`, `avatar_width`, `avatar_height`, `avatar_highdpi`, `gravatar`, `security_lock`, `is_moderator`, `is_admin`, `is_staff`, `is_banned`, `reaction_score`, `vote_score`, `custom_title`, `warning_points`, `andrew_user_note_count`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL query err...', 1048, '23000')
#1 src/XF/Db/Mysqli/Statement.php(79): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1048, '23000')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(220): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1514): XF\Db\AbstractAdapter->insert('xf_user', Array, false)
#5 src/XF/Mvc/Entity/Entity.php(1246): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Service/User/Registration.php(301): XF\Mvc\Entity\Entity->save()
#7 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\User\Registration->_save()
#8 src/XF/Pub/Controller/Register.php(426): XF\Service\User\Registration->save()
#9 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Register), NULL)
#11 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\Register), NULL)
#12 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
#14 src/XF.php(524): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

I think that something is missing in DB, that doesn't allows registration. Other things work (posting, mentioning people), from what I can say. Not sure which field in DB is missing and how can it be restored, without losing data.
 
Is there maybe some way that database is rebuilt, if it's only database structure issue? Some command from install directory, or something similar?
 
I also tried to create user manually in ACP, this is the error:

Code:
XF\Db\Exception: MySQL query error [1048]: Column 'user_id' cannot be null in src/XF/Db/AbstractStatement.php at line 230
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 198
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 79
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 96
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 220
XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1514
XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1246
XF\Mvc\Entity\Entity->save() in src/XF/Mvc/FormAction.php at line 71
XF\Mvc\FormAction->XF\Mvc\{closure}() in src/XF/Mvc/FormAction.php at line 189
XF\Mvc\FormAction->run() in src/XF/Admin/Controller/User.php at line 559
XF\Admin\Controller\User->actionSave() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2352
XF\App->run() in src/XF.php at line 524
XF::runApp() in admin.php at line 13

And I have tried to rebuild user caches, which didn't helped.
 
Back
Top Bottom