Attachments No Longer Displaying Correctly

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Cory Ander
Registered User
Posts: 76
Joined: Thu Mar 21, 2013 1:31 am

Attachments No Longer Displaying Correctly

Post by Cory Ander »

Support Request Template
What version of phpBB are you using? phpBB 3.2.2 (since updated to 3.2.8)
What is your board's URL? http://bircurries.co.uk/forum
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? backup & restore version 3.2.2 (before updating to 3.2.8)
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? No
Do you have any extensions installed? Yes
What extensions do you have installed? Various
What styles do you currently have installed? prosilver
What language(s) is your board currently using? english
Which database type/version are you using? MariaDB
What is your level of experience? New to PHP and phpBB
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? I backed-up my board (version 3.2.2) using Filezilla. I then used Filezilla to delete all files and folders. I then used Filezilla to restore the backed-up version of my board. The "treat files without extension as ASCII file" was unchecked for both backup and restore.
Please describe your problem. My board was working fine before I attempted to update it to version 3.2.8. The update failed so I deleted all files and folders from my host and restored the backup of 3.2.2 that I made using Filezilla. After restoring my board, most of the attachments no longer displayed correctly (although a small percentage of attachments did display correctly).
Generated by SRT Generator

After using Filezilla to backup and restore of my forum (version 3.2.2) most of the attachments no longer displayed correctly (whereas a small percentage did display correctly). This is an example of what I now see:
Attachments.jpg
Everything else appeared to be working correctly. The attachments are actually present and open if you "open link in new tab".

I have since updated my board to version 3.2.8 (hoping that it would resolve the problem) and everything appears to be working correctly....except that the above problem with displaying attachments still exists.

I presume it was a problem with my backup and/or restore settings (the "treat files without extension as ASCII file" was unchecked for both backup and restore)? Any help with rectifying the problem would be very much appreciated! 8-)

User avatar
warmweer
Jr. Extension Validator
Posts: 3903
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Attachments No Longer Displaying Correctly

Post by warmweer »

Cory Ander wrote:
Mon Nov 18, 2019 5:14 am
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? I backed-up my board (version 3.2.2) using Filezilla. I then used Filezilla to delete all files and folders. I then used Filezilla to restore the backed-up version of my board. The "treat files without extension as ASCII file" was unchecked for both backup and restore.
There was no need to delete the files folder.
Check the attachments in the ACP - Resynchronising them might solve the problem (no guarantees).
We should embrace problems, without which there wouldn't be any solutions.

Cory Ander
Registered User
Posts: 76
Joined: Thu Mar 21, 2013 1:31 am

Re: Attachments No Longer Displaying Correctly

Post by Cory Ander »

Hi warmweer, thanks for your reply.

Just to clarify, I deleted every file and folder from my host (since my attempt at auto-updating to 3.2.8 failed). I then restored my back-up version of version 3.2.2, using Filezilla, to take me back to where I was before the auto-update attempt (or, so I thought!). Everything seemed to working fine, apart from the attachments (although still present) no longer displayed properly (as per the above screen shot).

I cleared the cache after making changes. I've also "Resynchronised statistics", "Resynchronised post counts" and "Resynchronised dotted topics" - if that's what you mean by "resynchronise the attachments"? If not, what do you mean, please? I haven't changed any attachment settings (so I presume they all remained as they were).

Thanks for your reply and help, much appreciated.

User avatar
warmweer
Jr. Extension Validator
Posts: 3903
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Attachments No Longer Displaying Correctly

Post by warmweer »

In ACP, Posting, Attachments you can see the status of the attachments.
When transferring your files they probably became orphaned (perhaps a datetime change?).
Going from memory, if you have orphaned attachments there should be an option to resynchronise them.

When you update a board, the files in the file folders remain untouched (the files you uploaded are not part of a 3.2.0 or of 3.2.8 installation) and there is no need to delete that . The same applies to the store folder (which may contain you backups which you would lose when deleting that folder.

For a plain update
You should use the full package (or changed files package).

https://www.phpbb.com/support/documents ... &version=3 4.i or 4.ii
We should embrace problems, without which there wouldn't be any solutions.

Cory Ander
Registered User
Posts: 76
Joined: Thu Mar 21, 2013 1:31 am

Re: Attachments No Longer Displaying Correctly

Post by Cory Ander »

There are no "orphaned attachments". I otherwise see no option, in the ACP, to resynchronise attachments?

The attachments are actually there in the correct posts (i.e. they display correctly if opened in a new window). But they no longer display correctly in the post (as per my screen shot above).

I tried to auto-update from version 3.2.2 to version 3.2.8 but the update failed. I decided to use the auto-update package because I believed there to be underlying code changes. Because it failed, I decided to delete all folders and files (rightly or wrongly) and restore my backup version (using Filezilla) of version 3.2.2. It was then that the attachments no longer displayed properly. Presumably, it is something to do with the settings, in Filezilla, when I made and backup and/or subsequently restored the files? "Treat files without an extension as ASCII file" was unchecked when making a backup and when restoring the backup.

I subsequently used the "full package" to update to version 3.2.8 (based on the advice and instructions given here). However, the problem with displaying attachments (created when restoring my backup version of 3.2.2) still remains (although everything else appears to be working normally).

User avatar
warmweer
Jr. Extension Validator
Posts: 3903
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Attachments No Longer Displaying Correctly

Post by warmweer »

Cory Ander wrote:
Mon Nov 18, 2019 9:38 am
I decided to use the auto-update package because I believed there to be underlying code changes.
That's conflicting with:
Cory Ander wrote:
Mon Nov 18, 2019 5:14 am
Do you have any MODs installed? No


Anyway, even with modifications, it always safer to reapply the edits yourself than to rely on autoupdate.
Cory Ander wrote:
Mon Nov 18, 2019 5:14 am
After restoring my board, most of the attachments no longer displayed correctly (although a small percentage of attachments did display correctly).
Those that do display correctly: do they have the same extension?

BTW did you purge the cache?
We should embrace problems, without which there wouldn't be any solutions.

Cory Ander
Registered User
Posts: 76
Joined: Thu Mar 21, 2013 1:31 am

Re: Attachments No Longer Displaying Correctly

Post by Cory Ander »

I much appreciate your (and anyone else's) help, warmweer, but I've done what I've done for the reasons I did them. My board started out as version 3.0, so I presumed that there were probably underlying code changes, remaining, associated with the several mods I installed then (i.e. as version 3.0 and version 3.1). However, the latest version was 3.2.2 (which was working fine), so there are now no mods, only extensions, but underlying code changes, from earlier versions, may remain. I can't recall if I did full installs in the meantime. Unfortunately, I'm not an expert in this stuff; simply a board operator.

The real question is why my (clean) restored version (of 3.2.2) is different than what I backed up? That is, why are the attachments no longer displayed (whereas they previously were)?

Yes, I've purged the cache whenever I've made changes.

It seems that some attachments, that are displayed, are jpg files. However, some attachments, that aren't displayed, are also jpg files. So it doesn't appear to be file-type related. However, it may be size related (with the larger files not being correctly displayed within the post).

Thanks for your help. I'm aware that I may not explaining myself (or the problem) particularly clearly! :P

User avatar
EA117
Registered User
Posts: 1295
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Attachments No Longer Displaying Correctly

Post by EA117 »

Cory Ander wrote:
Mon Nov 18, 2019 9:38 am
The attachments are actually there in the correct posts (i.e. they display correctly if opened in a new window). But they no longer display correctly in the post (as per my screen shot above).
This seems potentially consistent with "the thumbnail generated for this image attachment is no longer present in the /files folder", or that the thumbnail file is zero-length or corrupt.

You might want to isolate one of these problem files and test that theory. Hover over one of the broken image displays, and you will see a link similar to "file.php?id=3&mode=view". Take that file ID value ("3" in this example) and use phpMyAdmin or whatever database tool you have available to look for the entry with this ID as it's "attach_id" value in your phpbb_attachments table in the database.

Once you find that entry, make note of the "physical_filename" field for that attachment ID. It will be some generated number like "2_a7d8367a1bd1997ae8d3132e9750beb9", instead of the original attachment file name. Then also confirm the value in the "thumbnail" field for that attachment, which we're assuming should be a value of "1".

Looking in your backup files and/or on your live site, first verify that you can find "2_a7d8367a1bd1997ae8d3132e9750beb9" as a file in your /files folder, and that is has a non-zero size. We're assuming this file is correctly present as expected and fine, since the attachment does display for you once you click on it.

But then look in the /files folder for the same file name but with "thumb_" prefixed on it. e.g. "thumb_2_a7d8367a1bd1997ae8d3132e9750beb9". This will be the file phpBB is attempting to display for the image that actually appears in the post, using an image source URL such as "file.php?id=3&t=1". This is the URL that retrieves just the thumbnail image ("thumb_2_a7d8367a1bd1997ae8d3132e9750beb9"), as opposed to "file.php?id=3&mode=view" which retrieves the actual attachment ("2_a7d8367a1bd1997ae8d3132e9750beb9").

So the questions are "does the database still indicate that a thumbnail should exist?" ("thumbnail" is "1" in the database for this file ID.) And does the corresponding "thumb_" file exist in the /files directory, in addition to the actual attachment file? And if the "thumb_" file does exist as expected, is the "thumb_" file a non-zero-length file?

Did you possibly have an extension installed which provided some kind of enhancement attachment or thumbnail functionality? Based on how you described your update process, presumably that extension is still present and installed, but maybe there are some additional expectations due to the extension's presence. You'll have to judge that, or provide the actual list of installed extensions in the SRT that was posted.

localhost_phpmyadmin_sql.php_server=1&db=bitnami_phpbb&table=phpbb_attachments&pos=0(Laptop with HiDPI screen) (1).png

User avatar
warmweer
Jr. Extension Validator
Posts: 3903
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Attachments No Longer Displaying Correctly

Post by warmweer »

EA117 wrote:
Mon Nov 18, 2019 11:26 am
Cory Ander wrote:
Mon Nov 18, 2019 9:38 am
The attachments are actually there in the correct posts (i.e. they display correctly if opened in a new window). But they no longer display correctly in the post (as per my screen shot above).
This seems potentially consistent with "the thumbnail generated for this image attachment is no longer present in the /files folder", or that the thumbnail file is zero-length or corrupt.
In case the problem is related to missing thumbnails (still sleepy so I didn't even think of that :oops: , that's why we have EA117 on standby ;) ).
I have some scripts which allow regenerating thumbnails. Luckily I also noted where I found them so instead of copying, I'll just give the link.
http://canonknipser.com/viewtopic.php?f=6&t=12

Mind you, I used this once for testing and IIRC it worked but it remains a try at your own risk (although it doesn't touch the original images).
And searching through the board here I came up with: viewtopic.php?f=466&t=2377451
which you may want to read through.
We should embrace problems, without which there wouldn't be any solutions.

Cory Ander
Registered User
Posts: 76
Joined: Thu Mar 21, 2013 1:31 am

Re: Attachments No Longer Displaying Correctly

Post by Cory Ander »

I still have this problem and would still appreciate help resolving it (please bear in mind that I am not an expert!).
EA117 wrote:So the questions are "does the database still indicate that a thumbnail should exist?" ("thumbnail" is "1" in the database for this file ID.)
Yes
EA117 wrote:And does the corresponding "thumb_" file exist in the /files directory, in addition to the actual attachment file? And if the "thumb_" file does exist as expected
No
EA117 wrote:Did you possibly have an extension installed which provided some kind of enhancement attachment or thumbnail functionality?
Yes

Please note that all new attachments are uploading and displaying correctly. The problem only applies to attachments which were present when the Filezilla backup and restore process was performed.

Accessing "phpbb_attachments" in my database, using phpMyAdmin, I notice that the setting in the "thumbnail" column, for images that are no longer displaying correctly, is set to "1". Setting this to "0" enables the thumbnails to be displayed in the thread again but they can no longer be enlarged Unless they are opened in a new tab). Is this the source of the problem? If so, I would appreciate help on the following:

a) how do I quickly change the settings, for all thumbnails, in the "thumbnails" column, to "0" (there are too many attachments to do it manually)?
b) how to enable the thumbnails to be enlarged again?
c) what would have caused this problem (i.e. when I used Filezilla to backup and restore my database - so that I can avoid the problem in the future)?

