error while importing db during install: duplicate entry
Posted: Thu Aug 03, 2023 1:24 pm
Hi,
I'm stuck trying to install 3.3.10 on one of our servers.
The first issue was that the install script seems to expect a database access to a local db server without credentials. The Screen for Step 2 (System Check) shows up but is empty; no error message; found out about this in the error messages of the web server. So I provided credentials in a copy of config.php. After that Step 2 (System Check) showed up and everything seems ok (YAY! )
Next problem: Step 4 (Configuration) shows the already entered database credentials (password is masked). I learned that it is necessary to enter the password again. Our password for database access is 20 characters long; it seems that in Step 4 only 11 characters are displayed in the password field. After entering the password again, selecting the language packs (english) and entering the initial admin user credentials (Step 5) the next step (Step 6) began to populate the database (YAY! ) but stopped after two seconds showing "PHP ERROR" . Again: no additional information.
The web server log shows the probable reason for the error:
PHP Fatal error: Uncaught mysqli_sql_exception: Duplicate entry '0' for key 'PRIMARY' in /var/www/forma.lms/formalms/db/drivers/docebodb.mysqli.php:127\nStack trace:\n#0 /var/www/forma.lms/formalms/db/drivers/docebodb.mysqli.php(127): mysqli_query()\n#1 /var/www/forma.lms/formalms/db/lib.docebodb.php(522): mysqli_DbConn->query()\n#2 /var/www/forma.lms/formalms/lib/installer/lib.role.php(30): sql_query()\n#3 /var/www/forma.lms/formalms/install/import_db.php(180): addRoles()\n#4 /var/www/forma.lms/formalms/install/import_db.php(81): addInstallerRoles()\n#5 {main}\n thrown in /var/www/forma.lms/formalms/db/drivers/docebodb.mysqli.php on line 127, referer: [...]
System information (output of Step 2):
Server information
Server software : : Apache/2.4.56 (Debian)
PHP Version : : 8.2.7
MySQL/MariaDB Client Version : : 8.2.7
MySQL/MariaDB Server Version : : 10.5.19
Multibyte Support: ON
mime_content_type() support: ON
Fileinfo support : ON
Ldap : : OFF Consider this warning only if you need to use LDAP
Openssl : : ON
Site Timezone: UTC
PHP Information :
magic_quotes_gpc : : OFF
Safe mode : : OFF
register_global : : OFF
allow_url_fopen : : ON
allow_url_include : : OFF
upload_max_filsize : : 32M
post_max_size : : 32M
max_execution_time : : 30s
I'm aware, that our system runs a PHP version that is higher than the version recommended for FormaLMS 3.3.10 but I can't step down to PHP 7.4 due to compliance reasons as it already has reached EOL. I also assume that the "duplicate entry" issue is not linked to a specific PHP version.
Please help.
Cheers,
Thiemo
I'm stuck trying to install 3.3.10 on one of our servers.
The first issue was that the install script seems to expect a database access to a local db server without credentials. The Screen for Step 2 (System Check) shows up but is empty; no error message; found out about this in the error messages of the web server. So I provided credentials in a copy of config.php. After that Step 2 (System Check) showed up and everything seems ok (YAY! )
Next problem: Step 4 (Configuration) shows the already entered database credentials (password is masked). I learned that it is necessary to enter the password again. Our password for database access is 20 characters long; it seems that in Step 4 only 11 characters are displayed in the password field. After entering the password again, selecting the language packs (english) and entering the initial admin user credentials (Step 5) the next step (Step 6) began to populate the database (YAY! ) but stopped after two seconds showing "PHP ERROR" . Again: no additional information.
The web server log shows the probable reason for the error:
PHP Fatal error: Uncaught mysqli_sql_exception: Duplicate entry '0' for key 'PRIMARY' in /var/www/forma.lms/formalms/db/drivers/docebodb.mysqli.php:127\nStack trace:\n#0 /var/www/forma.lms/formalms/db/drivers/docebodb.mysqli.php(127): mysqli_query()\n#1 /var/www/forma.lms/formalms/db/lib.docebodb.php(522): mysqli_DbConn->query()\n#2 /var/www/forma.lms/formalms/lib/installer/lib.role.php(30): sql_query()\n#3 /var/www/forma.lms/formalms/install/import_db.php(180): addRoles()\n#4 /var/www/forma.lms/formalms/install/import_db.php(81): addInstallerRoles()\n#5 {main}\n thrown in /var/www/forma.lms/formalms/db/drivers/docebodb.mysqli.php on line 127, referer: [...]
System information (output of Step 2):
Server information
Server software : : Apache/2.4.56 (Debian)
PHP Version : : 8.2.7
MySQL/MariaDB Client Version : : 8.2.7
MySQL/MariaDB Server Version : : 10.5.19
Multibyte Support: ON
mime_content_type() support: ON
Fileinfo support : ON
Ldap : : OFF Consider this warning only if you need to use LDAP
Openssl : : ON
Site Timezone: UTC
PHP Information :
magic_quotes_gpc : : OFF
Safe mode : : OFF
register_global : : OFF
allow_url_fopen : : ON
allow_url_include : : OFF
upload_max_filsize : : 32M
post_max_size : : 32M
max_execution_time : : 30s
I'm aware, that our system runs a PHP version that is higher than the version recommended for FormaLMS 3.3.10 but I can't step down to PHP 7.4 due to compliance reasons as it already has reached EOL. I also assume that the "duplicate entry" issue is not linked to a specific PHP version.
Please help.
Cheers,
Thiemo