Dolibarr/dolibarr · warning

ErrorLoginDateValidity

Error message

ErrorLoginDateValidity

What it means

The user record was fetched successfully but its account validity dates make login currently invalid, so Dolibarr stores ErrorLoginDateValidity and fires USER_LOGIN_FAILED. Credentials are correct; the account is simply outside its allowed date range.

Solutions

  1. Extend the account end date (or clear it) in the user card's validity date fields.
  2. If the start date is in the future, adjust it to allow immediate login.
  3. Renew the account rather than troubleshooting credentials — the password is correct.
  4. Check timezone settings if expiration seems off by hours/days.
  5. Audit accounts regularly to renew dates before they lapse.
Defensive patterns

Strategy: validation

Validate before calling

$u = new User($db); $u->fetch('', $login);
$now = dol_now();
if ($u->datestart && $now < $u->datestart) { die('Account not active yet'); }
if ($u->dateend && $now > $u->dateend) { die('Account expired'); }

Prevention

When it happens

Trigger: User account has datestart in the future or dateend in the past at login time (the $resultFetchUser > 0 branch); an admin-set account expiry was reached.

Common situations: Temporary/contractor accounts past their end date; pre-provisioned accounts before their start date; timezone surprises making an account expire 'early' for the user.

Related errors


AI-assisted analysis of Dolibarr/dolibarr@598aa4bdad (2026-09-14). Data as JSON: /api/errors/fd081e9562bd53a5. Report an issue: GitHub.

Appendix: source

Thrown at htdocs/main.inc.php:901

			session_name($sessionname);
			dol_session_start();

			if ($resultFetchUser == 0) {
				// Load translation files required by page
				$langs->loadLangs(array('main', 'errors'));

				$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorCantLoadUserFromDolibarrDatabase", $login);

				$user->context['audit'] = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
			} elseif ($resultFetchUser < 0) {
				$_SESSION["dol_loginmesg"] = $user->error;

				$user->context['audit'] = $user->error;
			} else {
				// Load translation files required by the page
				$langs->loadLangs(array('main', 'errors'));

				$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");

				$user->context['audit'] = $langs->trans("ErrorLoginDateValidity").' - login='.$login;
			}

			// Call trigger
			$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
			if ($result < 0) {
				$error++;
			}
			// End call triggers


			// Hooks on failed login
			$action = '';
			$hookmanager->initHooks(array('login'));
			$parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
			$reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
			if ($reshook < 0) {

View on GitHub (pinned to 598aa4bdad)