CLI:xf-import aborts with DB error when using --processes

Affected version
2.1.2

Kirby

Well-known member
MySQL server has gone away:

Code:
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] mys...', '/var/www/vhosts...', 35, Array)
#1 src/XF/Db/Mysqli/Statement.php(35): mysqli->prepare('SELECT MAX(comm...')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(150): XF\Db\AbstractAdapter->query('SELECT MAX(comm...', Array)
#5 src/addons/XFMG/Import/Importer/vBulletinAlbums4.php(89): XF\Db\AbstractAdapter->fetchOne('SELECT MAX(comm...')
#6 src/XF/Import/Runner.php(197): XFMG\Import\Importer\vBulletinAlbums4->getStepEndComments()
#7 src/XF/Import/Runner.php(81): XF\Import\Runner->setupRunnableStep()
#8 src/XF/Import/ParallelRunner.php(20): XF\Import\Runner->initializeRun()
#9 src/XF/Import/Runner.php(128): XF\Import\ParallelRunner->runUntilCompleteInternal(Object(XF\Import\Manager), Object(Closure))
#10 src/XF/Cli/Command/Import.php(144): XF\Import\Runner->runUntilComplete(Object(XF\Import\Manager), Object(Closure))
#11 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\Import->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 src/vendor/symfony/console/Application.php(960): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/XF/Cli/Runner.php(63): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 cmd.php(15): XF\Cli\Runner->run()
#17 {main}
Code:
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] mys...', '/var/www/vhosts...', 35, Array)
#1 src/XF/Db/Mysqli/Statement.php(35): mysqli->prepare('SELECT MAX(comm...')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(150): XF\Db\AbstractAdapter->query('SELECT MAX(comm...', Array)
#5 src/addons/XFMG/Import/Importer/vBulletinAlbums4.php(89): XF\Db\AbstractAdapter->fetchOne('SELECT MAX(comm...')
#6 src/XF/Import/Runner.php(197): XFMG\Import\Importer\vBulletinAlbums4->getStepEndComments()
#7 src/XF/Import/Runner.php(81): XF\Import\Runner->setupRunnableStep()
#8 src/XF/Import/ParallelRunner.php(20): XF\Import\Runner->initializeRun()
#9 src/XF/Import/Runner.php(128): XF\Import\ParallelRunner->runUntilCompleteInternal(Object(XF\Import\Manager), Object(Closure))
#10 src/XF/Cli/Command/Import.php(144): XF\Import\Runner->runUntilComplete(Object(XF\Import\Manager), Object(Closure))
#11 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\Import->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 src/vendor/symfony/console/Application.php(960): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/XF/Cli/Runner.php(63): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 cmd.php(15): XF\Cli\Runner->run()
#17 {main}
This apparently does happen as the code does expect that a database connection will always be there after it has been established.
This might not be the case in the main process if a step does take longer than wait_timeout.
 
Top