Thanks for your help (in anticipation!)....

PS: I also notice that the "thumbnail" setting, for some images (and new attachments) which are displaying correctly, is "1"! Changing it from "1" to "0" seems to prevent the image from being enlarged? Confused! :?
Last edited by Cory Ander on Wed Feb 05, 2020 2:49 am, edited 1 time in total.

User avatar
EA117
Registered User
Posts: 1295
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Attachments No Longer Displaying Correctly

Post by EA117 »

Cory Ander wrote:
Wed Feb 05, 2020 1:27 am
Accessing "phpbb_attachments" in my database, using phpMyAdmin, I notice that the setting in the "thumbnail" column, for images that are no longer displaying correctly, is set to "1". Setting this to "0" enables the thumbnails to be displayed in the thread again but they can no longer be enlarged Unless they are opened in a new tab). Is this the source of the problem? If so, I would appreciate help on the following:
...
PS: I also notice that the "thumbnail" setting, for some images (and new attachments) which are displaying correctly, is "1"! Changing it from "1" to "0" seems to prevent the image from being enlarged?
I don't believe the behavior you're describing there is "the problem" or "the solution", but simply further evidence that suggests "there are supposed to be thumbnail files for these images, but in the restored directory those thumbnail files are either missing or corrupt."

But any recommendation I would write right now is still the same as what I wrote in the November 18 reply. So perhaps either describe what you found when following that recommendation, or describe what's unclear or wasn't possible to follow about those steps.

