Could not initialize MySQL connection on OneClick
search cancel

Could not initialize MySQL connection on OneClick

book

Article ID: 270540

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

We are seeing below messages on all our OneClick servers used for webapp client access.

In catalina.out firsts we can see below few errors 

"The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Jul 12, 2023 15:59:15.892 - Could not initialize MySQL connection, retry in 5 seconds: Communications link failure"

and than error  that came out every 5 seconds

Jul 12, 2023 23:58:18.755 - Could not initialize MySQL connection, retry in 5 seconds: Access denied for user 'OC_user'@'localhost' (using password: NO)
Jul 12, 2023 23:58:23.757 - Could not initialize MySQL connection, retry in 5 seconds: Access denied for user 'OC_user'@'localhost' (using password: NO)
Jul 12, 2023 23:58:28.759 - Could not initialize MySQL connection, retry in 5 seconds: Access denied for user 'OC_user'@'localhost' (using password: NO)
Jul 12, 2023 23:58:33.761 - Could not initialize MySQL connection, retry in 5 seconds: Access denied for user 'OC_user'@'localhost' (using password: NO)
Jul 12, 2023 23:58:38.763 - Could not initialize MySQL connection, retry in 5 seconds: Access denied for user 'OC_user'@'localhost' (using password: NO)

in  MYSQL.OUT

we can see below errors:

2023-07-12T15:10:56.436794Z 141 [Note] Access denied for user 'OC_user'@'localhost' (using password: NO)
2023-07-12T15:11:01.442238Z 142 [Note] Access denied for user 'OC_user'@'localhost' (using password: NO)
2023-07-12T15:11:06.444928Z 143 [Note] Access denied for user 'OC_user'@'localhost' (using password: NO)

we also see an unexpected mySql process constantly running

$ ps -ef |grep -i mysql
spectrum  5635  5257  0 08:59 ?        00:00:00 /usr/Spectrum/mysql/bin/mysql --defaults-file=/usr/Spectrum/mysql/my-spectrum.cnf --default-character-set=utf8 -uroot -p -e source /usr/Spectrum/Install-Tools/netqos/sql/create_netqos_integ_db.sql

spectrum  6411  5978  0 09:05 ?        00:00:00 /usr/Spectrum/mysql/bin/mysqld --defaults-file=/usr/Spectrum/mysql/my-spectrum.cnf

 

Environment

Release : 22.2

Cause

$SPECROOT/mysql/data/myspectrumlogin.cnf and $SPECROOT/mysql/data/mylogin.cnf OS permissions had been changed.

The default permissions for the two files are 600. 

-rw------- 1 spectrum spectrum      136 Dec 15  2022 mylogin.cnf
-rw------- 1 spectrum spectrum      616 Dec 15  2022 myspectrumlogin.cnf

Resolution

We resolved the mysql problem by setting permissions to 600 on the 2 mysql files myspectrumlogin.cnf and mylogin.cnf.

Additional Information

This will cause various different problems with various parts of the product depending on what components are installed on the server.

The OC_user interacts with the below, with all components installed, i.e.  SpectroSERVER, OneClick and SRM.

mysql> SHOW GRANTS FOR 'OC_user'@'localhost';
+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for OC_user@localhost                                                                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `OC_user`@`localhost`                                                                                                                    |
| GRANT ALL PRIVILEGES ON `archive`.* TO `OC_user`@`localhost`                                                                                                   |
| GRANT ALL PRIVILEGES ON `mibtools`.* TO `OC_user`@`localhost`                                                                                                  |
| GRANT ALL PRIVILEGES ON `reporting`.* TO `OC_user`@`localhost`                                                                                                 |
| GRANT ALL PRIVILEGES ON `netqos_integ`.* TO `OC_user`@`localhost`                                                                                              |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON `reporting_%`.* TO `OC_user`@`localhost` |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
6 rows in set (0.01 sec)

Secondary problems seen at customer site where only OneClick was installed.

Mibtools cannot be started.

After a OneClick restart, alarms were not seen on webapp or java client for up to 3 hours. 

Other performance issues