1 (edited by Adriaan Mol 2006-02-22 10:56)

Topic: After clean install: Unable to fetch guest information.

I keep getting this error when installing punBB. I now tried installing punBB for 3 times in a row and it keeps giving me this error when I try to open the installed forum:

Unable to fetch guest information. The table 'punbb_users' must contain an entry with id = 1 that represents anonymous users.

Anyone knows why?

PS: Enabling the debug mode has no effect. The page doesn't even has HTML code or a footer.

Re: After clean install: Unable to fetch guest information.

Some extra info on this problem:

I found this on line 109 in '/includes/functions.php', it seems to go wrong here:

    // Fetch guest user
    $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
    if (!$db->num_rows($result))
        exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.');

3 (edited by Adriaan Mol 2006-02-22 13:02)

Re: After clean install: Unable to fetch guest information.

OK, we've found the problem. It seems that the user "Guest" had group ID 3. And our group ID had 21. The problem seems to accur when you install punBB on a machines with clustered MySQL settings, then you've got different auto increments.

Hope this helps for any future versions. It will be fixed when you force the ID's with the installation.

Re: After clean install: Unable to fetch guest information.

Aha. I'll make a not of this for 1.3.

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