web analytics

Category Troubleshooting

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/nginx/json: dial unix /var/run/docker.sock: connect: permission denied

I was getting this error when I was trying to run a docker container using jenkins declarative pipeline script. This was being run on my localhost and below is what I needed to correct it.

Added jenkins user to docker group

sudo usermod -a -G docker jenkins

The solution that actually worked was to change the permission of the sock file to 666

devops-04:~$ ls -al /var/run/docker.sock
srw-rw—- 1 root docker 0 Oct 28 11:54 /var/run/docker.sock

devops-04:~$ sudo chmod 666 /var/run/docker.sock

devops-04:~$ ls -al /var/run/docker.sock

 

Once this was done my pipeline script started working!

Read More

CSF on SolusVM Node

One of my clients wanted to secure their slave nodes with a firewall, and asked to install CSF on the servers. We setup a new slave node and installed CSF and everything was working fine. Created a new VPS, and noticed that the VPS IP Address is not responding. There was no ping to the VPS IP Address from outside. Logged into the server via console and the IP Address was up in the server. However there was no inbound and outbound network connections.


[root@vps ~]# ping google.com

Thinking it could be a resolver problem, I switched the resolver entries to use google DNS as follows.


[root@vps ~]# vi /etc/resolv.conf

Enter the following

nameserver 8.8.8.8
nameserver 8.8.4.4

Save and quit the file. Tried to ping google.com again from the server and it timed out again...

Read More

Solusvm Access Denied !

I was working on my client’s solusvm admin panel that I got kicked out suddenly. I started getting the following message, whatever way I tried to access the admin control panel.


Access Denied! Contact the system administrator for support

I tried various ways to gain access, but nothing worked. The following trick helped me.

I logged in to the server as root via ssh and whitelisted my IP Address.


[root@abc ~]# cd /usr/local/solusvm/tmp/
[root@abc ~]# touch fixwhitelist
[root@abc ~]# chown solusvm.solusvm fixwhitelist
[root@abc ~]# vi fixwhitelist

Then enter your IP Address in that file, save and restart solusvm.

[root@abc ~]# /etc/rc.d/init.d/solusvm restart
Stopping solusvm: [ OK ]
Starting solusvm: [...

Read More

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

I was trying to setup a php script to send mail with SMTP Authentication. The script was ready, but when executed in a browser, it displayed the following error.

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

The problem appears because the php pear package Net_SMTP is not present in the server. You can install it in two way.

  1. Install the Mail package with –alldeps which will install all required dependencies like Net_SMTP

pear install –alldeps Mail

If Mail is already installed, and if it refuses to get installed then you can force the installation as follows.

pear install –alldeps -f Mail

2.  If Mail is already installed, then you can install the Net_SMTP option alone as follows.

pear install Net_SMTP

After that, execute the script again and...

Read More

df showing wrong result

My mysql server suddenly started showing my disk space usage as almost full.

[root@abc /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       550G  508G   14G  98% /
tmpfs            32G     0   32G   0% /dev/shm
/dev/sda1       2.0G  173M  1.8G   9% /tmp

But when I issued a disk usage check on / , it returned the usage to be very little.

[root@abc /]# du -sch
47G     .
47G     total

I was sure there is something wrong. Hence, I checked for deleted files. You can use either of the following commands.

[root@abc /]# lsof +L1

mysqld    23193     mysql    5u   REG    8,1          184     0       13 /tmp/ibrUf6yr (deleted)
mysqld    23193     mysql    6u   REG    8,1            0     ...

Read More

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Noticed this error in a cpanel server while starting apache. Apache refused to start with the following error.

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Seeing the error, the first thing that I checked was the disk space in the server but it looked fine.

root@abc [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg0-root   16G  1.2G   14G   8% /
/dev/mapper/vg0-home  249G  124G  113G  53% /home
/dev/mapper/vg0-var    23G  7.0G   15G  33% /var
/dev/mapper/vg0-usr    23G  7.6G   14G  36% /usr
/dev/mapper/vg0-tmp   9.5G  151M  8.9G   2% /tmp
/dev/sda1             7.4G  184M  6.9G   3% /boot
tmpfs                 7.9G     0  7...

Read More

Error: Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.x86_64 (s3tools)

I was trying to install s3cmd in my centos6 server when i got the following error.

s3cmd-1.0.0-4.1.i386 from s3tools has depsolving problems —> Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.i386 (s3tools)
s3cmd-1.0.0-4.1.x86_64 from s3tools has depsolving problems —> Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.x86_64 (s3tools)
Error: Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.x86_64 (s3tools)
Error: Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.i386 (s3tools) You could try using —skip-broken to work around the problem

If you are getting python dependency issues with s3cmd tools in centos6, please instal EPEL repo and it will solve it.

wget http://dl...

Read More

IIS7 file upload limit of 30M

I had wordpress setup for one of my domains in a windows 2008 server with IIS7. All files uploads upto 30M was working fine, but more than that no luck. Then I read that IIS7 has a default upload limit of 30M. I had to do two things to get it working. Details given below.

Click Start -> Internet Information Services Manager

Click on the webserver name to highlight it(in order to make changes globally) or just click on your website name to enable changes for that site alone.

On features view, scroll down to IIS -> Request Filtering.

On the right pane, click on Edit Feature Settings

Look for the field “Maximum Allowed Content Length”. It will be the default value of 30000000

Change the value to 104857600 which is 100M.

Save the changes and restart IIS(usually a restart is not needed)

Now...

Read More

The used command is not allowed with this MySQL version – LOAD DATA LOCAL INFILE

This error normally occurs when you run the ‘load data local infile’ command in mysql.

If you are seeing this error in shell, please check this link

If you are seeing this error while running a php script, here are the following things you can test.

I have a php script as follows for testing.


<?php
mysql_connect(“localhost”,”myuser”,”mypass”)or die(mysql_error());
mysql_select_db(“abc_test”) or die(mysql_error());

$query =”LOAD DATA LOCAL INFILE ‘/home/abc/public_html/test.csv’ INTO TABLE abctesting”;
mysql_query($query) or die(mysql_error());

?>

The file ‘test.csv’ contains some random input and if when this script runs, my database abc_test should populate the table abctesting with contents from the file ‘test.csv’

Unfotunately, when I ran this script over browser, I got the following ...

Read More

530 This FTP server is anonymous only. Login failed.

Ever received the following error while connecting to your site via FTP????

# ftp test.com
Connected to test.com.
220 (vsFTPd 2.3.5)
Name (test):
530 This FTP server is anonymous only.
Login failed.
ftp> bye

You can correct this problem by doing the following in the FTP configuration file.

vi /etc/vsftpd.conf

Now, the following lines will be commented, uncomment them.

local_enable=YES    – this lets the local users login via FTP
write_enable=YES   – this lets the users upload files

Save and quit the file.

/etc/init.d/vsftpd restart

Read More