Advertisement:

Author Topic: Database error; SMF at 2.0.14 database at 2.0.11  (Read 587 times)

Offline +Nachi+

  • Semi-Newbie
  • *
  • Posts: 19
Database error; SMF at 2.0.14 database at 2.0.11
« on: April 12, 2019, 06:55:02 PM »
I'm trying to post new topics and launch Repair All Boards and Topics but I get the following error:

Field 'spam' doesn't have a default value
File: /home/user/public_html/Sources/RepairBoards.php
Line: 1486

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

I don't know where and how to exceed upgrade.php , please help.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #1 on: April 12, 2019, 08:57:26 PM »
The note is just a default message that is generated when the version stored in the database doesn't match the one that your forum's files are currently on. You can ignore it. There are no database changes between 2.0.11 and 2.0.14.

You might have installed a mod that added that column in some table in the database. It's probably in the messages table, but I can't be sure. You can investigate in which table the "spam" column is added with phpMyAdmin and add a default value to it ;).

To fix this, you need to go to your database - in phpMyAdmin, you'll usually find this in your hosting control panel (outside of SMF) - and find the table that is usually called smf_messages. It might be called something slightly different in your case, though.

Once you find that table, go to the Structure tab, which should show you all the columns of that table, and in that list should be an entry called "description". If you edit this column, and tick the box labelled 'null' and save, it should work properly again.

This is just an example, it's for a different column in (maybe) a different table, but the basic principle is still the same ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline +Nachi+

  • Semi-Newbie
  • *
  • Posts: 19
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #2 on: April 13, 2019, 02:48:52 AM »
I don't have description entry in messages table.
I looked at the backup version as well and it wasn't there either.
For full disclosure, I had to build the whole site from back up and it seem I managed restore the page when I couldn't add new topics. I got error similar to:
Field 'spam' doesn't have a default value

And it directed me to Subs-posts.php
Once I looked at it the file was empty so I've launched upgrades through smf admin section (from 2.0.11 to 2.0.14).
Now it actually points to line 1855 which is a simple ");" and the Note is added as well.


I looked at topic table as well (since the subs-post line called in error is connected to db_insert/new topic creation) but there was not "description" there either.
Any other places you can suggest where I can look, or anything I should copy here to make things more clear?

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,430
  • Gender: Male
    • Kindred-999 on GitHub
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #3 on: April 13, 2019, 07:56:20 AM »
The issue is in your database. No file changes address going to fix it... you have to fix the database.

That column is from a mod...  so, what mods do you have installed,  or did you used to have installed?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 298
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #4 on: April 13, 2019, 11:26:21 AM »
Check the smf_boards, smf_messages and smf_topics tables if they contain a spam field. That is not part of the default smf so it must have been added by a mod that you are not using it anymore. The best thing would be to remove that field altogether and that should fix the error.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,139
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #5 on: April 13, 2019, 12:20:22 PM »
That is not part of the default smf so it must have been added by a mod that you are not using it anymore. The best thing would be to remove that field altogether and that should fix the error.

how do you know the op is not using the mod any longer? the op has not listed what mods are installed or what of those are actually being used. this error does not mean the column is not being used.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,399
    • StoryBB/StoryBB on GitHub
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #6 on: April 13, 2019, 12:25:09 PM »
Actually, I would argue it does: if the mod were still installed, it would likely be inserting something...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline +Nachi+

  • Semi-Newbie
  • *
  • Posts: 19
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #7 on: April 14, 2019, 08:23:23 AM »
Ok, so I looked through suggested tables and found "spam" in topics.
Once dropped the topic was posted but I also got another database error:
Unknown column 'spam' in 'field list'
File: /home/hbns/public_html/Sources/Subs-Akismet.php
Line: 109

Mods are as in attached file. I don't want to remove to many spam related modes, back in the days I had absolutely horrible flood of them and what I have atm finally toned it down.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #8 on: April 14, 2019, 09:24:01 AM »
Well, you seem to have that same column in another table in the database.

And there are other ways to stop bots (if those were the main problem). I use "a10's method" for user registration, might be worth checking it out ;).

http://www.simplemachines.org/community/index.php?topic=531660.msg3776163#msg3776163
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,430
  • Gender: Male
    • Kindred-999 on GitHub
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #9 on: April 14, 2019, 09:28:01 AM »
You do realize that stop forum spam and stop spammer do exactly the same thing?

And yes... as suspected, by deleting the column, you messed things up further.
You should put the column back and give it a default value
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline +Nachi+

  • Semi-Newbie
  • *
  • Posts: 19
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #10 on: April 14, 2019, 03:05:09 PM »
Well akismet seems to be the problem. I reinstalled, the problem recurred.
Giving the spam column (in topics table) null or value 0 the problem seems to be solved.
I'm not familiar with what setting the default value actually does so if you have any recommendations please let me know. Otherwise I suppose I deem this solved for now.

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,430
  • Gender: Male
    • Kindred-999 on GitHub
Re: Database error; SMF at 2.0.14 database at 2.0.11
« Reply #11 on: April 14, 2019, 11:17:21 PM »
yes. that's why I told you to give the column a default value.

As for Akismet...  that one is know to cause a while bunch of issues and is basically pointless unless you allow guests to post. If you require users to register in order to post, then just stop the spammers before they complete registration.  I have not had a single spammer successfully register in 3 years now on one site.... and we only had 2 real, person spammers in that same three years on another site.  Not a single bot, anywhere.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.