XF 2.0 Command "xf:legacy-cleanup" is not defined

I am getting the following error message in my local install. I have installed the addon. Any idea what can be the issue?

Note: I am on XF 2.0.12, the board is working just fine.

195117
 
Last edited:
If you add --verbose to the end, what is the full output?

Does php -v show you the expected version or a different one?

Sometimes changing:
PHP:
$config['db']['host'] = 'localhost';
To:
PHP:
$config['db']['host'] = '127.0.0.1';
in src/config.php will fix the issue because it will use a straight TCP connection rather than attempting to use a socket connection.
 
Thanks Chris. I deleted my post by mistake, can you please undelete?

If you add --verbose to the end, what is the full output?
I am just thinking am I doing it correctly. I have moved to ScotchBox recently inspired by XF's development doc, so not sure if I am running the cleanup command correctly. I am just running the command from my terminal after browsing to the XF root folder. Do I need to run it from inside virtualbox or so?

Here's the exception trace
Exception trace:


() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/Mysqli/Adapter.php:160


XF\Db\Mysqli\Adapter->makeConnection() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/Mysqli/Adapter.php:28


XF\Db\Mysqli\Adapter->getConnection() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/AbstractAdapter.php:51


XF\Db\AbstractAdapter->connect() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/AbstractAdapter.php:73


XF\Db\AbstractAdapter->query() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/AbstractAdapter.php:86


XF\Db\AbstractAdapter->fetchRow() at /Users/abdfahim/WebServer/public/xflive/src/XF/Install/Upgrader.php:64


XF\Install\Upgrader->getLatestUpgradeVersion() at /Users/abdfahim/WebServer/public/xflive/src/addons/XF1Cleanup/Cli/Command/LegacyCleanup.php:39


XF1Cleanup\Cli\Command\LegacyCleanup->execute() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Command/Command.php:245


Symfony\Component\Console\Command\Command->run() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Application.php:835


Symfony\Component\Console\Application->doRunCommand() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Application.php:185


Symfony\Component\Console\Application->doRun() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Application.php:117


Symfony\Component\Console\Application->run() at /Users/abdfahim/WebServer/public/xflive/src/XF/Cli/Runner.php:63


XF\Cli\Runner->run() at /Users/abdfahim/WebServer/public/xflive/cmd.php:15





xf:legacy-cleanup


Does php -v show you the expected version or a different one?
That seems correct.
PHP 7.1.19 (cli) (built: Aug 17 2018 20:10:18) ( NTS )


Copyright (c) 1997-2018 The PHP Group


Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

Sometimes changing:
PHP:
$config['db']['host'] = 'localhost';
To:
PHP:
$config['db']['host'] = '127.0.0.1';
in src/config.php will fix the issue because it will use a straight TCP connection rather than attempting to use a socket connection.
Already tried, but when I do that and try to run the same command, it says
abdfahim-MBP:xfroot abdfahim$ php cmd.php xf:legacy-cleanup --verbose

[XF\Db\Exception]
Connection refused


Exception trace:


() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/Mysqli/Adapter.php:160


XF\Db\Mysqli\Adapter->makeConnection() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/Mysqli/Adapter.php:28


XF\Db\Mysqli\Adapter->getConnection() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/AbstractAdapter.php:51


XF\Db\AbstractAdapter->connect() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/AbstractAdapter.php:73


XF\Db\AbstractAdapter->query() at /Users/abdfahim/WebServer/public/xflive/src/XF/Db/AbstractAdapter.php:86


XF\Db\AbstractAdapter->fetchRow() at /Users/abdfahim/WebServer/public/xflive/src/XF/Install/Upgrader.php:64


XF\Install\Upgrader->getLatestUpgradeVersion() at /Users/abdfahim/WebServer/public/xflive/src/addons/XF1Cleanup/Cli/Command/LegacyCleanup.php:39


XF1Cleanup\Cli\Command\LegacyCleanup->execute() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Command/Command.php:245


Symfony\Component\Console\Command\Command->run() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Application.php:835


Symfony\Component\Console\Application->doRunCommand() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Application.php:185


Symfony\Component\Console\Application->doRun() at /Users/abdfahim/WebServer/public/xflive/src/vendor/symfony/console/Application.php:117


Symfony\Component\Console\Application->run() at /Users/abdfahim/WebServer/public/xflive/src/XF/Cli/Runner.php:63


XF\Cli\Runner->run() at /Users/abdfahim/WebServer/public/xflive/cmd.php:15


xf:legacy-cleanup
(though, I still can browse the board!)
 
Last edited:
Back
Top Bottom