{"record":{"id":"47724df670db7028","repo":"Dolibarr/dolibarr","slug":"errorconfigparameternotdefined-param-dolibarr-main","errorCode":null,"errorMessage":"ErrorConfigParameterNotDefined (${param}: dolibarr_main_authentication)","messagePattern":"ErrorConfigParameterNotDefined \\((.+?): dolibarr_main_authentication\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"htdocs/main.inc.php","lineNumber":560,"sourceCode":"\tif (defined('MAIN_AUTHENTICATION_MODE')) {\n\t\t$dolibarr_main_authentication = constant('MAIN_AUTHENTICATION_MODE');\n\t} else {\n\t\t// Authentication mode\n\t\tif (empty($dolibarr_main_authentication)) {\n\t\t\t$dolibarr_main_authentication = 'dolibarr';\n\t\t}\n\t\t// Authentication mode: forceuser\n\t\tif ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) {\n\t\t\t$dolibarr_auto_user = 'auto';\n\t\t}\n\t}\n\t// Set authmode\n\t$authmode = explode(',', $dolibarr_main_authentication);\n\n\t// No authentication mode\n\tif (!count($authmode)) {\n\t\t$langs->load('main');\n\t\tdol_print_error(null, $langs->trans(\"ErrorConfigParameterNotDefined\", 'dolibarr_main_authentication'));\n\t\texit;\n\t}\n\n\t// If login request was already post, we retrieve login from the session\n\t// Call module if not realized that his request.\n\t// At the end of this phase, the variable $login is defined.\n\t$resultFetchUser = '';\n\t$test = true;\n\t$dol_authmode = null;\n\n\tif (!isset($_SESSION[\"dol_login\"])) {\n\t\t// It is not already authenticated and it requests the login / password\n\t\tinclude_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';\n\n\t\t$dol_dst_observed = GETPOSTINT(\"dst_observed\", 3);\n\t\t$dol_dst_first = GETPOSTINT(\"dst_first\", 3);\n\t\t$dol_dst_second = GETPOSTINT(\"dst_second\", 3);\n\t\t$dol_screenwidth = GETPOSTINT(\"screenwidth\", 3);","sourceCodeStart":542,"sourceCodeEnd":578,"githubUrl":"https://github.com/Dolibarr/dolibarr/blob/598aa4bdada683d17ca04b1842548821ff0eb6c6/htdocs/main.inc.php#L542-L578","documentation":"Dolibarr aborts startup when the authentication mode list read from conf.php ($dolibarr_main_authentication) is empty, so no authentication module can be selected. dol_print_error renders ErrorConfigParameterNotDefined naming the missing parameter, then the script exits. It guards against a config file that cannot authenticate anyone.","triggerScenarios":"conf.php defines $dolibarr_main_authentication as an empty string or the variable is not defined at all when main.inc.php runs; explode(',', '') yields an array whose count check fails the !count($authmode) test.","commonSituations":"Fresh installs where conf.php was hand-copied without the authentication line; config regeneration tools that strip the parameter; typos like $dolibarr_autentication; deployments where conf.php was overwritten by an automated installer.","solutions":["Edit htdocs/conf/conf.php (or conf.php outside htdocs) and set $dolibarr_main_authentication, e.g. 'dolibarr' or 'http,dolibarr'.","If unsure, copy the value from conf.php.example and adapt it to your auth modules.","Restart/flush PHP opcache and reload the login page.","Verify with php -r that the included config yields a non-empty $dolibarr_main_authentication."],"exampleFix":"// before (conf.php)\n$dolibarr_main_authentication = '';\n// after\n$dolibarr_main_authentication = 'dolibarr';","handlingStrategy":"validation","validationCode":"if (empty($dolibarr_main_authentication)) { die('conf.php: $dolibarr_main_authentication must be set, e.g. dolibarr'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep conf.php under version control with the auth line present","Run a post-deploy smoke test that hits the login page","Compare conf.php against conf.php.example after upgrades"],"tags":["dolibarr","configuration","authentication"],"backgroundTag":"missing-required-config-field","analyzedSha":"598aa4bdada683d17ca04b1842548821ff0eb6c6","analyzedAt":"2026-09-14T11:12:15.309Z","contentChangedAt":"2026-09-14T11:12:15.309Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}