News:

Join the Facebook Fan Page.

Main Menu

Database error

Started by baldur2630, August 03, 2022, 05:32:25 AM

Previous topic - Next topic

baldur2630

I'm getting this message if I try to create a new board for a member.

Field 'passwd' doesn't have a default value
File: /var/www/writing/Sources/Subs-Boards.php
Line: 778

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

I've checked, EVERYTHING is updated to 2.0.19.

I've run all the database checks. Makes no difference.

I already ran the upgrade.php last week.

What now?

Dzonny

Hello there.

This error appears when you try to create new board on forum, right?
Can you tell us if you're using some mods, and if so pls post a list of installed mods.

baldur2630

Highlight tags v1.2
Password Protect Boards v1.2
nCode Image Resizer v3.0
SMF 2.0.19 Update v100

Doug Heffernan

Quote from: baldur2630 on August 03, 2022, 05:32:25 AMField 'passwd' doesn't have a default value
File: /var/www/writing/Sources/Subs-Boards.php
Line: 778

Most likely this error is caused by the Password Protect Boards. You should give said field a default NULL value. That should fix the error.

baldur2630

Quote from: Doug Heffernan on August 03, 2022, 06:06:48 AM
Quote from: baldur2630 on August 03, 2022, 05:32:25 AMField 'passwd' doesn't have a default value
File: /var/www/writing/Sources/Subs-Boards.php
Line: 778

Most likely this error is caused by the Password Protect Boards. You should give said field a default NULL value. That should fix the error.
How/where do I do that? It certainly isn't obvious and I see ZERO documentation.

Kindred

The mod did not properly set up the database field.

Change the database in phpmyadmin and set the default for that field to NULL
Сл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."

baldur2630

Quote from: Kindred on August 03, 2022, 06:49:56 AMThe mod did not properly set up the database field.

Change the database in phpmyadmin and set the default for that field to NULL
There's a lot of tables and fields in that database. Can you be more explicit please

Doug Heffernan

Quote from: baldur2630 on August 03, 2022, 07:04:48 AM
Quote from: Kindred on August 03, 2022, 06:49:56 AMThe mod did not properly set up the database field.

Change the database in phpmyadmin and set the default for that field to NULL
There's a lot of tables and fields in that database. Can you be more explicit please

Look for the aforementioned field in the dbprefix_boards table. dbprefix stands for the actual prefix of your database tables.

Dzonny

Go to phpMyAdmin, find table prefix_boards, then go to structure and seek for "passwd" and make it null.

Please make a backup of database before doing this if you're unsure what you're doing.

baldur2630

Quote from: Dzonny on August 03, 2022, 07:30:01 AMGo to phpMyAdmin, find table prefix_boards, then go to structure and seek for "passwd" and make it null.

Please make a backup of database before doing this if you're unsure what you're doing.
There is no such table as prefix boards. This is 2.0.19, remember.

Doug Heffernan

Quote from: Dzonny on August 03, 2022, 07:30:01 AMPlease make a backup of database before doing this if you're unsure what you're doing.

Thanks for the reminder.

Quote from: baldur2630 on August 03, 2022, 07:51:55 AMThere is no such table as prefix boards. This is 2.0.19, remember.

Prefix stands for the actual prefix of your database tables. It preceeds the boards name with an underscore. If you are using smf as prefix, then you should look for smf_boards.


baldur2630

#11
Quote from: baldur2630 on August 03, 2022, 07:51:55 AMThere is no such table as prefix boards. This is 2.0.19, remember.

Quote from: Doug Heffernan on August 03, 2022, 07:56:23 AMPrefix stands for the actual prefix of your database tables. It preceeds the boards name with an underscore. If you are using smf as prefix, then you should look for smf_boards.
I found the field, set all passwd to NULL (they were blank) and the result is - No difference. - I still get the same error message when I try to create a new board.

Kindred

#12
you have to set the DEFAULT for the field to NULL. not the actual values....

by setting the VALUES to NULL< you have removed any password protection for board that you had previously set up.


edit, here's the command
ALTER TABLE yourTable ALTER some_text_column SET DEFAULT NULL
Сл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."

Steve

Should he try to uninstall that mod and confirm it is causing the problem?
DO NOT pm me for support!

Dzonny

He can try to uninstall and install mod again, that might fix the problem as well.
But I'm sure that is causing the problem, as by default SMF has no "passwd" field in boards table, it's added by this mod.

Doug Heffernan

Quote from: Dzonny on August 03, 2022, 09:23:09 AMBut I'm sure that is causing the problem, as by default SMF has no "passwd" field in boards table, it's added by this mod.

I agree. That field is added by the Board Password mod.

The problem is that the aforementioned filed does not have a default null value defined in the installer.

baldur2630

Quote from: Kindred on August 03, 2022, 09:16:21 AMyou have to set the DEFAULT for the field to NULL. not the actual values....

by setting the VALUES to NULL< you have removed any password protection for board that you had previously set up.

edit, here's the command
26
Eh, what?

baldur2630

I tried uninstalling. The passwd field is still there. still NULL

Doug Heffernan

Quote from: baldur2630 on August 03, 2022, 10:07:50 AMI tried uninstalling. The passwd field is still there. still NULL

Do you mean the mod? Did you uncheck the 'Remove all data associated with this modification' checkbox before you uninstalled it? That would remove all the stuff that the mod has added to the database upon uninstallation.

If you have uninstalled the mod, you can remove its field manually from the boards table as well. Or reintsall the mod and when uninstalling it again, make sure to tick the aforementioned box.


Kindred

I dunno what happened to my paste in that message above.

ALTER TABLE yourTable ALTER some_text_column SET DEFAULT NULL


Doug, Steve...    when this happens, just give them the command (as above, here) uninstalling the mod won't fix the issue in most cases (and the "remove data associated" only appears/works when the mod author set it up in the first place).
Сл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: