XF 2.3 Error xf_attachment_view doesn't exist

Ricsca

Well-known member
Licensed customer
I just noticed that since February 25, 2026, I've had 21 error pages in admin telling me that the xf_attachment_view table doesn't exist...
What could have happened?
I just figured out that maybe on the 25th I updated to xf 2.3.8 and now I'm on 2.3.9


Code:
            UPDATE xf_attachment AS a
            INNER JOIN xf_attachment_view AS av ON (a.attachment_id = av.attachment_id)
            SET a.view_count = a.view_count + av.total
       
------------

#0 src/XF/Db/Mysqli/Statement.php(207): XF\Db\AbstractStatement->getException('MySQL statement...', 1146, '42S02')
#1 src/XF/Db/Mysqli/Statement.php(43): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1146, '42S02')
#2 src/XF/Db/Mysqli/Statement.php(61): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Repository/AttachmentRepository.php(225): XF\Db\AbstractAdapter->query('
            UPDATE xf_a...')
#5 src/XF/Cron/Views.php(18): XF\Repository\AttachmentRepository->batchUpdateAttachmentViews()
#6 src/XF/Job/Cron.php(41): XF\Cron\Views::runViewUpdate(Object(XF\Entity\CronEntry))
#7 src/XF/Job/Manager.php(275): XF\Job\Cron->run(8)
#8 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#9 src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 8)
#10 job.php(46): XF\Job\Manager->runQueue(false, 8)
#11 {main}
 
Last edited:
I just noticed that since February 25, 2026, I've had 21 error pages in admin telling me that the xf_attachment_view table doesn't exist...
What could have happened?
Somehow that table has either been dropped from the database or it has been renamed.

I just figured out that maybe on the 25th I updated to xf 2.3.8 and now I'm on 2.3.9
An upgrade, if performed properly doesn't cause tables to go m.i.a. from the database. That being said, you can re create it. All that table does is it logs the id of an attachment whenever an attachment is viewed by an user.
 
Back
Top Bottom