[bd] Attachment Store [Deleted]

Hello.
I've moved files from S3 to default. and did 2 rebuilds:
Move Attachment Data
Update Attachment Data Storage Options

but the attachements' url still in S3 as before .


any tips?
 
xfrocks doesn't seems to response anymore.
I have an active webmaster badge and still no support.
I will stop recommending his add-ons.
 
I'm having the following issue, which appears to have started in 2016, and is detailed in the following post.

PS. I'm using addon v1.1.3
https://xenforo.com/community/threads/failed-to-write-the-attachment-file.110773
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"
}
}
 
Last edited:
I'm having the following issue, which appears to have started in 2016, and is detailed in the following post.

PS. I'm using addon v1.1.3
https://xenforo.com/community/threads/failed-to-write-the-attachment-file.110773
Per the quote thread above, attachments are failing to write.

The issue started in January 2016. When I investigated the target attachments folder (/dataX/xenforo/data/), I saw that folders for 2014 and 2015 had been created, with each having 12 folders inside of them (01, 02.... 12), with each folder representing a different month (/dataX/xenforo/data/yyyy/month_number).

But no folder for 2016 has been automatically created. So, my questions are as follows:

1. Does this add-on automatically make the appropriate directories wihin the target location?
2. What are the file permissions on this target directories supposed to be? (ie 755?)
3. What is the ownership (chown) and group (chgrp) assignments for these target directories suppposed to be?

EDIT: I just manually created the "2016" directory with the "01" directory underneath it (/dataX/xenforo/data/2016/01) using folder permision = 755 for both folder 2016 and folder 01. Uploads to my forum now work.

But shouldn't the system create these folder automatically? It's been so long since I initially seutp this add-on that I've forgotten.
 
Last edited:
Per the quote thread above, attachments are failing to write.

The issue started in January 2016. When I investigated the target attachments folder (/dataX/xenforo/data/), I saw that folders for 2014 and 2015 had been created, with each having 12 folders inside of them (01, 02.... 12), with each folder representing a different month (/dataX/xenforo/data/yyyy/month_number).

But no folder for 2016 has been automatically created. So, my questions are as follows:

1. Does this add-on automatically make the appropriate directories wihin the target location?
2. What are the file permissions on this target directories supposed to be? (ie 755?)
3. What is the ownership (chown) and group (chgrp) assignments for these target directories suppposed to be?

EDIT: I just manually created the "2016" directory with the "01" directory underneath it (/dataX/xenforo/data/2016/01) using folder permision = 755 for both folder 2016 and folder 01. Uploads to my forum now work.

But shouldn't the system create these folder automatically? It's been so long since I initially seutp this add-on that I've forgotten.
Additional Note: I'm using the FTP upload configuration.
 
Does this work with keycdn - my XF is using it already but what to have attachments that way too.. If yes - which options to set in attactments store?
 
Per the quote thread above, attachments are failing to write.

The issue started in January 2016. When I investigated the target attachments folder (/dataX/xenforo/data/), I saw that folders for 2014 and 2015 had been created, with each having 12 folders inside of them (01, 02.... 12), with each folder representing a different month (/dataX/xenforo/data/yyyy/month_number).

But no folder for 2016 has been automatically created. So, my questions are as follows:

1. Does this add-on automatically make the appropriate directories wihin the target location?
2. What are the file permissions on this target directories supposed to be? (ie 755?)
3. What is the ownership (chown) and group (chgrp) assignments for these target directories suppposed to be?

EDIT: I just manually created the "2016" directory with the "01" directory underneath it (/dataX/xenforo/data/2016/01) using folder permision = 755 for both folder 2016 and folder 01. Uploads to my forum now work.

But shouldn't the system create these folder automatically? It's been so long since I initially seutp this add-on that I've forgotten.
Well, for those interested, here's what I figured out for directory/file permission/ownership using FTP as the upload method.

Permissions:
- directories = 755
- files = 644

Ownership
Owner = FTP username
Group = FTP user group
 
Can this add-on use AWS instance roles to provision the S3 permissions so that you don't have to embed AWS keys into the config? If I assigned an instance role to the server I could grant permission to the S3 bucket without the need for secret keys. Does the add-on check for presence of keys before trying to upload to S3?
 
Is dropbox and google drive supported..?
I want this because very good plugin indeed.

No; those services are not suitable for this purpose. You would be in violation of the Terms of Service of either site.

