Old deleted attachments reappear when same name is reused for new attachments

Started by pascal_sweden, July 17, 2020, 09:58:13 AM

Previous topic - Next topic

pascal_sweden

Create a forum post with some attachments.

Edit the forum post.

Deselect some attachments to remove these attachments.

Save the forum post.

Edit the forum post.

Add some attachments with the same name as the name that you used before for the older attachments.

Save the forum post.

Sometimes the old attachments reappear. How is this possible?

Attachments that I used are pictures.

shadav

might try

in your admin under forum go to attachments and avatars
remove the old attachment if it's listed there
go to file maintenance
run the Attachment Integrity Check

now in your admin under Maintenance go to Forum Maintenance
Run Find and repair any errors
Run Empty the file cache

refresh your page (ctrl+f5)
see if that has helped

pascal_sweden

I am not reporting this issue as an Administrator.

BTW, this is not manageable by an Administrator. End users could frequently delete attachments in their forum post and afterwards add new attachments with the same name.

It's a bug in the software. No discussion.

I am reporting this issue as an End user.

It should be perfectly possible to delete an attachment and afterwards add a new attachment which happens to have the same name as the one you used before.

This happens quite frequently actually.

Suppose you make a forum post, and add a screenshot. Some screen grabbers use a default name for the screen capture.


It's very easy to test this.

Create 8 PNG pictures. Each with a unique content. Maybe just use big numbers in the picture.

Picture1.png: big number 1 in the picture.
Picture2.png: big number 2 in the picture.
...
Picture8.png: big number 8 in the picture.


Upload the first 4 pictures on a forum post.

Save the forum post.

Watch the forum post.

Edit the forum post.

Remove these 4 pictures from the forum post.

Save the forum post.

View the forum post.

Edit the forum post.

Before submitting any attachments, make sure that you rename the pictures in Windows to have overlap with the previous names:

Rename Picture5.png to Picture1.png
Rename Picture6.png to Picture2.png
Rename Picture7.png to Picture3.png
Rename Picture8.png to Picture4.png

Now upload the second set of pictures to the forum post.

Save the forum post.

View the forum post.

As you will see, you will not get the new set of 4 pictures, but the old set will still be present.

Arantor

Bet you can't reproduce it here.

How old is this forum? If it's old enough, it might be from before filename hashing as introduced which would certainly have this behaviour.

pascal_sweden

My conclusion is that attachments will always stay on the server even if you have deleted them.
Although they are deleted from the forum post, they still remain on the document folder associated with the forum post.
This is a very bad implementation.

Deleting an attachment from a forum post, should really delete it, even from the document folder.

It should be perfectly possible to re-use the same name for an attachment. The forum system should keep an internal naming scheme if it can not deal with the same name as input.

The forum in particular on which I have seen this issue just a few days ago:
www (dot) eevblog (dot) com (slash) forum (slash) testgear (slash)

Version information from the EEVBlog forum:

    SMF 2.0.15 | SMF © 2017, Simple Machines
    Simple Audio Video Embedder
    SMFAds for Free Forums
    XHTML RSS MobileWAP2

shadav

2.0.15, try updating to 2.0.17

but my guess also is the browsers cache.....

pascal_sweden

It has nothing to do with the browser cache AFAIK.
But I can try it.

Can you confirm that the document folder is emptied if an attachment is deleted?

What happens if one tries to upload several attachments at once with the same name?

Arantor

Quote from: pascal_sweden on July 20, 2020, 01:00:16 PM
My conclusion is that attachments will always stay on the server even if you have deleted them.
Although they are deleted from the forum post, they still remain on the document folder associated with the forum post.
This is a very bad implementation.

Deleting an attachment from a forum post, should really delete it, even from the document folder.

It should be perfectly possible to re-use the same name for an attachment. The forum system should keep an internal naming scheme if it can not deal with the same name as input.

The forum in particular on which I have seen this issue just a few days ago:
www (dot) eevblog (dot) com (slash) forum (slash) testgear (slash)

Version information from the EEVBlog forum:

    SMF 2.0.15 | SMF © 2017, Simple Machines
    Simple Audio Video Embedder
    SMFAds for Free Forums
    XHTML RSS MobileWAP2

No, that's not how it works. Historically (like 15 years ago) it was an option to just use the file's own name. If your forum is originally old enough this behaviour can persist with old attachments and potentially even keep this behaviour.

So again before making guesses, how old is the forum? I do not care whether this is 2.0.15 or 2.0.17 but whether this forum could be old enough to have been around for 2.0 RC1 or 1.1.8

