ome / awstats-docker

Run Awstats in Docker
14 stars 9 forks source link

Error when starting httpd #6

Open CramericaIndustries opened 6 years ago

CramericaIndustries commented 6 years ago

launch command: docker run --rm -p 5001:8080 -v /docker/awstats/awstats-db:/var/lib/awstats openmicroscopy/awstats httpd

Output:

Attaching to awstats_awstats-www-rm_1
awstats-www-rm_1             | Creating configuration /etc/awstats/awstats.localhost.conf
awstats-www-rm_1             | Starting httpd awstats
awstats-www-rm_1             | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.11. Set the 'ServerName' directive globally to suppress this message
awstats-www-rm_1             | (13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid
awstats-www-rm_1             | AH00059: Remove it before continuing if it is corrupted.
awstats_awstats-www-rm_1 exited with code 1
manics commented 6 years ago

I can't reproduce this. Are you running this as part of docker compose or some other docker orchestration tool? If so can you give us your full configuration?

CramericaIndustries commented 6 years ago

Yes at first I tried it with docker-compose. Then I got that 'pid-file permission denied' error message. After that I've tried it without docker-compose using above startup command with the same outcome:

root@v22015123209730424:/docker/awstats# docker run --rm -p 5001:8080 -v /docker/awstats/awstats-db:/var/lib/awstats openmicroscopy/awstats httpd
Creating configuration /etc/awstats/awstats.localhost.conf
Starting httpd awstats
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.20. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00058: Error retrieving pid file /run/httpd/httpd.pid
AH00059: Remove it before continuing if it is corrupted.

When you tried to reproduce the error, did you delete your openmicroscopy/awstats image first?

My Docker Version:

root@v22015123209730424:/docker/awstats# docker -v
Docker version 17.05.0-ce, build 89658be

OS is Debian 8 x64

CramericaIndustries commented 6 years ago

For testing I've started a container from your image with sleep infinity as run command. Then I've executed /bin/bash to get a console running in the container and checked out the /run/httpd directory:

bash-4.2$ cd /run/httpd/
bash-4.2$ whoami
awstats
bash-4.2$ ls -lh
ls: cannot access htcacheclean: Permission denied
total 0
d????????? ? ? ? ?            ? htcacheclean
bash-4.2$ cd ..
bash-4.2$ ls -lh
total 36K
drwxr-xr-x 2 root    root    4.0K Mar  2 01:07 console
drwxr-xr-x 2 root    root    4.0K Mar  2 01:07 faillock
drwx--x--- 3 awstats awstats 4.0K Mar  7 03:02 httpd
drwxr-xr-x 4 root    root    4.0K Mar  2 01:07 lock
drwxr-xr-x 2 root    root    4.0K Mar  2 01:07 log
drwxr-xr-x 2 root    root    4.0K Mar  2 01:07 sepermit
drwxr-xr-x 2 root    root    4.0K Mar  2 01:07 setrans
drwxr-xr-x 9 root    root    4.0K Mar  2 01:07 systemd
drwxr-xr-x 2 root    root    4.0K Mar  2 01:07 user
-rw-rw-r-- 1 root    utmp       0 Mar  2 01:07 utmp
bash-4.2$

That htcacheclean file looks a bit weird. Would it be possible that the image is corrupt?

joshmoore commented 6 years ago
$ docker -v
Docker version 17.06.0-ce, build 02c1d87
$ docker pull openmicroscopy/awstats:latest
latest: Pulling from openmicroscopy/awstats
Digest: sha256:0a4a4600f0660317260103f922613c802f9ce699b1bed7d6d16300a5facc8a58
Status: Image is up to date for openmicroscopy/awstats:latest
$ docker run -ti --rm --entrypoint=/bin/ls openmicroscopy/awstats@sha256:0a4a4600f0660317260103f922613c802f9ce699b1bed7d6d16300a5facc8a58 -lh /run/httpd
total 4.0K
drwx------ 2 apache apache 4.0K Oct 19 20:39 htcacheclean
CramericaIndustries commented 6 years ago
root@v22015123209730424:/docker/awstats# docker rmi openmicroscopy/awstats
Untagged: openmicroscopy/awstats:latest
Untagged: openmicroscopy/awstats@sha256:0a4a4600f0660317260103f922613c802f9ce699b1bed7d6d16300a5facc8a58
Deleted: sha256:c15f5015bec58cae5bf24cb549d30a69a6f9ceaeab512a3fccc9ec69a3f022c3
Deleted: sha256:ec65935386371fa841d3d1cf13f0f1edf65a8b29ef6f8ca37e93c2f8df122f27
Deleted: sha256:2ebfe0404356fd9ecc98f0188b77fcf630356f5023d6a719ba9afc2e730c5ecc
Deleted: sha256:49ada05c92c568811c8e5442eebdd89508736bd395794a039ae0c3f2ab81acf5
Deleted: sha256:d1b6e61010224dba65652f651ac0e3e74e496877efe950a51b67eddecba24b7f
Deleted: sha256:7f70ab8749f075b1012b6c279da5f6253b94c378e58c0cd7d724ba9ce0280898
Deleted: sha256:b03095563b7956c62ae5a6d20e5959a950e3b1a96d4404c00b7da7393847494a
root@v22015123209730424:/docker/awstats# docker pull openmicroscopy/awstats:latest
latest: Pulling from openmicroscopy/awstats
5e35d10a3eba: Pull complete
3b701b498707: Pull complete
374c0c0f8600: Pull complete
3d2145c5f174: Pull complete
a36c50793bbb: Pull complete
78bd791aaa5d: Pull complete
Digest: sha256:0a4a4600f0660317260103f922613c802f9ce699b1bed7d6d16300a5facc8a58
Status: Downloaded newer image for openmicroscopy/awstats:latest
root@v22015123209730424:/docker/awstats# docker run -ti --rm --entrypoint=/bin/ls openmicroscopy/awstats@sha256:0a4a4600f0660317260103f922613c802f9ce699b1bed7d6d16300a5facc8a58 -lh /run/httpd
/bin/ls: cannot access /run/httpd/htcacheclean: Permission denied
total 0
d????????? ? ? ? ?            ? htcacheclean
joshmoore commented 6 years ago

Can you share with us what options your docker daemon is using? Also, what filesystem is being used for /var/lib/docker?

CramericaIndustries commented 6 years ago

How do I find out the options of the docker daemon? Do you mean the output of docker inspect <containerid>?

filesystem of the awstats container:

root@v22015123209730424:/docker/awstats# mount | grep 8a1a40d588ee
shm on /var/lib/docker/containers/8a1a40d588eeef2af2071430d5a5e61b0cb42cdecb9bfb26df3859468e998365/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
joshmoore commented 6 years ago

How do I find out the options of the docker daemon?

No, more:

cat /etc/docker/daemon.json

or even just:

# ps auxw | grep -E "\sdocker-containerd\s"
root       2702  0.1  0.0 5656560 34784 ?       Ssl   2017 439:08 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

and regarding the filesystem, what does:

df -P /var/lib/docker

show?

CramericaIndustries commented 6 years ago

Don't have a /etc/docker/daemon.json file.

root@v22015123209730424:/docker/awstats# ps auxw | grep -E "\sdocker-containerd\s"
root       442  0.0  0.1 538380 11468 ?        Ssl  20:53   0:02 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

Filesystem:

root@v22015123209730424:/# df -P /var/lib/docker
Filesystem     1024-blocks     Used Available Capacity Mounted on
/dev/vda1        120168012 30226692  83814828      27% /
CramericaIndustries commented 6 years ago

Cloned your git repository and tried to build the Dockerfile, which failed saying that it can't extract the httpd package. Then I found multiple other people having the same problem. Looks like there is a bug in AuFS which leads to problems when running CentOS docker images on Debian/Ubuntu hosts. @joshmoore thanks for your help anyways!

joshmoore commented 6 years ago

Glad you could track it down, @CramericaIndustries. Good luck!

siggepop commented 4 years ago

Hm... intressting. I run RHEL 7 and use RHEL 7 container image and have the same problem.

siggepop commented 4 years ago

https://access.redhat.com/solutions/2111281

joshmoore commented 4 years ago

@siggepop : re-opening. If you find a workaround or have more details, please add them here.