• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Varnish for Wordpress in a Docker Container

Kingsley

Silver Pleskian
Hello;

I am following this plesk blog tutorial in order to test varnish with my wordpress install however i keep getting this error whenever i start the container.

i have been posting on the blog post and the author(s) has refused to reply.

Code:
Error: {"message":"driver failed programming external connectivity on endpoint varnish (4bb8f14f3b3666a64871981347350a65b75dd38c1c482bf1a95229aaab3f7ad3): (iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.2 --dport 80 -j ACCEPT: iptables: No chain/target/match by that name.\n (exit status 1))"}
 
Last edited by a moderator:
Hi Kingsely,

I never encountered an iptables error while writing the tutorial.

Did you try what UFHH01 suggested? I don't really know how you can solve your issue without being able to reproduce it on my test environments.

Greetings
 
Hi Kingsely,

I never encountered an iptables error while writing the tutorial.

Did you try what UFHH01 suggested? I don't really know how you can solve your issue without being able to reproduce it on my test environments.

Greetings

no i did not reboot the server, i have clients site on it,
 
Hi Kingsely,

I never encountered an iptables error while writing the tutorial.

Did you try what UFHH01 suggested? I don't really know how you can solve your issue without being able to reproduce it on my test environments.

Greetings

restarting worked, but there is no /etc/varnish/default.vcl
 
Hi Kingsley,

but there is no /etc/varnish/default.vcl
... "but" ... ? how is your statement related to your initial post in this thread?


If you desire to be informed, WHY the setting "/etc/varnish/default.vcl" is being used at the blog - image => "https://www.plesk.com/wp-content/uploads/2017/03/varnish-docker-plesk-port-mapping-1-1024x521.png", then the answer is certainly, that the mentioned path now depends on your very own, unique mount point

Example:
/var/lib/docker/aufs/mnt/YOUR-VERY-OWN-AND-UNIQUE-PATH-ON-YOUR-SERVER/etc/varnish/default.vcl
 
Hi Kingsley,

pls. note, that I have no idea, WHICH operating system you use, so I just provided an example for Ubuntu. ;)

Pls. note as well, that it might help you, to use "mlocate" on your server, where you are able to search for files/folders with a command like:
Code:
locate etc/varnish/default.vcl
... if your "mlocate" - database is up-to-date. ;)
A "find" command on your server can as well help to find files/folders on your server, if you have no idea about the path(s).
 
Hi Kingsley,

i use cloudlinux/centos 7. and the command brings up nothing
... and you can CONFIRM, that the desired docker image has been installed and has been started?

What is the output of the command:
Code:
ps aux | grep docker
 
Hi Kingsley,


... and you can CONFIRM, that the desired docker image has been installed and has been started?

What is the output of the command:
Code:
ps aux | grep docker

it was then i tried to remove it and try the installation again, but i am getting the below error.

Code:
Error: {"message":"Unable to remove filesystem for 26a1592f8788b97b0b0c082f467f36656d09f0f06e966933b8d068b2424ce660: remove /var/lib/docker/containers/26a1592f8788b97b0b0c082f467f36656d09f0f06e966933b8d068b2424ce660/shm: device or resource busy"}

ps aux | grep docker

Code:
[root@tari ~]# ps aux | grep docker
root      1241  0.0  0.1 1124988 40132 ?       Ssl  Jun20   0:12 /usr/bin/dockerd
root      3118  0.0  0.0 900100 14276 ?        Ssl  Jun20   0:06 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root     28564  0.0  0.0 112652   968 pts/0    S+   00:21   0:00 grep --color=auto docker


 
Hi Kingsley,

o.k. ... let's start with some BASICS here, Kingsley. You will certainly don't get any search results, if your docker image isn't installed, as the image isn't existent on your server without any installation. It doesn't make sense to search for an docker - image, if you can't see the docker - image being listed under => HOME > Docker

As you can see with your "ps" - command, the varnish - docker - image is not mounted. ;)


Error: {"message":"Unable to remove filesystem for 26a1592f8788b97b0b0c082f467f36656d09f0f06e966933b8d068b2424ce660: remove /var/lib/docker/containers/26a1592f8788b97b0b0c082f467f36656d09f0f06e966933b8d068b2424ce660/shm: device or resource busy"}
... points directly to the official Plesk Knowledge - Base - article:

 
Hi Kingsley,

o.k. ... let's start with some BASICS here, Kingsley. You will certainly don't get any search results, if your docker image isn't installed, as the image isn't existent on your server without any installation. It doesn't make sense to search for an docker - image, if you can't see the docker - image being listed under => HOME > Docker

