XF 2.0 TypeError: Argument 2 passed to XF\Mvc\Router::__construct()

Alien

Well-known member
Any ideas?
  • TypeError: Argument 2 passed to XF\Mvc\Router::__construct() must be of the type array, boolean given, called in /home/sitename/public_html/src/XF/App.php on line 279
  • src/XF/Mvc/Router.php:26
  • Generated by: Unknown account
  • Feb 21, 2018 at 3:12 AM
Stack trace

#0 src/XF/App.php(279): XF\Mvc\Router->__construct(Object(Closure), false)
#1 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#2 src/XF/Pub/App.php(35): XF\Container->offsetGet('router.public')
#3 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#4 src/XF/App.php(2032): XF\Container->offsetGet('router')
#5 src/XF/Mvc/Dispatcher.php(350): XF\App->router()
#6 src/XF/Mvc/Dispatcher.php(51): XF\Mvc\Dispatcher->getRouter()
#7 src/XF/Mvc/Dispatcher.php(40): XF\Mvc\Dispatcher->route('goto/post')
#8 src/XF/App.php(1889): XF\Mvc\Dispatcher->run()
#9 src/XF.php(328): XF\App->run()
#10 index.php(13): XF::runApp('XF\\Pub\\App')
#11 {main}

Request state

array(4) {
["url"] => string(20) "/goto/post?id=812825"
["referrer"] => bool(false)
["_GET"] => array(1) {
["id"] => string(6) "812825"
}
["_POST"] => array(0) {
}
}
 
Do you have a caching layer set up?

The error suggests that at some point the cache of public routes was not available when the router was set up. This would either be coming from the xf_data_registry table or some caching you've got set up.

For this value to come back as false, it likely means that the cache wasn't available for some reason.

Your site seems to be running, so it's certainly not broken right now. If it keeps happening, investigate the caching that you have set up. Otherwise, safe to ignore for now, I think.
 
Yes, currently I am only running a file cache.

Are there any permissions I can check in the cache directory?

I have the following lines in my config file:

Code:
// Cache
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Filesystem';
$config['cache']['config'] = [
    'directory' => '/pathtoxen/internal_data/cache'
];

$config['cache']['sessions'] = true;

...and inside the internal_data directory, I have the following (let me know if any are not needed for XF 2):

attachments
cache
code_cache
file_check
image_cache
oembed_cache
page_cache
sitemaps
temp
templates
 
@Chris D Any thoughts on this one? I haven't had it reoccur since Feb 21, just wanted to make sure my cache settings above are ok and wanted to double check which permissions those settings may require.. Thanks!
 
Top Bottom