(Note, I am formerly part of the SMF dev team. I've literally been the one who wrote parts of this code. On a more recent forum, or one that was never configured a certain way it absolutely deletes attachments, hence the invitation to try to reproduce it here.)

pascal_sweden

I am only an end user and not the admin.

The forum on which I have seen this problem a few days ago:
www (dot) eevblog (dot) com (slash) forum (slash) testgear (slash)

I just tried to reproduce this, using my own test files (Picture1.png, ..., Picture8.png). But I could not reproduce anymore.

Maybe I was unlucky to use a filename that already existed on the document server.
But I don´t remember the filename that I used.

However, I can guarantee you that some old attachments reappeared out of the blue.

So it might be good to double check your implementation of the attachments functionality.

KittyGalore

Quote from: pascal_sweden on July 20, 2020, 01:32:43 PM
I am only an end user and not the admin.

The forum on which I have seen this problem a few days ago:
www (dot) eevblog (dot) com (slash) forum (slash) testgear (slash)

I just tried to reproduce this, using my own test files (Picture1.png, ..., Picture8.png). But I could not reproduce anymore.

Maybe I was unlucky to use a filename that already existed on the document server.
But I don´t remember the filename that I used.

However, I can guarantee you that some old attachments reappeared out of the blue.
Well the fact that you mentioned you are not the admin then what you are saying can't be fixed without access to the admin panel or server account. If the attachments are reappearing then it's most likely the folder permissions or something is set wrong and only access to the error log and so on can resolve this.
SMF Curve 2.0x

KittyGalore

I will do a test on my test forum and see if what you mentioned can be replicated.
SMF Curve 2.0x

pascal_sweden

Try this with more than one attachment.

And try to delete only a few attachments. Don't delete all of them.

E.g. upload 4 attachments. Attachment 1, Attachment 2, Attachment 3, Attachment 4.

Delete an attachment in between, e.g. Attachment 3.

Upload a new attachment afterwards with the same name.

KittyGalore

Quote from: pascal_sweden on July 20, 2020, 01:48:39 PM
Try this with more than one attachment.

And try to delete only a few attachments. Don't delete all of them.

E.g. upload 4 attachments. Attachment 1, Attachment 2, Attachment 3, Attachment 4.

Delete an attachment in between, e.g. Attachment 3.

Upload a new attachment afterwards with the same name.
So i started off with my attachments folder empty with only 2 default files. So i done 3 pics different but with the same name i done what you done and the old pics didn't reappear. After finishing in the admin panel 3 files show up. However in the attachment folder on the server i have 7 files one with thumb on the end of it.
SMF Curve 2.0x

KittyGalore

If you want register here on my test forum and do what you want to see if what you are doing on the forum you are doing is the same or not.

https://www.bigbrothertvbackup.com/Testforum/index.php
SMF Curve 2.0x

Arantor

Quote from: pascal_sweden on July 20, 2020, 01:48:39 PM
Try this with more than one attachment.

And try to delete only a few attachments. Don't delete all of them.

E.g. upload 4 attachments. Attachment 1, Attachment 2, Attachment 3, Attachment 4.

Delete an attachment in between, e.g. Attachment 3.

Upload a new attachment afterwards with the same name.

Did you try doing it *here*? (as requested now for the third time)


QuoteHowever in the attachment folder on the server i have 7 files one with thumb on the end of it.

This probably includes your avatars.

pascal_sweden

I am not going to spend more time in reproducing it.

Just wanted to report this here, to see if it is a know issue or not.

If I would be an admin of a forum, then I might spend more time in reproducing it, but I am just an end user.

Appreciate if you understand my position.

Arantor

It is a known problem under very specific circumstances, but none that you have been able to verify and honestly... please ask the admin of that forum to come here.

I'm not being funny but all this conversation has done has just wasted everyone's time. You don't want to reproduce it on a known test site, and you can't do anything to fix it.

KittyGalore

Quote from: Arantor on July 20, 2020, 03:44:01 PM
It is a known problem under very specific circumstances, but none that you have been able to verify and honestly... please ask the admin of that forum to come here.

I'm not being funny but all this conversation has done has just wasted everyone's time. You don't want to reproduce it on a known test site, and you can't do anything to fix it.
Well like you said he has wasted our time i spent 10 minutes earlier trying to do what he said and now he won't test it here or on my test site. Won't be offering to help again if this is the thanks we get.
SMF Curve 2.0x

Kindred

Also tested - unable to reproduce on any test installation of a modern version and I'm unwilling to waste time installing an ancient version, loading attachments and then updating to see if it can be done.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Shambles

Quote from: Kindred
Also tested - unable to reproduce on any test installation of a modern version ...

Ditto

Altzone

Hi
I am the owner of the EEVblog forum in question.
Yes we are having an issue with this, and it's only started in recent months, so I would not rule out the result of some plugin or other action causing something to get messed up.
The forum started in 2009, but I don't recall what version.
The site IT guy is looking into, and he's well versed in SMF code and how it works. Hasn't found the cause yet though. I'm pointed him to this thread.
Thanks.

Arantor

I'd be specifically interested if your smf_settings table contains a value called attachmentEncryptFilenames or not. The thinking is that it either doesn't contain it, or more likely, it does with a value of 0.

Advertisement: