goaccess: Docker-compose : Goaccess cannot find log
Hi there,
Can’t find why this is not working.
If i uncomment the command
part for goaccess in my docker-compose file i get this error below :
Parsing... [719821] [31296/s][0/s]
goaccess | GoAccess - version 1.3 - Jul 3 2019 12:51:29
goaccess | Config file: /srv/data/goaccess.conf
goaccess |
goaccess | Fatal error has occurred
goaccess | Error occurred at: src/parser.c - read_log - 2728
goaccess | Unable to open the specified log file. No such file or directory
goaccess |
If I keep it commented (like I saw @coldfix was doing here https://github.com/allinurl/goaccess/issues/1042#issuecomment-371940111), I get the man goaccess
displayed ^^.
Here’s my docker-compose (simplified, removed completely unrelated stuff) :
version: '3.5'
services:
nginx:
container_name: nginx
image: nginx:alpine
ports:
- 80:80
- 443:443
volumes:
- ${PWD}/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ${PWD}/nginx/logs:/var/log/nginx
depends_on:
- doyouno-api
- goaccess
networks:
- nginx-network
doyouno-api:
image: ${DOYOUNO_REGISTRY_URL}/doyouno/api:${DOYOUNO_API_VERSION}
hostname: api
container_name: doyouno-api
ports:
- 2000:2000
volumes:
- ${PWD}/doyouno-api/logs:/api/src/logs
- ${PWD}/doyouno-api/creds:/api/src/creds
env_file: .env.api
restart: always
networks:
- nginx-network
goaccess:
image: ${DOYOUNO_REGISTRY_URL}/allinurl/goaccess:${GOACCESS_VERSION}
hostname: goaccess
container_name: goaccess
ports:
- 7890:7890
volumes:
- ${PWD}/goaccess/html:/srv/report:rw
- ${PWD}/nginx/logs:/srv/logs:ro
- ${PWD}/goaccess/data:/srv/data:ro
depends_on:
- doyouno-api
restart: always
#command: goaccess /srv/logs/goaccess.log --config-file=/srv/data/goaccess.conf --output=/srv/report/index.html --log-file=/srv/logs/goaccess.log --real-time-html
networks:
- nginx-network
networks:
nginx-network:
driver: bridge
name: nginx-network
I don’t really know how to show you my folder structure, here’s a screen eventhough we don’t see everything. Let me know if need more infos (folder/files permissions for example).
Best regards (and thanks for this awesome project)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 30 (21 by maintainers)
The following configuration work:
My configuration(
goaccess.conf
) file is in./goaccess/config
.At least need to be set in
goaccess.conf
: eg. my conf (nginx):Can input HTML file, but can’t preview in real time, access error, http status code is 400, how do you configure it? I configuredws-url
, it still doesn’t workws-url
work@rachid-debu thank you 🎉 that works with the latest Dockerfile
@Nykoshiro yes it does work. At first it was not working because the websocket tunnel didn’t work but It now works. Detail a bit your configuration, maybe I can help. Are you using a nginx server ? What’s your conf ?
I was able to finally get GoAccess running referencing @rachid-debu compose config. Take away notes:
a) the docker documentation now conflicts with current config of GoAccess (/GoAccess/) volumes; previously it created /srv/{data,logs,report} volumes. Can /GoAccess/{data,logs,report} be added?
b) unless there is a way for Docker Compose to create directories (e.g. /GoAccess/{data,logs,report}) then there is a manual effort to create these paths but only after configuring GA to a temp path? or I’m forced to use a single volume (see new compose config below) and rework all my other containers to point to the new ‘shared’ GoAccess path
@allinurl @err931 I can, give me a bit and I’ll let you guys know as soon as I can.
I may just not understand the new changes to the DockerFile but the documentation references /srv/{data,logs,report} volumes, the rewrite of the DockerFile on 5/12 removes those volumes and sets /var/www/goaccess. The latest change is still only referencing the /var/www/goaccess volume, so I’m assuming it still isn’t fixed?
I’m learning this stuff as I go so be patient if I don’t understand what I’m talking about or the changes… I’ll still give the container a shot as soon as I have a few minutes.
@allinurl #1507 It has been merged, but the image of Docker Hub has not been rebuilt.
@rachid-debu Therefore, you can simply replace(This problem has nothing to do with GeoIP, ignore it.)allinurl/goaccess
withgam2046/goaccess
to confirm whether the same problem still exists.It seems that this problem is caused by wrong permissions or paths. Therefore, you can enter the container(
docker exec -it <container-name-or-id> /bin/sh
ordocker-compose exec <container-name> /bin/sh
) to check whether the files in the/srv/logs
directory are correct.busybox whoami
(in container)ls -lah /srv/logs
(in container)cat /srv/logs/access.log
(in container)