HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Fatal Error in UserModel.getSession();

Fatal Error in UserModel.getSession();

No role configured with a type of "unconfirmed".

The error occurred on or near: /home4/busgreas/public_html/applications/dashboard/models/class.usermodel.php

1795:             // Replace permissions with those of the ConfirmEmailRole
1796:             $confirmEmailRoleID = RoleModel::getDefaultRoles(RoleModel::TYPE_UNCONFIRMED);
1797: 
1798:             if (!is_array($confirmEmailRoleID) || count($confirmEmailRoleID) == 0) {
1799:                 throw new Exception(sprintf(t('No role configured with a type of "%s".'), RoleModel::TYPE_UNCONFIRMED), 400);
1800:             }
1801: 
1802:             $roleModel = new RoleModel();
1803:             $permissionsModel = new Vanilla\Permissions();

Backtrace:

[/home4/busgreas/public_html/library/core/class.session.php:443] UserModel->getSession();
[/home4/busgreas/public_html/library/core/class.auth.php:64] Gdn_Session->start();
[/home4/busgreas/public_html/bootstrap.php:517] Gdn_Auth->startAuthenticator();
[/home4/busgreas/public_html/index.php:22] PHP::require_once();

Hello, I just can't get the site to enter /utilities/update or /structure

[an error occurred while processing this directive]

Basically, I have followed every update instruction, Cache is cleared, plugins removed, and I still can't get anything to go...

Thoughts?

Comments

  • I have a site down and I am stuck.


  • R_JR_J Ex-Fanboy Munich Moderator

    If you have a backup, I would recommend to recreate the GDN_Role from a fresh installation. You need to make sure that this doesn't give wrong roles in GDN_UserRole


  • I have all the SQL files backed up (2.1 and the dev. 3.3) Where can I locate the SQL files for the 3.3? All I had was the package for the public files, I didn't see the new SQL.

    I want to go back to the 2.1 site for production, but since I have upgraded to PHP7.1 I don't think that is an options.

  • R_JR_J Ex-Fanboy Munich Moderator

    Please be sure that you really have backed up your database. Sounds as if you are not really sure what databases are.

    This is how a fresh install of the table GDN_Role has to look like:


    DROP TABLE IF EXISTS `GDN_Role`;
    CREATE TABLE `GDN_Role` (
      `RoleID` int(11) NOT NULL AUTO_INCREMENT,
      `Name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
      `Description` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
      `Type` enum('guest','unconfirmed','applicant','member','moderator','administrator') COLLATE utf8_unicode_ci DEFAULT NULL,
      `Sort` int(11) DEFAULT NULL,
      `Deletable` tinyint(4) NOT NULL DEFAULT '1',
      `CanSession` tinyint(4) NOT NULL DEFAULT '1',
      `PersonalInfo` tinyint(4) NOT NULL DEFAULT '0',
      PRIMARY KEY (`RoleID`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    
    INSERT INTO `GDN_Role` (`RoleID`, `Name`, `Description`, `Type`, `Sort`, `Deletable`, `CanSession`, `PersonalInfo`) VALUES
    (2,	'Guest',	'Guests can only view content. Anyone browsing the site who is not signed in is considered to be a \"Guest\".',	'guest',	1,	0,	0,	0),
    (3,	'Unconfirmed',	'Users must confirm their emails before becoming full members. They get assigned to this role.',	'unconfirmed',	2,	0,	1,	0),
    (4,	'Applicant',	'Users who have applied for membership, but have not yet been accepted. They have the same permissions as guests.',	'applicant',	3,	0,	1,	0),
    (8,	'Member',	'Members can participate in discussions.',	'member',	4,	1,	1,	0),
    (16,	'Administrator',	'Administrators have permission to do anything.',	'administrator',	6,	1,	1,	0),
    (32,	'Moderator',	'Moderators have permission to edit most content.',	'moderator',	5,	1,	1,	0);
    


    Your table seems to miss a role for the "Unconfirmed" role. You can try to insert only that row to the GDN_Role table. That might be the easiest step.


  • At this point I have started over on my DEV site with the 2.1 DB and will try to work it back up to 3.3. I have been trying all day to get this to work using the "Upgrade" instructions. I keep getting errors.

  • @R_J

    I have just tried to install Van 2.3, but I am now running PHP7.2, and my host will not allow me to revert to php5.6

    I just need to get this 2.1 SQL Database to be rebuilt to 3.3 and now I have no way to do a "Step Up". I also can't revert to the site the way it was yesterday because of this PHP revert issue.

    Thoughts on my next move?

  • R_JR_J Ex-Fanboy Munich Moderator

    Like I said above.

    If you face an error message, try to solve that problem. Your current problem is the unconfirmed error, isn't it?


  • TheSageTheSage New
    edited December 2019

    Not now...

    I removed everything as suggested and started over with the original site (that was backed up)

    I have a 2.01 database and a hosting site that runs only PHP7.1

    I have the 2.01 Files, and a 2.01 DB configured properly. When I try to access index, I get this error, yet my PHP version is currently 7.2

    My goal is to go from 2.01 to 2.6 to 2.8 to 3.3, but I have no idea what to do when I can't get past this, in debug or not debug.

  • R_JR_J Ex-Fanboy Munich Moderator

    But then you have to struggle with 3 upgrades instead of only one. Since you are unsure how to handle obstacles on your way, I really would advice to directly go to version 3.3 and focus on problems that arise when you do that step.

    It might have just been a typo, but in your initial posting you have written "/utilities/update or /structure" but the links are "/utility/update" and "/utility/structure"

    Just if you decide to upgrade to 3.3 and you get stuck again with that error from above: please show the structure of your table "GDN_Role". Maybe adding those three lines to the end of your /conf/config.php can solve that problem (really not sure about it):

    $Configuration['Garden']['Registration']['ApplicantRoleID'] = 4;
    $Configuration['Garden']['Registration']['DefaultRoles'] = 8;
    $Configuration['Garden']['Registration']['ConfirmEmailRole'] = 3;
    

    If they do, and you have successfully run /utility/structure, just remove them again.


Sign In or Register to comment.