Can't access attachments after upgrading from 2.0.15 to 2.1.2

Started by silverpt36, September 30, 2022, 11:26:43 AM

Previous topic - Next topic


Upgrade went well, no errors outputed.

After that i can't access attachments on posts, i get "File not found." on a blank page.

SMF logs registered this:
/var/www/forum/Sources/ShowAttachments.php (Line 128)  Backtrace information

Type of error: General
2: sha1_file(Array/14_4dfc0b6922d930921fa20f0685027dba9de01967): failed to open stream: No such file or directory

If i go to Manage Attachment Paths i see this:
Current   Path   Size (KB)   Files   Status
Array           111,415           1,716   Does not exist

The attachments folder is in the correct location under /var/www/forum/attachments and all the files are there with names like 14_4dfc0b6922d930921fa20f0685027dba9de01967. This exact file where i got the erros is there. It looks like SMF is not looking in the actual attachments folder. If i try to replace "array" in Current Path field with "attachments" wich is the name of the folder it says there is already a folder with that name.

Any help would be apreciated.

Sir Osis of Liver

The 2.1 upgrade adds .dat extension to all hashed filenames in /attachments directory.  Sometimes it doesn't. :(   If attachment files don't have the extension, they won't work.  You can add the extension manually.  If there are a lot of attachments, use the attached script.

Can someone move this to 2.1 support?

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns


That is part of the problem, but there is more. I've just added .dat extension in one of the hashed filenames, tried to open the corresponding attachment in the forum and same error ocurred. My SMF instance is not using the correct attachments folder:

If i go to Manage Attachment Paths i see this:
Current Path   Size (KB)   Files   Status
Array          111,415     1,716   Does not exist

I need to fix this part first and then i can add .dat extension to all the files there

Sir Osis of Liver

Have you run repair_settings to fix all paths?

What is the Attachments directory displayed in Attachment Settings?
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns


Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp