Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Sir Osis of Liver on June 23, 2022, 04:57:38 PM

Title: 2.1 upgrade fails attachments extension
Post by: Sir Osis of Liver on June 23, 2022, 04:57:38 PM
This has been reported twice in past couple days -

https://www.simplemachines.org/community/index.php?topic=582736.msg4128664#msg4128664

https://www.simplemachines.org/community/index.php?topic=582793.msg4129057#msg4129057
Title: Re: 2.1 upgrade fails attachments extension
Post by: landyvlad on October 03, 2022, 07:26:03 PM
So I gather that there is an attachments issue which means now would not be the time to upgrade from 2.0.19 to 2.1.2

I gather the problem is due to be fixed in 2.1.3?

Am I correct as if that's he case, I'll wait.
Title: Re: 2.1 upgrade fails attachments extension
Post by: shawnb61 on October 03, 2022, 08:10:23 PM
There is no known, documented, reproducible bug where a 2.1 upgrade loses pix.

OTOH, The upgrader is definitely sensitive to improper settings, e.g., if the attachment folders are incorrect.  This usually happens after a forum move, restore, or site restructure; under all such circumstances, you should run repair_settings.php prior to upgrading to ensure smf knows where your folders are - especially attachments.

You absolutely MUST be upgrading a fully working forum, with proper settings & folders, or bad things happen.
Title: Re: 2.1 upgrade fails attachments extension
Post by: Sir Osis of Liver on October 03, 2022, 09:51:37 PM
There have been multiple reports of upgrade completing successfully but failed to add .dat extension to hashed attachment filenames.  Attachments aren't lost, they just can't be found.  It's fixed by manually adding the extension, then they're displayed correctly.  This glitch is often accompanied by failure to move uploaded avatars from /attachments to /custom_avatar. 
Title: Re: 2.1 upgrade fails attachments extension
Post by: shawnb61 on October 03, 2022, 11:01:37 PM
I cannot reproduce on an upgrade of a working forum.

OTOH, it's very easy to reproduce if you use the wrong folders for avatars & attachments.

If you can reproduce by any other means, please share!
Title: Re: 2.1 upgrade fails attachments extension
Post by: shawnb61 on October 03, 2022, 11:37:43 PM
I logged an enhancement request, to confirm the existence of the folders before the upgrade and to issue a warning if they are not found:
https://github.com/SimpleMachines/SMF/issues/7555
Title: Re: 2.1 upgrade fails attachments extension
Post by: Aleksi "Lex" Kilpinen on October 04, 2022, 12:57:53 AM
This could just be a simple case of bad server config, where attachments have at some point ended up owned by no-one, and the issue has been later resolved but the files have not been chowned correctly. I don't see either of those topics including any checks to error logs from the time of upgrade.
Speaking from experience here, that's a real issue with some servers...
Title: Re: 2.1 upgrade fails attachments extension
Post by: Sir Osis of Liver on October 04, 2022, 11:58:27 AM
The attached script has worked on several forums that had this problem.  If it were caused by server config or incorrect chown, wouldn't script also fail?
Title: Re: 2.1 upgrade fails attachments extension
Post by: Aleksi "Lex" Kilpinen on October 04, 2022, 12:03:05 PM
Probably yes, if one php script fails because of that, another shouldn't work any better. You do have a point there.
Title: Re: 2.1 upgrade fails attachments extension
Post by: landyvlad on October 04, 2022, 10:21:50 PM
So then assuming that I have a fully working forum, and take a back up first, then upgrading to 2.1.x shouldn't result in these issues. Is that correct?
Title: Re: 2.1 upgrade fails attachments extension
Post by: shawnb61 on October 04, 2022, 11:07:24 PM
Quote from: landyvlad on October 04, 2022, 10:21:50 PMSo then assuming that I have a fully working forum, and take a back up first, then upgrading to 2.1.x shouldn't result in these issues. Is that correct?

Yep.
Title: Re: 2.1 upgrade fails attachments extension
Post by: landyvlad on October 05, 2022, 12:16:52 AM
Thank you
Title: Re: 2.1 upgrade fails attachments extension
Post by: shawnb61 on November 25, 2022, 03:24:15 PM
Folder checks were added in 2.1.3.

Likely an overdue feature.