Fixed XF::logError does not work in CLI

vbresults

Well-known member
Affected version
2.3.7
It's expecting an IP that is not there during a CLI command run:

File: src/XF/Error.php:151
PHP:
$this->app->request()->getIp()

InvalidArgumentException: Invalid string IP: in */src/XF/Util/Ip.php:17
Stack trace:
#0 */src/XF/Error.php(151): XF\Util\Ip::stringToBinary('')
#1 */src/XF.php(261): XF\Error->logException(Object(ErrorException), false, '', true)
#2 /src/addons//XFRM/Job/*(24): XF::logException(Object(ErrorException), false, '', true)
#3 /src/addons//XFRM/Job/(95): *\XFRM\Job\->(Object(\XFRM\Entity\ResourceItem))
#4 /src/addons//XFRM/Job/AbstractImportJob.php(39): *\XFRM\Job\AbstractTrackerDescriptionJob->rebuildById(69)
#5 */src/XF/Job/Manager.php(275): *\XFRM\Job\AbstractImportJob->run(7.9618709087372)
#6 */src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 7.9618709087372)
#7 */src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 7.9618709087372)
#8 */src/XF/Cli/Command/RunJobs.php(58): XF\Job\Manager->runQueue(false, 8)
#9 */src/vendor/symfony/console/Command/Command.php(298): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 */src/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 */src/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\RunJobs), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 */src/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 */src/XF/Cli/Runner.php(115): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 */cmd.php(17): XF\Cli\Runner->run()
#15 {main}
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.8).

Change log:
Guard against Request::getIp not returning a valid IP in some cases.
There may be a delay before changes are rolled out to the XenForo Community.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.8).

Change log:

There may be a delay before changes are rolled out to the XenForo Community.
The bigger problem is that the logger is suppressing error output with that try/catch block.
 
Back
Top Bottom