FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » Fatal error: SQL Error has occurred
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Fatal error: SQL Error has occurred [message #21592] Mon, 06 December 2004 12:15 Go to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Fatal error: SQL Error has occurred, please contact the administrator of the forum and have them review the forum's SQL query log in /usr/www/users/web/forum/index.php on line 59

Somehow I broke my forum, which I have just set up. I think what happened was this:

I was logged in as admin and viewing it in firefox. For some reason I fired up IE6 and got error as above. I remembered that last evening I tinkered with multihost setting and wondered if that was something to do with it, especially as I had seen a warning about sessions. Since I was logged in as admin in firefox I went to admin, switched off multi-host, and went to the consistency checker. That seemed to work fine.

But then I found that I got the same problem with both ie and firefox, and have continued getting it ever since. I also can't login to adm, same problem:

Fatal error: SQL Error has occurred, please contact the administrator of the forum and have them review the forum's SQL query log in /usr/www/users/web/FUDforum/include/theme/default/db.inc on line 56

Here is the first sql error message that occurred:

Mon Dec 6 10:46:35 GMT 2004 (/usr/www/users/web/forum/index.php:126
/usr/www/users/web/forum/index.php:350
/usr/www/users/web/forum/theme/default/index.php:80
/usr/www/users/web/forum/index.php:1164
) 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query: UPDATE fud_ses SET sys_id='', forum_id=0, time_sec=1102329995, action='Browsing the <a href=\"index.php?t=index\">forum list</a>', returnto='' WHERE id=
Server Version: 4.0.17-log

Subsequent errors are all similar.

Why is the id empty on the end of that query?

I have tried clearing sessions file.

Using 2.6.8 latest stable version.

Suggestions please!




Simon Child
Re: Fatal error: SQL Error has occurred [message #21600 is a reply to message #21592] Mon, 06 December 2004 17:02 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Do you get this error when browsing as a registered user or as anonymous user?

FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21611 is a reply to message #21600] Mon, 06 December 2004 18:20 Go to previous messageGo to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 17:02

Do you get this error when browsing as a registered user or as anonymous user?


I can't login, that is what I get if I go to my site.

I was logged in as admin (in Firefox) when it happened.

I was wanting to view the site as a different user, hence I started up IE but got that error and so couldn't even view the home page never mind login. Then I found that in firefox (where I had been logged in as admin) I got the same error.

I know that IE was not already logged in from a previous session, since this is at work, and at home over the weekend, as part of setting up, I deleted all my previous users including the original admin (after making a new admin user with a different login Smile )



Simon Child
Re: Fatal error: SQL Error has occurred [message #21614 is a reply to message #21611] Mon, 06 December 2004 18:53 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Do you have multiple themes on that forum?

FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21615 is a reply to message #21614] Mon, 06 December 2004 19:08 Go to previous messageGo to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 18:53

Do you have multiple themes on that forum?


No, just the default. One or two minor changes to the templates, but not changed those in the last few days.


Simon Child
Re: Fatal error: SQL Error has occurred [message #21616 is a reply to message #21615] Mon, 06 December 2004 19:18 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If you still have an admin login to the forum, can you go into the theme manager and check to make sure that @ least one theme is enabled and set to default.

If you do not check the forum's themes table and let me know what's in it.


FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21617 is a reply to message #21616] Mon, 06 December 2004 19:43 Go to previous messageGo to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 19:18

If you still have an admin login to the forum, can you go into the theme manager and check to make sure that @ least one theme is enabled and set to default.

If you do not check the forum's themes table and let me know what's in it.


If I go to http://www.mydomain.com/forum/adm I get redirected to a login form at http://www.mydomain.com/forum/adm/admloginuser.php?rid=

If I enter invalid login data then of course I get rejected:

Only administrators with proper access credentials can login via this control panel

If I enter the valid admin id and password then I get:

Fatal error: SQL Error has occurred, please contact the administrator of the forum and have them review the forum's SQL query log in /usr/www/users/web/FUDforum/include/theme/default/db.inc on line 56

mysql> select * from fud_themes;
+----+---------+-----------+---------+--------+-------------+-----------+
| id | name | theme | lang | locale | pspell_lang | theme_opt |
+----+---------+-----------+---------+--------+-------------+-----------+
| 1 | default | path_info | english | C | en | 7 |
+----+---------+-----------+---------+--------+-------------+-----------+
1 row in set (0.00 sec)

Thanks for helping out here. I do have a fallback position. The forum hasn't gone live yet so the only data in the forum is my imported archives, so I could reinstall and reimort. But it would be nice to know what happened here so it doesn't happen again... (and what to do if it does!).


Simon Child
Re: Fatal error: SQL Error has occurred [message #21621 is a reply to message #21617] Mon, 06 December 2004 21:50 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Could you please tell me what the following query returns:

SELECT theme FROM fud_users;


FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21622 is a reply to message #21621] Mon, 06 December 2004 21:55 Go to previous messageGo to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 21:50

Could you please tell me what the following query returns:

SELECT theme FROM fud_users;


1

(ps I realised that I said there is only one user. In fact there is only the one user that I have setup, an admin, but of course importing an archive has autocreated lots of users, but they do not have valid email addresses or passwords yet, and I have not been trying to login as them. They also all have theme set to 1.)


Simon Child
Re: Fatal error: SQL Error has occurred [message #21623 is a reply to message #21622] Mon, 06 December 2004 22:01 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Does your forum have a user with an ID of 1?
That should be the anonymous user, what is the theme id for that user?


FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21624 is a reply to message #21623] Mon, 06 December 2004 22:22 Go to previous messageGo to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 22:01

Does your forum have a user with an ID of 1?
That should be the anonymous user, what is the theme id for that user?


Ah, er, um. Looks like I deleted the anonymous user when I was clearing out my users...

mysql> select * from fud_users where id='1';
Empty set (0.00 sec)

I cleared out the users (except for admin) since they got messed up when I was experimenting with importing my mailing list archives. Maybe I shouldn't have done that...


Simon Child
Re: Fatal error: SQL Error has occurred [message #21625 is a reply to message #21624] Mon, 06 December 2004 22:26 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
There is the cause of your problem. That user is absolutely necessary for the forum's proper operation.

You can re-create that user based on the query inside def_users.sql file found inside the sql/ directory.


FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21626 is a reply to message #21625] Mon, 06 December 2004 22:34 Go to previous messageGo to next message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 22:26

There is the cause of your problem. That user is absolutely necessary for the forum's proper operation.

You can re-create that user based on the query inside def_users.sql file found inside the sql/ directory.


OK, I have done that. But the anonymous user now has an id of 1605 (since it is an autonumber column, so I can't reclaim id #1).

I still can't see the forum, nor login at /adm

Do I have to propagate this new anonymous user id of 1605 to any other tables??


Simon Child
Re: Fatal error: SQL Error has occurred [message #21627 is a reply to message #21626] Mon, 06 December 2004 22:35 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You need to make sure that the anon user's id is 1.


FUDforum Core Developer
Re: Fatal error: SQL Error has occurred [message #21628 is a reply to message #21627] Mon, 06 December 2004 22:38 Go to previous message
srchild is currently offline  srchild   United Kingdom
Messages: 88
Registered: December 2003
Location: UK
Karma: 1
Member
Ilia wrote on Mon, 06 December 2004 22:35

You need to make sure that the anon user's id is 1.



Success!!

I thought that once an auto-increment number was used it had gone forever. But I just tried changing it and it was fine. And now it all works Very Happy Very Happy Very Happy

Thanks for your perserverance and help here, this is great Very Happy


Simon Child
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem with private messaging
Next Topic: unlock forums
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 19:04:35 GMT 2024

Total time taken to generate the page: 0.32994 seconds