XF 1.4 Failed to write the attachment file

Main Company

Active member
Problem start Tuesday of this week, and I have no idea why. I haven't made any changes to the forum since before Christmas. Any thoughts? (Mods, please feel free to relocate if this needs to be posted in bdAttachmentStore addon section)

Server Error Log

Error Info
XenForo_Exception:Failed to write the attachment file. -library/XenForo/DataWriter/AttachmentData.php:145


Stack Trace
#0 /var/www/xenforo/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(63): XenForo_DataWriter_AttachmentData->_postSave()
#1 /var/www/xenforo/library/XenForo/DataWriter.php(1409): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_postSave()
#2 /var/www/xenforo/library/XenForo/Model/Attachment.php(524): XenForo_DataWriter->save()
#3 /var/www/xenforo/library/XenForo/ControllerPublic/Attachment.php(201): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 2)
#4 /var/www/xenforo/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Attachment->actionDoUpload()
#5 /var/www/xenforo/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /var/www/xenforo/index.php(13): XenForo_FrontController->run()
#7 {main}

Request State
array(3) {
["url"] => string(116) "https://discuss.forumdomain.com/att...f7c00bbfd0b1c0efb56ea0296a8&content_type=post"
["_GET"] => array(2) {
["hash"] => string(32) "3b62ff7c00bbfd0b1c0efb56ea0296a8"
["content_type"] => string(4) "post"
}
["_POST"] => array(7) {
["Filename"] => string(28) "test.jpg"
["_xfResponseType"] => string(4) "json"
["content_data"] => array(1) {
["node_id"] => string(2) "23"
}
["_xfSessionId"] => string(32) "cd99f4ec9b050e5aa3e3012391b02eb5"
["_xfToken"] => string(8) "********"
["_xfNoRedirect"] => string(1) "1"
["Upload"] => string(12) "Submit Query"
}
}
 
Can you check the AttachmentData.php file of that add on and see if it is present in its location? If it is, can you see what the (chmodd) permissions for that file are set at?
 
Can you check the AttachmentData.php file of that add on and see if it is present in its location? If it is, can you see what the (chmodd) permissions for that file are set at?
AttachmentData.php => Permissions = 644

Where are you storing attachments? You have an add-on that's directly involved so it may well be the culprit.
Files are stored in /dataX/xenforo/data/yyyy/month_number.

Looks to me like a folder for 2016 has not been created yet, and come to think of it, I think the last time I was able to successfully upload a file it was still 2015.

I also just checked older attachment folder permissions...
/dataX/xenforo/data/ => 755
/dataX/xenforo/data/2014/ => 755
/dataX/xenforo/data/2015/ => 777

Do I need to create the /dataX/xenforo/data/2016/ manually???
 
Last edited:
Top Bottom