News:

Wondering if this will always be free?  See why free is better.

Main Menu

404 - Attachment Not Found

Started by FragaCampos, February 12, 2013, 01:39:27 AM

Previous topic - Next topic

FragaCampos

Hi there.

I've found several people with the same problem after upgrading from SFM 1.x to SMF 2.x but I haven't found a satisfactory answer to this "serious" problem.
I have 7000 attachments and when I upgraded, in localhost and on live forum, almost 3 thousand disapppeared.
I don't have a clue why, but al atttachments were working and they are still in my attachments directory.
The attachments' table in the database is also intact.

Any lights on this?
Thanks.

kat

Got a link to a post where this is happening, so we can have a look at it? (Remember it'll need to be open for guest viewing)

FragaCampos

I'm analysing my old vs new database (attachment table) and I see something weird. All the old attachments don't have a file_hash, while the attachments that are ok do have a file_hash.
But I wonder why this was not an issue in SMF 1.1.18...

Any clue about this?
I really didn't want to upload 3000 attachments again :(

FragaCampos

My forum is in maintenance mode, but i can explain exactly what you want to see if you wish.

Quote from: K@ on February 12, 2013, 11:17:43 AM
Got a link to a post where this is happening, so we can have a look at it? (Remember it'll need to be open for guest viewing)

FragaCampos

I detected a difference between the old and new attachments. Clearly a codification problem  :-\



old hash ->

6553_Oea_Coaao_Eiaeai_Oaeiwau_199u_EIC_oao77ab11ea32cba108db8292a2a13f5a2b
6552_Oea_Coaao_Ciiaai_Waoieic_Oweiaia_2007_AODH_oaoc8aa15609d48e322240eeac091c31c56
6551_Oea_Coaao_Aoaadha_Oea_AEieceo_oi_AEoaaaii_2001_EIC_oaob48deeac0802547da7369a99a9d71307


new hash ->
6554_1bf7f29acc47fccdd9311d5d2b27577b7706a718
6555_029e9bbe42fdba0bd7e9684aa510df6b02bf3c07
6556_ff01e92a67b8b877fa3ac592822e2b9fd83e5b5e

Arantor

Did you change from ISO to UTF-8 at any point?

kat

That's a thought, innit?

I wondered if PrettyURLs might be involved, somewhere, too.

All I was going to try, to start with, was the ol' "Inspect element" thing.

Check a URL or two, that kinda thing.

Generally, a 404 means that the page simply doesn't exist.

A small hunchette... The attachments directory and the actual files, themselves... Are they all read-enabled?

Could it be a CHOWN permissions thing?

FragaCampos

Yes, when I upgraded I used "Convert HTML-entities to UTF-8 characters" in the admin panel. Could it be because of that?

Quote from: Arantor on February 12, 2013, 11:43:06 AM
Did you change from ISO to UTF-8 at any point?



My attachments directory is 0755 and all the files inside are 0644.
I don't have prettyurls or SimpleSEF installed...

Quote from: K@ on February 12, 2013, 11:47:37 AM
That's a thought, innit?

I wondered if PrettyURLs might be involved, somewhere, too.

All I was going to try, to start with, was the ol' "Inspect element" thing.

Check a URL or two, that kinda thing.

Generally, a 404 means that the page simply doesn't exist.

A small hunchette... The attachments directory and the actual files, themselves... Are they all read-enabled?

Could it be a CHOWN permissions thing?

kat

What you've quoted is CHMOD, not CHOWN.

Your host will have to confirm that you have full CHOWN ownership of everything.

FragaCampos

Well, but there's no reason for being a problem with CHOWN, since I did the upgrade in the same server, and the attachments folder didn't change, because I didn't touch it. That folder was doing just fine UNTIL I did the upgrade.

kat

* K@ wanders-off, scratching his head, to try and figure this out...0

FragaCampos

Ok, I've installed the forum in my pc like it was before the upgrade, and all attachments are correct and working fine.
I'm going to upgrade on localhost and see if I get the same results, this time without activating the "Convert HTML-entities to UTF-8 characters" afterwords.

Arantor

And don't use FileZilla to transfer attachments ;)

FragaCampos

Ok, tested and proved.

After the upgrade I went directly to the attachments zone, and the problem is there.
Like I said here, old attachments don't work. :(

PS: I use Total Commander, although I think that's not the problem...

kat

I use that, too. It's perfectly OK, for this kinda stuff.

This sure is an odd one.

ziycon

I've just come across this issue on one of my live forums using 2.0.1, going to digg deeper and see what I can come up with.

ziycon

I've had a look into this more. All the files in the attachment directory are named 'ID_Hash' and the references in the attachment table match the Id and the file hash. Can't seem to see why it's not working all of a sudden. :S

FragaCampos

Well, my job is not finished yet... I'm still uploading like 20 attachments per day to correct this. :(

kat


ziycon

I've come up with nothing, some attachments work but most don't, can't see anything causing it or anything common between failing attachments.

kat

This sure is weird, innit?

If it was Filezilla's "Transfer type" feature, I could understand it. But, we've been through that, haven't we?

One thing I remember, from AGES back, is that Total Commander went through a phase of subtly renaming things, when I uploaded them, by changing the case of the filename. I managed to figure-out why. But, it's so long ago that I can't remember what I did, to correct that.

It's not that, is it?

ziycon

I haven't used an ftp application at all, these are files that were attached through SMF and left in the attachments directory.

kat

Ah, right. So, just doing the upgrade toasted them?

Now that IS weird.

Any connection with the attachment filetypes?

Were they all jpg, or something else, perhaps?

ziycon

All different file types, no similarities across them all.

kat

I'm out of ideas. :(

I'll flag it in the "Helpers" board. :)

emanuele

There is or have been a bug somewhere at some point during the updates/upgrades, don't know.

It's not the first time that I see the attachments hashes messed up, last time I tried to fix with a script that was supposed to re-hash the files, but I think I had problems and due to my lag spiros completed the re-upload before I was able to provide a working script.

Try the attached file, it *may* work, no warranties.
Try it locally of course first and take a full backup because it changes both the database and the attachments directory.

In order to use it you have to download one of the SMF converters (for example this), extract it and upload the file convert.php along with the file attached here to your forum directory.
Then from your browser go to http://localhost/forum/convert.php or the appropriate host and directory. Let the converter run. See if it fixed anything.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

kat


Advertisement: