Error 1396 while upgrading
-
I may have changed something during that first update, I vaguely remember changing a username.
[root@fogserver bin]# grep DATABASE_USERNAME /var/www/html/fog/lib/fog/config.class.php define('DATABASE_USERNAME', ''); You have new mail in /var/spool/mail/root [root@fogserver bin]#
[root@fogserver fogproject]# git status # On branch master nothing to commit, working directory clean
-
@xburnerx00 Please try the following: Edit
/opt/fog/.fogsettings
(as root) and setsnmysqluser='fogmaster'
. Then re-run the installer. -
@sebastian-roth
I changed snmysqluser to ‘fogmaster’. It was previously ‘foguser’. Re-ran installer. It stopped at same error.Failed! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! The installer was not able to run all the way to the end as !! !! something has caused it to fail. The following few lines are !! !! from the error log file which might help us figure out what's !! !! wrong. Please add this information when reporting an error. !! !! As well you might want to take a look at the full error log !! !! in /root/fogproject/bin/error_logs/fog_error_1.5.9.log !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! chsh: Shell not changed. Changing shell for fogproject. New password: Retype new password: Changing password for user fogproject. passwd: all authentication tokens updated successfully. ERROR 1396 (HY000) at line 31: Operation CREATE USER failed for ''@'localhost' [root@fogserver bin]#
-
@xburnerx00 said in Error 1396 while upgrading:
I changed snmysqluser to ‘fogmaster’. It was previously ‘foguser’.
I thought it was ‘fogstorage’?! Something is very strange here.
Now let’s see if we can get your FOG web UI back up by manually editing
/var/www/html/fog/lib/fog/config.class.php
. We saw the DATABASE_USERNAME was empty too. Put infogstorage
(as we had that in fogsettings initially I think), make sure a non-empty password is defined the line below the username, save the file and try to open the FOG web UI URL in your browser. No restart of services needed. -
@sebastian-roth
I set the name ‘fogstorage’. There was already a randomly generated password in the line below.No success opening WebUI.
private static function _dbSettings() { define('DATABASE_TYPE', 'mysql'); // mysql or oracle define('DATABASE_HOST', 'localhost'); define('DATABASE_NAME', 'fog'); define('DATABASE_USERNAME', 'fogstorage');
-
@xburnerx00 Do you know the DB root password? Can you login to the database in the console?
mysql -u root -p
(if you don’t know the DB root password try just ENTER for an empty password - but the 1.5.9-RC1 installer should have forced you to set one on CentOS I think)You can also try out different usernames in config.class.php… fogmaster, root - see if any of those works.
I am still scratching my head in what happened here.
-
Yes, I know the root password.
[root@fogserver ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 14 Server version: 5.5.68-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
-
@xburnerx00 From the mysql root shell run this query and post results here:
SELECT * FROM mysql.user;
-
@sebastian-roth
I changed the passwords for this post.MariaDB [(none)]> SELECT * FROM mysql.user; +-----------+------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+ | Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin | authentication_string | +-----------+------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+ | localhost | root | *7FB1F1B8AD1B4CFD57ERT8E761B6ADFF70D04FA0 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | | | | 127.0.0.1 | root | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | mysql_native_password | | | ::1 | root | | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | mysql_native_password | | | % | fogstorage | *35C8661957485DE278FFGH9B7C348770BB41AD4C | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | | | +-----------+------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+ 4 rows in set (0.00 sec) MariaDB [(none)]>
-
Found and fixed - the
.fogsettings
file was clearly corrupted causing this issue. Very sure this was due to manual editing.