[FIXED] Error while upgrading to XF2 version

janslu

Member
Hi,
I am running tests for xf2 migration from xf1. All software versions are recent - both for XenForo and your extension. I ran the cli import and it got stuck on the last step, post import. Please see the screenshot:

Screenshot 2018-09-23 at 21.14.12.png

Any idea which query this might be? Before Groups import I have migrated to utf8mb4 BUT I needed to change collation of 'xf_user'.'username' field to utf8mb4_polish_ci because I have some old users from vbulletin times using accented characters specific to polish language. That means that it is possible that some usernames cannot be inserted into utf8mb4_general_ci which are default for all XenForo tables (for example in xf_post table)... I need to create a test scenario for dealing with this issue, and I want to know what query could cause a NULL here - is this because of collation issues or some other scenario - like deleted users etc...
 

janslu

Member
Here's the output:

Code:
php cmd.php xf:import -v
Starting import from [Nobita] Social Groups...
 - Importing... (< 1 sec)
                                                        
  [InvalidArgumentException]                             
  Attempted to convert NULL to string/binary [username] 
                                                        

Exception trace:
 () at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/Entity.php:691
 XF\Mvc\Entity\Entity->_castValueToType() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/Entity.php:575
 XF\Mvc\Entity\Entity->set() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/Entity.php:505
 XF\Mvc\Entity\Entity->__set() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Service/Thread/Creator.php:105
 XF\Service\Thread\Creator->setUser() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Service/Thread/Creator.php:69
 XF\Service\Thread\Creator->setupDefaults() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Service/Thread/Creator.php:53
 XF\Service\Thread\Creator->__construct() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Container.php:274
 XF\Container->createObject() at /var/www/hosts/www.babyboom.pl/forum/src/XF/App.php:1359
 XF\App->XF\{closure}() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Container.php:228
 XF\Container->create() at /var/www/hosts/www.babyboom.pl/forum/src/XF/App.php:2508
 XF\App->service() at /var/www/hosts/www.babyboom.pl/forum/src/XF.php:527
 XF::service() at /var/www/hosts/www.babyboom.pl/forum/src/addons/Truonglv/Groups/Import/Importer/Group.php:734
 Truonglv\Groups\Import\Importer\Group->stepPosts() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Import/Runner.php:160
 XF\Import\Runner->runStep() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Import/Runner.php:74
 XF\Import\Runner->run() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Cli/Command/Import.php:66
 XF\Cli\Command\Import->execute() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Cli/Runner.php:63
 XF\Cli\Runner->run() at /var/www/hosts/www.babyboom.pl/forum/cmd.php:15

                                              
  [InvalidArgumentException]                 
  Attempted to convert NULL to string/binary 
                                              

Exception trace:
 () at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/ValueFormatter.php:130
 XF\Mvc\Entity\ValueFormatter->castValueToType() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/Entity.php:687
 XF\Mvc\Entity\Entity->_castValueToType() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/Entity.php:575
 XF\Mvc\Entity\Entity->set() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Mvc/Entity/Entity.php:505
 XF\Mvc\Entity\Entity->__set() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Service/Thread/Creator.php:105
 XF\Service\Thread\Creator->setUser() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Service/Thread/Creator.php:69
 XF\Service\Thread\Creator->setupDefaults() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Service/Thread/Creator.php:53
 XF\Service\Thread\Creator->__construct() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Container.php:274
 XF\Container->createObject() at /var/www/hosts/www.babyboom.pl/forum/src/XF/App.php:1359
 XF\App->XF\{closure}() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Container.php:228
 XF\Container->create() at /var/www/hosts/www.babyboom.pl/forum/src/XF/App.php:2508
 XF\App->service() at /var/www/hosts/www.babyboom.pl/forum/src/XF.php:527
 XF::service() at /var/www/hosts/www.babyboom.pl/forum/src/addons/Truonglv/Groups/Import/Importer/Group.php:734
 Truonglv\Groups\Import\Importer\Group->stepPosts() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Import/Runner.php:160
 XF\Import\Runner->runStep() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Import/Runner.php:74
 XF\Import\Runner->run() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Cli/Command/Import.php:66
 XF\Cli\Command\Import->execute() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /var/www/hosts/www.babyboom.pl/forum/src/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/hosts/www.babyboom.pl/forum/src/XF/Cli/Runner.php:63
 XF\Cli\Runner->run() at /var/www/hosts/www.babyboom.pl/forum/cmd.php:15

xf:import
 
Top