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
- Extend the account end date (or clear it) in the user card's validity date fields.
- If the start date is in the future, adjust it to allow immediate login.
- Renew the account rather than troubleshooting credentials — the password is correct.
- Check timezone settings if expiration seems off by hours/days.
- 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
- Set reminders before dateend for temporary accounts
- Avoid expiry dates near midnight when timezones differ
- Include account-date checks in periodic user audits
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
- ErrorBadValueForCode
- ErrorBadLoginPassword
- ErrorCantLoadUserFromDolibarrDatabase
- If define NOREQUIREDB or NOREQUIRETRAN are set, you must…
- If define NOREQUIREUSER is set, you must also set…
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)