XF 2.2 Site down

Faust

Well-known member
For some reason. I have an issue with database. I just checked the site, and seems there is DB issue.

Any advice:

Code:
XF\Db\Exception: No route to host src/XF/Db/Mysqli/Adapter.php:165
Generated by: Unknown account Jan 16, 2021 at 3:43 PM


Code:
Stack trace
#0 src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection()
#2 src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect()
#3 src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('addOnsComposer')
#4 src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('addOnsComposer')
#5 src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array)
#6 src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array)
#7 src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array)
#8 src/XF/App.php(1753): XF\DataRegistry->offsetGet('addOnsComposer')
#9 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#10 src/XF/App.php(2280): XF\Container->offsetGet('addon.composer')
#11 src/XF/App.php(1852): XF\App->setupAddOnComposerAutoload()
#12 src/XF/Pub/App.php(91): XF\App->setup(Array)
#13 src/XF.php(461): XF\Pub\App->setup(Array)
#14 src/XF.php(484): XF::setupApp('XF\\Pub\\App')
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
 
Solution
Yes, that was the error you only previously posted the stack trace for.

We recommend truncating (or emptying) the xf_session table using PhpMyAdmin if you have access to that. Otherwise you are best to contact your host.

The table crashing may be a side-effect of the "no route to host" error so probably best to contact your host anyway.
I'm able to login on admincp, but don't know what caused this issue. Recently I have changed my dns server to cloudflare, I'm not sure if that can affect the site.
 
This seems to be a network connectivity or local DNS or TCP/IP issue between your web server and your database. It would be one for your host to look into in the first instance.
 
This seems to be a network connectivity or local DNS or TCP/IP issue between your web server and your database. It would be one for your host to look into in the first instance.

Can it be because I changed dns server to cloudflare ?

I also have this everytime:

Code:
            -- XFDB=fromWrite
            SELECT session_data
            FROM xf_session
            WHERE session_id = ?
                AND expiry_date >= ?
        
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 145, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 145, 'HY000')
#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('
            -- XFDB=fro...', Array)
#5 src/XF/Session/DbStorage.php(30): XF\Db\AbstractAdapter->fetchOne('
            -- XFDB=fro...', Array)
#6 src/XF/Session/Session.php(53): XF\Session\DbStorage->getSession('2NCa2OA6sOT3Cqh...')
#7 src/XF/App.php(860): XF\Session\Session->start('́D')
#8 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#9 src/XF/Pub/App.php(45): XF\Container->offsetGet('session.public')
#10 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#11 src/XF/App.php(2636): XF\Container->offsetGet('session')
#12 src/XF/Pub/App.php(150): XF\App->session()
#13 src/XF/App.php(2296): XF\Pub\App->start(true)
#14 src/XF.php(488): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
 
I don’t know what that error is as it’s just the stack trace but, no, this will be a localised issue with the connection from the web server to the database.
 
Where I can check that ?

This was one of them:
Any advice:

Code:
XF\Db\Exception: No route to host src/XF/Db/Mysqli/Adapter.php:165
Generated by: Unknown account Jan 16, 2021 at 3:43 PM

This seems to be a different error but you only provided the stack trace, we'd need the full error message.
I also have this everytime:

Code:
-- XFDB=fromWrite
SELECT session_data
FROM xf_session
WHERE session_id = ?
AND expiry_date >= ?

------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 145, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 145, 'HY000')
#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('
-- XFDB=fro...', Array)
#5 src/XF/Session/DbStorage.php(30): XF\Db\AbstractAdapter->fetchOne('
-- XFDB=fro...', Array)
#6 src/XF/Session/Session.php(53): XF\Session\DbStorage->getSession('2NCa2OA6sOT3Cqh...')
#7 src/XF/App.php(860): XF\Session\Session->start('́D')
#8 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#9 src/XF/Pub/App.php(45): XF\Container->offsetGet('session.public')
#10 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#11 src/XF/App.php(2636): XF\Container->offsetGet('session')
#12 src/XF/Pub/App.php(150): XF\App->session()
#13 src/XF/App.php(2296): XF\Pub\App->start(true)
#14 src/XF.php(488): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
 
This was one of them:


This seems to be a different error but you only provided the stack trace, we'd need the full error message.
Here is the full error

Code:
XF\Db\Exception: No route to host src/XF/Db/Mysqli/Adapter.php:165
Generated by: Unknown account Jan 16, 2021 at 3:43 PM
Stack trace
#0 src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection()
#2 src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect()
#3 src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('addOnsComposer')
#4 src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('addOnsComposer')
#5 src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array)
#6 src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array)
#7 src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array)
#8 src/XF/App.php(1753): XF\DataRegistry->offsetGet('addOnsComposer')
#9 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#10 src/XF/App.php(2280): XF\Container->offsetGet('addon.composer')
#11 src/XF/App.php(1852): XF\App->setupAddOnComposerAutoload()
#12 src/XF/Pub/App.php(91): XF\App->setup(Array)
#13 src/XF.php(461): XF\Pub\App->setup(Array)
#14 src/XF.php(484): XF::setupApp('XF\\Pub\\App')
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
Request state
array(4) {
  ["url"] => string(63) "/***************"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

But I think you are right, seems all my sites are down from the hosting, so I believe it's something wrong on my HOSTING company.
 
This is the issue what I got now:

Code:
XF\Db\Exception: MySQL statement prepare error [145]: Table './*******/xf_session' is marked as crashed and should be repaired src/XF/Db/AbstractStatement.php:228
Generated by: Unknown account Jan 16, 2021 at 4:21 PM
Stack trace
DELETE  FROM `xf_session` WHERE expiry_date < ?
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 145, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 145, 'HY000')
#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(289): XF\Db\AbstractAdapter->query('DELETE  FROM `x...', 1610814069)
#5 src/XF/Session/DbStorage.php(62): XF\Db\AbstractAdapter->delete('xf_session', 'expiry_date < ?', 1610814069)
#6 src/XF/Cron/CleanUp.php(90): XF\Session\DbStorage->deleteExpiredSessions()
#7 [internal function]: XF\Cron\CleanUp::runHourlyCleanUp(Object(XF\Entity\CronEntry))
#8 src/XF/Job/Cron.php(34): call_user_func(Array, Object(XF\Entity\CronEntry))
#9 src/XF/Job/Manager.php(258): XF\Job\Cron->run(7.95422)
#10 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 7.95422)
#11 src/XF/Job/Manager.php(84): XF\Job\Manager->runJobEntry(Array, 7.95422)
#12 job.php(43): XF\Job\Manager->runQueue(false, 8)
#13 {main}
Request state
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(32) "*********/admin.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Yes, that was the error you only previously posted the stack trace for.

We recommend truncating (or emptying) the xf_session table using PhpMyAdmin if you have access to that. Otherwise you are best to contact your host.

The table crashing may be a side-effect of the "no route to host" error so probably best to contact your host anyway.
 
Solution
There should be an option to either Truncate or Empty to the xf_session table. If you're unsure how to use PhpMyAdmin you should consult your host. We can only provide support with the software itself.
 
Top Bottom