Skip to main content
Attachments upload fails after abrupt power-off Started by nous · · Read 57 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Attachments upload fails after abrupt power-off

There was an unscheduled poweroff of our forum-hosting VPS yesterday. On reboot, we can't upload attachments anymore:

Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.
Please consult your server administrator for more information.


The administration center attachment settings don't show anything unusual.

This isn't the first time we had problems with attachments, but it usually involved out-of-space situations were the Elkarte database couldn't be updated. We had to restore from backups every time for attachments and avatars to show up again, but I'd rather avoid it this time. IIRC, changing the attachments directory and moving the *.elk files from the shell into the new one would restore at least some of them, but then we'd end up with additional attachment directories in settings which couldn't be removed, unless with direct SQL commands which most usually corrupted something else in the database.

This time I haven't touched anything, for forensics purposes. I can post any additional requested information to help debugging, including SQL commands. Thanks in advance.

Re: Attachments upload fails after abrupt power-off

Reply #1

It seems odd that you have Auto Subdivide by years but everything is in a single attachment directory.

Since everything is in a single directory, i'd try setting it to manual behavior and then set that files directory as the current one on the attachments directory page.

Re: Attachments upload fails after abrupt power-off

Reply #2

Quote from: Spuds – It seems odd that you have Auto Subdivide by years but everything is in a single attachment directory.
Since everything is in a single directory, i'd try setting it to manual behavior and then set that files directory as the current one on the attachments directory page.
The Auto Subdivide was the initial setup which broke after the out-of-space incidents. I had to move all subdir (2017-2025) content to attachments/files to make images visible again.
Setting to Manual fixes the attachment upload (and moving back to subdivide breaks it...), but I'd really love to have the subdivide-by-year setting working, for a less mixed-up structure.
Thanks for your help!