Author Archives: LinuxTech

mysqldump: Error: ‘Out of resources when opening file ‘/tmp/#sql_466b_2.MAI’

While creating of backup of mysql I was getting below error

mysqldump: Error: ‘Out of resources when opening file ‘/tmp/#sql_466b_2.MAI’ (Errcode: 24 “Too many open files”)’

The error is due to Mysql exceeding the limit of open files on mysql

So I just went ahead and saw the open file limit

MariaDB [(none)]> SHOW VARIABLES LIKE ‘open%’
->
-> ;
+——————+——-+
| Variable_name | Value |
+——————+——-+
| open_files_limit | 1024 |
+——————+——-+
1 row in set (0.00 sec)

 

I went ahead and added a parameter in /etc/my.cnf and restarted mysql to fix this issue

open_files_limit = 5000

 

 

SSL connect attempt failed error

While working on one of clients server I was getting below error while updating cpanel license in server

root@hoskb [~]# /usr/local/cpanel/cpkeyclt
Updating cPanel license…Done. Update Failed!
Error message:
Transition to SSL failed: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

also while debugging did try yum update

however I got an error as well

root@host113 [~]# yum update
Loaded plugins: fastestmirror, rhnplugin
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 309, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 157, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 187, in getOptionsConfig
self.conf
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 665, in <lambda>
conf = property(fget=lambda self: self._getConfig(),
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 254, in _getConfig
self.plugins.run(‘init’)
File “/usr/lib/python2.4/site-packages/yum/plugins.py”, line 179, in run
func(conduitcls(self, self.base, conf, **kwargs))
File “/usr/share/yum-plugins/rhnplugin.py”, line 124, in init_hook
login_info = up2dateAuth.getLoginInfo()
File “/usr/share/rhn/up2date_client/up2dateAuth.py”, line 222, in getLoginInfo
login()
File “/usr/share/rhn/up2date_client/up2dateAuth.py”, line 190, in login
li = server.up2date.login(systemId)
File “/usr/share/rhn/up2date_client/rhnserver.py”, line 64, in __call__
raise up2dateErrors.SSLCertificateVerifyFailedError()
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.
e/rhn/up2date_client/rhnserver.py”, line 64, in __call__
raise up2dateErrors.SSLCertificateVerifyFailedError()
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.

The solution was to recreate certificate bundle file

I moved the old ca.bundle to /backup

cp /etc/pki/tls/certs/ca-bundle.crt  /root/backup/

To fix the issue, just download a new certificate bundle. I used the one from haxx.se.

 curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
The issue got fixed and can run any command on server without any issues

 

Source : http://eric.lubow.org/2011/security/fixing-centos-root-certificate-authority-issues/

No route to host: AH00056: connect to listener on [::]:443

While working on one of clients server I came across one of  the errors in Apache error logs

root@hosting [/usr/local/apache/logs]# tail -n 10 error_log
[Thu Jul 07 23:28:49.791175 2016] [core:warn] [pid 1845] (113)No route to host: AH00056: connect to listener on [::]:443

The error was due to basically iptables blocking

I went ahead and flushed iptables to get this issue resolved using below command

# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X#

/etc/init.d/iptables save
# /etc/init.d/iptables restart

I can see there are no more such errors now in error logs 🙂

 

 

 

 

 

Strict standard error in PHP

While working on one of clients website after migration from PHP 5.3 to PHP 5.6

I would see the error on “[01-Jul-2016 02:18:54 America/Chicago] PHP Strict Standards:  Declaration of Countries::getAttribute() should be compatible with CActiveRecord”

On googling around I could see the issue was fixed by making changing few settings in php.ini

Add & ~E_STRICT to the end of the active error reporting line. For example, if your current setting is:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

You would change it to read:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT

and restart httpd

This will fix the issue.

 

 

An installation already exists softacalous

While working on one server with cpanel I was facing this error

where I was getting “An installation already exists softacalous” while installing an application via softacalous

Where as in Softacalous I could not see any application installed.

While debugging I  found the error was occuring from  in file

/home/username/ .softaculous/ installations.php

I went ahead and truncated it and fixed this issue

 

[AuthFailure] Either the username was not recognised, or the password was incorrect)

Getting error on XVNC for password authentication

I could see below error in logs

[AuthFailure] Either the username was not recognised, or the password was incorrect)

After googling I found vnc server will need to be restarted once password is reset

root@online [~]# /etc/init.d/vncserver-virtuald restart
root@online [~]# /etc/init.d/vncserver-x11-serviced restart

Now VNC work fine

Apache Issue

“Secure Connection Failed

An error occurred during a connection to realtrafficsource.com. The OCSP server suggests trying again later. Error code: SEC_ERROR_OCSP_TRY_SERVER_LATER

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.”

Solution:

Login in server and restart Apache.

 

Find GPU or Graphical processing Unit in Linux

While working on one of the issue we need to check if GPU is installed

We got it using below command which shows type of CPU installed in cli mode

[root@localhost ~]# lspci -vnn | grep VGA -A 12
07:0b.0 VGA compatible controller [0300]: ASPEED Technology, Inc. ASPEED Graphics Family [1a03:2000] (rev 10) (prog-if 00 [VGA controller])
Subsystem: QUANTA Computer Inc Device [152d:897a]
Flags: medium devsel, IRQ 10
Memory at df800000 (32-bit, non-prefetchable) [size=8M]
Memory at df7e0000 (32-bit, non-prefetchable) [size=128K]
I/O ports at ec00 [size=128]
Expansion ROM at <unassigned> [disabled]
Capabilities: [40] Power Management version 3

We could see our server had  ASPEED Technology, Inc. ASPEED Graphics card installed

 

Find the Model Number of Network Card in Linux

To find the model number of Network Interface Card installed in your Machine, you can use the lspci command. lspci command will list all detected PCI or PCIe hardware devices installed on your machine. So in order to find only network cards, you can run following command:

We got it using below command on our linux server

[root@localhost ~]# lspci | grep -i “Ethernet”
06:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)

We see the ethernet card installed is  Intel Corporation 82576 Gigabit Network

Installing lspci on CentOS

lspci module is not installed on linux os by default

you need to use below steps to install it

[root@localhost ~]# yum install pciutils
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: yum.tamu.edu
* extras: mirrors.cmich.edu
* openvz-kernel-rhel6: openvz.jetfire.io
* openvz-utils: openvz.jetfire.io
* updates: centos.mia.host-engine.com
Resolving Dependencies
–> Running transaction check
—> Package pciutils.x86_64 0:3.1.10-4.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
pciutils x86_64 3.1.10-4.el6 base 85 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package(s)

Total download size: 85 k
Installed size: 180 k
Is this ok [y/N]: y
Downloading Packages:
pciutils-3.1.10-4.el6.x86_64.rpm | 85 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : pciutils-3.1.10-4.el6.x86_64 1/1
Verifying : pciutils-3.1.10-4.el6.x86_64 1/1

Installed:
pciutils.x86_64 0:3.1.10-4.el6

Complete!

The module is necessary to check of ethernet or graphics card installed in cli mode