Can this add-on use AWS instance roles to provision the S3 permissions so that you don't have to embed AWS keys into the config? If I assigned an instance role to the server I could grant permission to the S3 bucket without the need for secret keys. Does the add-on check for presence of keys before trying to upload to S3?

It doesn't. The credentials used to upload each attachment are stored in the database; this makes it difficult to rotate keys and impossible to use different credentials for each server. At NamePros, we've modified XenForo so that we can override specific options using the config file, but bdAttachmentStore ignores the options when managing existing attachments. I've looked into patching bdAttachmentStore to use the latest credentials if the bucket and region match the config, but it wouldn't be a trivial update.
 
It doesn't. The credentials used to upload each attachment are stored in the database; this makes it difficult to rotate keys and impossible to use different credentials for each server. At NamePros, we've modified XenForo so that we can override specific options using the config file, but bdAttachmentStore ignores the options when managing existing attachments. I've looked into patching bdAttachmentStore to use the latest credentials if the bucket and region match the config, but it wouldn't be a trivial update.

It's possible to rotate keys with the included rebuild tools if you must do that btw.
 
My attachments are not working after disabling this addon and doing a dns change. How can i make it go back to default xenforo configurations?
 
Hi, I have a real problem. I moved my website and the database to another server and when I try to run the Rebuild Attachment Thumbnails in the ACP tool menu I get the error below.

XenForo_Exception: Thumb rebuild for #2997: Unable to login to mydomain.com (user=oldusername) - library/bdAttachmentStore/Model/File.php:334

Somewhere my old ftp username on the old server has been linked or stored with those files and on the new server with my new ftp username it tries to somehow log on (I think) with that old username and after is does it several times my hosting company blocks my ip address because of the repeated failed login attempts. I have my new username all configured properly in the add-on's settings, but the old files from the old server are still somehow linked to my old ftp username from the old server.

I can search my database using phpMyAdmin and can find my old username listed a few thousand times in the xf_attachment_data table, but how do I correct it? I cannot actually see that old username listed in the table rows anywhere.

I also just updated to xenforo v1.57 today as well so I’m not sure if that is the real problem, but how can I correct the old user name stored to those files and change it to my new username if necessary? Is there some query I can run? I need to fix this.

Please look into what is happening and let me know how to fix it. I’m not sure if the old ftp username stored to those files is the problem, but it might be. If it’s not, then it is because something has now changed with xenforo v1.57

Stack Trace below…

#0 /home/newusername/public_html/library/bdAttachmentStore/Model/File.php(394): bdAttachmentStore_Model_File->_ftp_connect(Array)

#1 /home/newusername/public_html/library/bdAttachmentStore/Model/File.php(29): bdAttachmentStore_Model_File->_ftp_saveFile(Array, '/home/newusername/...', '2016/03/2977_66...', 'IMG_0337.JPG')

#2 /home/newusername/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(133): bdAttachmentStore_Model_File->saveFile('ftp', Array, '/home/newusername/...', '2016/03/2977_66...', 'IMG_0337.JPG')

#3 /home/newusername/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(145): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/home/newusername/...', Array, true)

#4 /home/newusername/public_html/library/XenForo/DataWriter/AttachmentData.php(167): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_writeAttachmentFileData('\xFF\xD8\xFF\xE0\x00\x10JFIF\x00\x01\x01\x00\x00...', Array, true)

#5 /home/newusername/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(55): XenForo_DataWriter_AttachmentData->_postSave()

#6 /home/newusername/public_html/library/XenForo/DataWriter.php(1423): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_postSave()

#7 /home/newusername/public_html/library/XenForo/Deferred/AttachmentThumb.php(67): XenForo_DataWriter->save()

#8 /home/newusername/public_html/library/bdAttachmentStore/XenForo/Deferred/AttachmentThumb.php(11): XenForo_Deferred_AttachmentThumb->execute(Array, Array, 7.9999980926514, '')

#9 /home/newusername/public_html/library/XenForo/Model/Deferred.php(295): bdAttachmentStore_XenForo_Deferred_AttachmentThumb->execute(Array, Array, 7.9999980926514, '')

#10 /home/newusername/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999980926514, '', false)

#11 /home/newusername/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)

#12 /home/newusername/public_html/library/XenForo/ControllerAdmin/Tools.php(159): XenForo_Model_Deferred->run(true, NULL, '', false)

#13 /home/newusername/public_html/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Tools->actionRunDeferred()

#14 /home/newusername/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))

#15 /home/newusername/public_html/admin.php(13): XenForo_FrontController->run()

#16 {main}
.
 
Top Bottom