Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: silverpt36 on September 30, 2022, 11:26:43 AM

Title: Can't access attachments after upgrading from 2.0.15 to 2.1.2
Post by: silverpt36 on September 30, 2022, 11:26:43 AM
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:
https://FORUM_NAME/index.php?action=dlattach;attach=14
/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.


Title: Re: Can't access attachments after upgrading from 2.0.15 to 2.1.2
Post by: Sir Osis of Liver on September 30, 2022, 12:39:36 PM
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?

Title: Re: Can't access attachments after upgrading from 2.0.15 to 2.1.2
Post by: silverpt36 on September 30, 2022, 01:05:09 PM
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
Title: Re: Can't access attachments after upgrading from 2.0.15 to 2.1.2
Post by: Sir Osis of Liver on September 30, 2022, 10:04:13 PM
Have you run repair_settings to fix all paths?

What is the Attachments directory displayed in Attachment Settings?
Title: Re: Can't access attachments after upgrading from 2.0.15 to 2.1.2
Post by: shawnb61 on November 25, 2022, 03:26:12 PM
Fixed in 2.1.3.