Cory Ander
Registered User
Posts: 76
Joined: Thu Mar 21, 2013 1:31 am

Re: Attachments No Longer Displaying Correctly

Post by Cory Ander »

Sorry, I was just including that in my reply above....

User avatar
EA117
Registered User
Posts: 1295
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Attachments No Longer Displaying Correctly

Post by EA117 »

Since you indicated the corresponding "thumb_" file doesn't exist for an attachment which does have "thumbnail" set to "1" in the database, the next logical question is "does this corresponding thumb_ file exist in your backup?" i.e. Is the current issue because these "thumb_"-prefixed files simply were not restored / were skipped for some reason when the files folder was restored previously?

Otherwise, if the "thumb_" files are not in the backup either, then you're probably in a scenario where the "regenerate thumbnails" script that warmweer was referring to will be the next best option.

But you also said "yes, I had an extension installed which provided additional attachment functionality." So maybe we need to know what that extension is. Just in case it figures in to the explanation of why the "thumb_" files are missing. Do you have that extension installed still now too, in the current restored board?

User avatar
warmweer
Jr. Extension Validator
Posts: 3903
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Attachments No Longer Displaying Correctly

Post by warmweer »

Apologies if this has been covered before.

Reading that Filezilla was used to restore/transfer the images.
Was the transfer done in binary mode? If not, that would explain unreadable images and re-uploading them in binary mode would solve that.

Added:
OK, first post mentions The "treat files without extension as ASCII file" was unchecked for both backup and restore. so that shouldn't be the issue.
We should embrace problems, without which there wouldn't be any solutions.

Post Reply

Return to “[3.2.x] Support Forum”