Topic: Error: Unable to insert group forum permissions.

When changing the group permissions for a given user group for a given forum, I sometimes get the error "Error: Unable to insert group forum permissions."

The problem only occurs when setting "Read forum" or "Post replies" rights, and only on one specific forum. I've been trying to play around with the database (which is SQLite-powered) but with no result so far.

Any help on how to solve this would be greatly appreciated. Thanks!

Re: Error: Unable to insert group forum permissions.

Any mods installed?

Re: Error: Unable to insert group forum permissions.

turn on debug mode and post the full error

Re: Error: Unable to insert group forum permissions.

Full error:

File: /Users/alurio/Sites/forum/admin_forums.php
Line: 204

PunBB reported: Unable to insert group forum permissions

Database reported: constraint failed (Errno: 19)

I should probably also mention that this is a rather fresh PunBB 1.2.5 install, thus without any modifications installed.

Re: Error: Unable to insert group forum permissions.

What have you done to the DB since you first got the error?

Re: Error: Unable to insert group forum permissions.

well its obviously some sqlite error, however i can't seem to find any good sqlite documentation, infact searching for sqlite Errno: 19 found a page on punbb.org lol

Re: Error: Unable to insert group forum permissions.

I found this but I don't think that's the issue here

Re: Error: Unable to insert group forum permissions.

The SQLite docs say this:

SQLITE_CONSTRAINT: This constant is returned if the SQL statement would have violated a database constraint.

Also, I didn't mess with the database at all. It is a clean install with a few forums added and a few users registered, along with some other changed settings.

Re: Error: Unable to insert group forum permissions.

Can you replicate the error consistently? I mean, is there something you can do to force the error so that it happens every time?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error: Unable to insert group forum permissions.

I can reproduce the error every time, but only in that specific forum; all other forums work fine.

Re: Error: Unable to insert group forum permissions.

Could you enable PUN_SHOW_QUERIES (it's below debug mode in common.php). Then we can see the exact query.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error: Unable to insert group forum permissions.

Failed query:

INSERT INTO forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES(4, 4, 0, 0, 0)

Re: Error: Unable to insert group forum permissions.

Are you sure you're using the latest version of include/dblayer/sqlite.php? I believe the problem you're referring to was fixed in an earlier release. The fix.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Error: Unable to insert group forum permissions.

Yes. I'm using a more-or-less fresh 1.2.5 install (not an upgrade from any previous versions). The fix has already been applied in this version.

15 (edited by amon-re 2005-07-17 08:22)

Re: Error: Unable to insert group forum permissions.

Just updated to 1.2.6, which did not fix the problem.

I've decided to delete the forum and re-create it. It works fine now; I guess the SQL database must have messed up at some point. I know I shouldn't have done so, but it was necessary because this forum is a public one which is about to get used a lot.

edit: I didn't delete the entire PunBB installation, just one specific subforum. If it happens again in other forums, I'll mention it in here.