News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

a.file_hash error

Started by Afro, May 21, 2009, 08:24:24 AM

Previous topic - Next topic

Afro

i found this error after updating to 1.1.9 v.

it wont let me see the post pages.
i believe it need a new topic for references some peeps will still get this.

"Unknown column 'a.file_hash' in 'field list'
File: /home/afrowall/public_html/Sources/Display.php
Line: 902

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.9, while your database is at version 1.1.6. The above error might possibly go away if you execute the latest version of upgrade.php."

how do i fix that?

Afro

I found out that this error goes away when i disabled attachments on the admin cpanel...

Whats all that for?

karlbenson

It appears that the file_hash column in the attachments table was not created on install of the 1.1.9 as it should have been.

I'd suggest getting a copy of the UpdateDatabase.php out of the patch, and running it standalone in your browser.
(put it at the same location as SSI.php, and then run it once, then delete it)

Afro

Thanks, but i cant se the UpdateDatabase.php file on tyhe source folder of the patch. Where can i get it?

karlbenson

Inside the patch itself in the Packages/ folder.

Afro

I checked there and cant see it..I see only three files there and a backup folder..

Owdy

Thatnks, that worked for me! File attached
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Afro

Thanks , i found the file on the patch and ran it. Its fixed now...

charlottezweb

I just saw this too.  I guess the "modified" version upgrades don't include the updateDatabase.php file with them so I didn't realize a db upgrade was needed until now.

Should those zips all contain that file and not just the first one?

http://www.simplemachines.org/community/index.php?topic=311899.msg2069703#msg2069703

aly22

Sorry to jump on someone else's thread but have similar issue. I got upgradeDatabase.php and ran but get this:

Notice: Undefined index: lastActive in /home/MYSITE/public_html/forum/Sources/Load.php(1730) : eval()'d code on line 104

Notice: Undefined index: hotTopicPosts in /home/MYSITE/public_html/forum/Sources/Load.php(1730) : eval()'d code on line 230

Notice: Undefined index: hotTopicVeryPosts in /home/MYSITE/public_html/forum/Sources/Load.php(1730) : eval()'d code on line 231

Notice: Undefined index: smfVersion in /home/MYSITE/public_html/forum/Sources/Load.php(1730) : eval()'d code on line 325

Notice: Undefined index: news in /home/MYSITE/public_html/forum/Sources/Subs.php on line 3024

Notice: Undefined index: unapprovedMembers in /home/MYSITE/public_html/forum/Sources/Subs.php on line 3052

Notice: Undefined index: time_offset in /home/MYSITE/public_html/forum/Sources/Subs.php on line 832

N3RVE

aly22, Start your own support thread. Also post accurate errors by disabling eval().
See: How to Enable / Disable eval()

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

cafecommk

Quote from: regularexpression on May 21, 2009, 10:22:59 AM
It appears that the file_hash column in the attachments table was not created on install of the 1.1.9 as it should have been.

I'd suggest getting a copy of the UpdateDatabase.php out of the patch, and running it standalone in your browser.
(put it at the same location as SSI.php, and then run it once, then delete it)
THanks
This solved my problem

4thwave

Okay, I tried this.  I uploaded the updatedatabase.php file.  I run it in the browser.  I get a blank screen, but I still get the error message after I delete the updatedatabase.php file.  What am I doing wrong?

4thwave


Norv

It might be a different issue. Please consider to open a different topic, this one is considered solved and it is less likely that you will receive proper help in that case, as far as I can say.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

4thwave

I have the exact sample problem, with the same symptoms, and everything.  If I disable the attachments in admin, the forum works just fine.  Which is the current state of the forum, so that people can still use it.

Norv

#16
Really sorry if I didn't make myself clear. Please take a look at the thread (and first post) icon: it means the thread is marked as solved. As long as that is the case, a number of people taking care of support might consider reading and solving other topics first. Therefore, it's less likely a good idea will come along.
Moreover, the problem in this thread is that under a set of circumstances, the column file_hash was not created during upgrade, though it is necessary. upgradeDatabase.php creates it. If it doesn't, there must be another problem that we didn't figure out yet, which prevents it. This other problem may be as simple as us overlooking something obvious, therefore it might not sound like a big deal. I fully understand that. But we don't know till we solve it. And as said, in order to solve it, it would be beneficial to have as much attention as possible.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

mitz

How do you run upgradedatabase.php  I have a control panel at hostgator and can see the file in the right place but how do I run it?

Norv

Please write its exact address in the browser, like http//{your_forum_address}/updateDatabase.php. Note the capital "D" as well.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sandmannd

I ran the file and get "Fatal error: Call to undefined function: tp_loadtheme() in /homepages/22/d258088114/htdocs/forum/Sources/Load.php on line 1172" in the browser.

Norv

It seems you had Tiny Portal installed, and incompletely uninstalled it.
In case the mod is supposed to be uninstalled indeed, please check the manual instructions for the mod, specially those concerning Load.php, and see if you can undo them.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sandmannd

Nope, this didn't happen because I uninstalled Tiny Portal, I still use it. This started after I upgreated to version 1.1.10

Norv

Then simply Tiny Portal is not properly installed (or not anymore, by the looks of it, for some reason).
How did you do the upgrade to 1.1.10?

Also, please consider to post in the TP support thread (or their support site), as they may be able to help more easily.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Meru

I tried the updateDatabase.php, but it was blank and wouldn't fix the issue. So I took a peek at the file and found the SQL code to fix it. It goes as follows:

ALTER IGNORE TABLE  smf_attachments
ADD COLUMN file_hash varchar(40) NOT NULL default ''

So I went to my server's phpMyAdmin, clicked the SQL tab, entered that line, and viola! it works again. All my avatars are back.

I don't know if there are any odd side effects to this in the long term, but it's what the updateDatabase.php does as far as I can tell. Also, my database prefix is smf_ so that's why it says smf_attachments, change accordingly.

Hope this helps someone else out!

Norv

That's exactly what it does, yes, so surely there is no problem.

updateDatabase.php actually, was supposed to not say a thing (yes it's not user-friendly). But it was supposed to be run as an internal part of the update patch, so well, it wasn't supposed to display messages itself.

Thank you for sharing!
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

N3RVE

Quote from: Norv on September 10, 2009, 12:07:46 AM
updateDatabase.php actually, was supposed to not say a thing (yes it's not user-friendly). But it was supposed to be run as an internal part of the update patch, so well, it wasn't supposed to display messages itself.

Perhaps, we should change the code so it returns a message? ;)

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

Norv

To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

N3RVE

Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

timi


sit2006

Today I update and found this problem

Advertisement: