XF 2.1 PHP Fatal error: Uncaught XF\Db\Exception: No such file or directory in ...

bzcomputers

Well-known member
This has been reported before but after a little research of the issue it seems to be an ongoing and quite widespread problem among numerous XenForo forums.

Previous answer from staff have been to "Contact host for resolution". Maybe some further details on possible issues causing the error and possibly a little direction on a solution would be helpful to many forum owners as it now appears to be affecting indexed pages on dozens of XenForo sites.

Error Contents:
[12-Dec-2019 06:37:31 UTC] PHP Fatal error: Uncaught XF\Db\Exception: No such file or directory in /home/xxxx/public_html/community/src/XF/Db/Mysqli/Adapter.php:160
Stack trace:
#0 /home/xxxx/public_html/community/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array)
#1 /home/xxxx/public_html/community/src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection()
#2 /home/xxxx/public_html/community/src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect()
#3 /home/xxxx/public_html/community/src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('options')
#4 /home/xxxx/public_html/community/src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('options')
#5 /home/xxxx/public_html/community/src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array)
#6 /home/xxxx/public_html/community/src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array)
#7 /home/xxxx/public_html/community/src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array)
#8 in /home/xxxx/public_html/community/src/XF/Db/Mysqli/Adapter.php on line 160

I have personally seen this error popup in php logs since the installation of XenForo 2.1.4 back on September 12, 2019. It showed up that day a few times but never before. Since then it has shown up randomly about a dozen times either in groups of 2 or 3 identical errors right after each other or in a couple cases with dozens of the same error consistently for a couple minutes straight than stopping all on its' own.

When researching the error I came up with numerous XenForo sites that have actual pages indexed on Google with this error as their content. To see for yourself just search Google for "PHP Fatal error: Uncaught XF\Db\Exception: No such file or directory". Assuming that these errors are not continuous but sporadic (or else they would be reported more) and that Google pretty quickly re-indexes the actual page content when the error is gone (most of this pages when clicked on now do work and have content). We can likely assume that these sites are just a small portion of the ones affected by the issue and that on any given day or week a search for this same error will likely bring up other XenForo Forums with the issue.

Currently the list includes these XenForo Forums showing at least one page indexed with the above issue:
  • preludegaming.net
  • thai-trips.net
  • elgrandoc.uk
  • probiv.one
  • movieside.de
  • yunohost.org
  • penmai.com
  • tamilnovelwriters.com
  • felsefe.net
  • kamazity.ru
  • smokgames.online
  • sosyalbilgiler.biz
  • ilounge.com
  • androide-hilfe.de
  • 1roman.ir
  • koi-live.de
  • 91rocks.tk
  • japanhotline.com
  • wangcyber.com
  • heilpraktilker-foren.de
  • compudemano.com
  • arabtravelers.com
  • unterirdisch.de
  • primeforums.net
  • pandora.community
  • doena-soft.de
  • finalfantasyforums.net
  • wildundhund.de
  • aciklisederslerim.com
  • guidedhacking.com
  • eog.com
  • epicnpc.com
  • control.com
  • caves.ru
Even if this issue isn't a XenForo software error and is completely related to server setup it would be beneficial to numerous XenForo customers if there was some additional information provided about it and what possible solution(s) may work to fix it. It appears in part to be related to search engine bots crawling the site causing increased connections and possibly high loads. That is the only explanation for those sites listed above having pages indexed with the error.
 

Brogan

XenForo moderator
Staff member
It's a server issue - there's nothing that can be done within XF to resolve it.

There are various reasons for it happening - each instance needs to be investigated to determine the cause - there is no definitive answer as to what it could be.
 

Liam W

in memoriam 1998-2020
This is generally caused when the database server is offline. The no such file or directory error is given because, by default, the localhost hostname is a shortcut for using a Unix socket to connect to the database, and if the server isn't running, then the socket file will be missing - hence the no such file error.
 

Jeremy P

XenForo developer
Staff member
To add to the above, sometimes PHP can be configured to use the wrong MySQL socket location. You can try using 127.0.0.1 instead of localhost in your database configuration to use a TCP connection instead, but if the errors are only intermittent it's more likely MySQL is just not running/available.
 

TUG

Member
started with me early this morning...site completely offline with an instant http500 error trying to connect to anything on the forum (including admin)


[04-Nov-2020 13:08:03 UTC] PHP Fatal error: Uncaught XF\Db\Exception: No such file or directory in /home/removedl/forums/src/XF/Db/Mysqli/Adapter.php:165

this error repeats every second in the log since roughly 1am eastern.

I can connect to FTP, but its at dialup speeds for some reason. web host claims there is no load or bottleneck on the server, or anything related to memory/disk/usage/etc.

bit lost on this one.
 
Last edited:

TUG

Member
thanks, shot you another reply...appreciate the help.

web host appears stumped, and cant find anything on the server indicating any sort of issue.
 

TUG

Member
kudos to the support link...this fixed it
 
Top