As you can see with your "ps" - command, the varnish - docker - image is not mounted. ;)

i have added an image and then run the command again, still same
 

Attachments

  • Krafty Sprouts Hosting.png
    Krafty Sprouts Hosting.png
    52.6 KB · Views: 11
Hi Kingsley,

can you confirm, that you use for example "updatedb" BEFORE you try a "locate" - command, so that the "mlocate" - db is up-to-date?
Could you pls. provide the "find" - command that you use, so we might be able to help you with the correct command?
 
Code:
[root@tari ~]# ps aux | grep docker
root      2285  0.0  0.1 866744 40760 ?        Ssl  00:24   0:24 /usr/bin/dockerd
root      4050  0.0  0.0 706592 13068 ?        Ssl  00:24   0:12 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root     22063  0.0  0.0 127872  1800 ?        Sl   08:43   0:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 32780 -container-ip 172.17.0.2 -container-port 80
root     22069  0.0  0.0 350900  1820 ?        Sl   08:43   0:00 docker-containerd-shim a2af7b0f97358d0879e2512c780fc433c127a3e7ab9dbd6c4fc854672eac700b /var/run/docke /libcontainerd/a2af7b0f97358d0879e2512c780fc433c127a3e7ab9dbd6c4fc854672eac700b docker-runc
root     24560  0.0  0.0 114696   964 pts/0    S+   08:51   0:00 grep --color=auto docker
 
Hi Kingsley,

can you confirm, that you use for example "updatedb" BEFORE you try a "locate" - command, so that the "mlocate" - db is up-to-date?
Could you pls. provide the "find" - command that you use, so we might be able to help you with the correct command?

yes i used updatedb.

Code:
[root@tari ~]# locate etc/varnish/default.vcl
[root@tari ~]# find etc/varnish/default.vcl
find: ‘etc/varnish/default.vcl’: No such file or directory
[root@tari ~]#

or

Code:
[root@tari ~]# find default.vcl
find: ‘default.vcl’: No such file or directory
[root@tari ~]# locate default.vcl
[root@tari ~]#
 
Hi Kingsley,

Examples for a "find" - command:
Code:
find /var/lib -type f -name "default.vcl" -exec grep --color -Hni "varnish" {} \;
or
Code:
find / -type f -name "default.vcl" -exec grep --color -Hni "varnish" {} \;
 
Hi Kingsley,

Examples for a "find" - command:
Code:
find /var/lib -type f -name "default.vcl" -exec grep --color -Hni "varnish" {} \;
or
Code:
find / -type f -name "default.vcl" -exec grep --color -Hni "varnish" {} \;

Thanks... i think i found them

Code:
[root@tari ~]# find /var/lib -type f -name "default.vcl" -exec grep --color -Hni "varnish" {} \;
/var/lib/docker/overlay/24e76b688b2ea16b6d38c0e465a1515483c4a5f0c7229f78987915d72790532d/root/etc/varnish/default.vcl:2:# This is an example VCL file for Varnish.
/var/lib/docker/overlay/24e76b688b2ea16b6d38c0e465a1515483c4a5f0c7229f78987915d72790532d/root/etc/varnish/default.vcl:8:# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
/var/lib/docker/overlay/24e76b688b2ea16b6d38c0e465a1515483c4a5f0c7229f78987915d72790532d/root/etc/varnish/default.vcl:9:# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples.
/var/lib/docker/overlay/abd5d85d907af6e39cb78e950d601e7fba9bec23530ce78c1014b919f8efe32d/merged/etc/varnish/default.vcl:2:# This is an example VCL file for Varnish.
/var/lib/docker/overlay/abd5d85d907af6e39cb78e950d601e7fba9bec23530ce78c1014b919f8efe32d/merged/etc/varnish/default.vcl:8:# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
/var/lib/docker/overlay/abd5d85d907af6e39cb78e950d601e7fba9bec23530ce78c1014b919f8efe32d/merged/etc/varnish/default.vcl:9:# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples.
/var/lib/docker/overlay/3c090b8aeac12a647ea265ee34bbcbfb590f85031d21546bd43f577eccc51b1b/root/etc/varnish/default.vcl:2:# This is an example VCL file for Varnish.
/var/lib/docker/overlay/3c090b8aeac12a647ea265ee34bbcbfb590f85031d21546bd43f577eccc51b1b/root/etc/varnish/default.vcl:8:# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
/var/lib/docker/overlay/3c090b8aeac12a647ea265ee34bbcbfb590f85031d21546bd43f577eccc51b1b/root/etc/varnish/default.vcl:9:# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples.
 
Back
Top