News:

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

Main Menu

Database Error

Started by fox0r, August 04, 2009, 10:46:39 PM

Previous topic - Next topic

fox0r

I upgraded from 2.0 beta.. 3 I think it was, to 2.0 RC1.2.  Everything seems to be working fine but topic viewing.

To upgrade i just wiped my forum folder and installed the new version -- it was all nasty from botched mods, so i figured a clean install would do it good.

I installed, and it went fine, I just put in my database details, it connected and worked fine.

The error I got when trying to view a topic said something about running the upgrade.php to update the database, and so I did.

Now I'm getting this:

Unknown column 'a.file_hash' in 'field list'
File: /usr/home2/jpohlman/public_html/htss/Sources/Display.php
Line: 994


How do I fix it?

fox0r

Okay, I fixed this, then I logged out to test a mod, and now I can't log back in.

Database Error
Please try again. If you come back to this error screen, report the error to an administrator.

fox0r

I ran the updateDatabase.php and if it did anything I can't tell.

I really need to get my forum running, if someone has some ideas that would be great.

Norv

updateDatabase.php should have helped get rid of the "unknown column 'a.file_hash' error", as it updates your database structure to a version 1.1.9+, where this column exists.

About the error you are receiving now, can you please make sure you copy here all the error message or make a screenshot?
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

fox0r

I try to log in, and that is seriously all it says.  It doesn't give any more information or anything like the last one did.  Even if I try to log in with an account name/password that doesn't exist it gives the same thing.

The URL it spews is http://www.bqinternet.com/~jpohlman/htss/index.php?action=login2

Norv

You might try to make another account, then make it admin using the advices here:
I accidentally deleted my admin account, what do I do?

Then at least you can have access to see what is wrong, see a complete error log that hopefully will help understand what is the problem with the other account. (it seems one member is logged in right now, so perhaps login still works on some accounts)
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

fox0r

I have another admin user, but he isn't around.

Any time I try to log in with anything it gives me that message, though, so if he's timed out/logged out/etc we're in trouble. The board is set up for approval for new members.

The admin panel is different than what I'm used to, do you have the step-by-step to get into where the logs are?  I can email him and have him see if he can get into it and paste me what it says.

Norv

I was referring to you registering another account yourself (temporary), log in on forum, then tweak permissions in the database as explained in the topic linked above, to have admin access. Thus you will be able to access your forum and see for yourself what the issues may be.
The error log is in the Admin panel, Maintenance > Logs.
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

fox0r

I don't have access to PHPMyAdmin to run SQL queries :(  I don't think shell is set up for the user, either.  It's my buddy's forum that I admin and help him with, and he doesn't even know what SQL is I don't think -- He's not very web savvy, let's leave it at that.

I'll have to email him and see if he can get me the error log.

But, if I can't log in with any string of user names/passwords, I don't see what making a new account will do?

Norv

You mean you checked other accounts?

As I said, I just saw a member logged in, when I visited the forum, so I suppose some accounts can still log in.
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

fox0r

I think the ones that are logged in are the ones who are still cookied and didn't actually log out.  After I reinstalled/ugraded I was still logged in.  As I mentioned before, I logged out to check a mod (It was a hide content from guests tag) and wasn't able to get back in.

I emailed the other admin, hopefully he'll get me the log stuff soon so I can post it.

Norv

Normally a user is only shown as logged in if active during the last 15 minutes, but yes, obviously I don't know since when they keep being logged in. Either way, please feel free to post any updates that may help understanding the issue.
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

Norv

Update: I just visited the forum again and cannot log in with the test account I had created.
Please try this: backup your file ./Sources/LogInOut.php, and replace it with a fresh copy with the installation package of your version of SMF. Then, try to log in again.
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

fox0r

Here is the log bits he sent me:

   Apply Filter: Only show the error messages of this member Guest     Reverse chronological order of list August 04, 2009, 10:55:07 pm
Apply Filter: Only show the error messages of this IP address 99.20.196.122      Apply Filter: Only show the error messages of this session b67bbd7c020b82c7054f5a3fd17e1114
     Apply Filter: Only show the errors of this type Type of error: Database
Apply Filter: Only show the error messages of this URL http://www.bqinternet.com/~jpohlman/htss/index.php?action=login2
Apply Filter: Only show the errors with the same message
Database Error: Unknown column 'passwd_flood' in 'field list'
Apply Filter: Only show the errors from this file
File: /usr/home2/jpohlman/public_html/htss/Sources/LogInOut.php
Line: 226
   
Apply Filter: Only show the error messages of this member Guest    Reverse chronological order of list August 04, 2009, 10:54:59 pm
Apply Filter: Only show the error messages of this IP address 99.20.196.122      Apply Filter: Only show the error messages of this session b67bbd7c020b82c7054f5a3fd17e1114
     Apply Filter: Only show the errors of this type Type of error: Database
Apply Filter: Only show the error messages of this URL http://www.bqinternet.com/~jpohlman/htss/index.php?action=login2
Apply Filter: Only show the errors with the same message
Database Error: Unknown column 'passwd_flood' in 'field list'
Apply Filter: Only show the errors from this file
File: /usr/home2/jpohlman/public_html/htss/Sources/LogInOut.php
Line: 226
   
Apply Filter: Only show the error messages of this member Guest    Reverse chronological order of list August 04, 2009, 10:53:28 pm
Apply Filter: Only show the error messages of this IP address 99.20.196.122      Apply Filter: Only show the error messages of this session b67bbd7c020b82c7054f5a3fd17e1114
     Apply Filter: Only show the errors of this type Type of error: Database
Apply Filter: Only show the error messages of this URL http://www.bqinternet.com/~jpohlman/htss/index.php?action=login2
Apply Filter: Only show the errors with the same message
Database Error: Unknown column 'passwd_flood' in 'field list'
Apply Filter: Only show the errors from this file
File: /usr/home2/jpohlman/public_html/htss/Sources/LogInOut.php
Line: 226


I'll try what you suggested and report back.

Edit:

I replaced the file, and it still give me the same error.

babjusi

Did you get any error during the upgrade? Did you make a backup of your db prior to the upgrade?

fox0r

No errors during the upgrade, and I have a backup of the DB.

babjusi

Can you try to run this query at the phpmyadmin?

ALTER TABLE {$db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default '';


Where {$db_prefix} equals your db prefix.

Norv

It seems your forum database misses a field, 'passwd_flood'.

In order to add it, you should try the query babjusi advised. Alternatively, if you don't have access to phpMyAdmin, but have access to FTP, you can make a .php file (name it "addcolumn.php") with this code:

<?php
include('SSI.php');

global 
$db_prefix;
$request db_query("ALTER TABLE {$db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default ' ';"
,__FILE____LINE__);

?>


and upload it to your forum folder, then run it from the browser.
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

fox0r

My table is just the default smf_ prefix.

It reported back this error:

Fatal error: Call to undefined function: db_query() in /usr/home2/jpohlman/public_html/htss/addcolumn.php on line 5

I am using the code as pasted above, save for editing the smf_ in.

Arantor

db_query doesn't work because this is a 2.0 forum.

Instead try:

<?php
include('SSI.php');

$request $smcFunc['db_query'](''"ALTER TABLE {db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default ' '"
);

?>


Advertisement: