News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Database error; SMF at 2.0.14 database at 2.0.11

Started by +Nachi+, April 12, 2019, 06:55:02 PM

Previous topic - Next topic

+Nachi+

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.

GigaWatt

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 ;).

Quote from: Arantor on March 12, 2019, 02:52:31 PM
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?"..."

+Nachi+

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?

Kindred

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?
Сл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."

Doug Heffernan

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.

Illori

Quote from: doug_ips on April 13, 2019, 11:26:21 AM
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.

Arantor

Actually, I would argue it does: if the mod were still installed, it would likely be inserting something...

+Nachi+

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.

GigaWatt

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?"..."

Kindred

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
Сл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."

+Nachi+

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.

Kindred

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.
Сл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."

Advertisement: