crowdsecurity / example-docker-compose

Example integration of crowdsec in docker-compose
114 stars 25 forks source link

Container not creating files and folders when started #7

Closed samcro1967 closed 1 year ago

samcro1967 commented 2 years ago

The container starts up and creates the config.yaml and online_api_credentials.yaml files and then exits with fatal errors. The config file it creates seems to be incomplete. If I create config.yaml from the GitHub example, it then errors out with other missing files and folders. The container is not creating all of the required files and folders it needs on first start to run properly.

config.yaml

api:
  server:
    online_client:
      credentials_path: /etc/crowdsec/online_api_credentials.yaml

Docker-compose

crowdsec:
image: crowdsecurity/crowdsec
restart: always
environment:
- TZ=America/Chicago
- GID="${GID-1000}"
- COLLECTIONS=crowdsecurity/caddy crowdsecurity/linux
volumes:
- "${docker}/crowdsec/config/acquis.yaml:/etc/crowdsec/acquis.yaml"
- "${docker}/caddy/data/access.log:/var/log/access.log"
- "${docker}/crowdsec/db/crowdsec.db:/var/lib/crowdsec/data/crowdsec.db"
- "${docker}/crowdsec/config:/etc/crowdsec/"
networks:
- wg-pia
depends_on:
- 'caddy'

Container logs

Regenerate local agent credentials
time="26-12-2021 10:36:31 AM" level=fatal msg="failed to read config file: open /etc/crowdsec/config.yaml: no such file or directory"
time="26-12-2021 10:36:31 AM" level=fatal msg="failed to read config file: open /etc/crowdsec/config.yaml: no such file or directory"
Check if lapi need to register automatically an agent
Error: open /etc/crowdsec/config.yaml: no such file or directory
Error: open /etc/crowdsec/config.yaml: no such file or directory
time="26-12-2021 10:36:31 AM" level=fatal msg="no configuration paths provided"
registration to online API done
time="26-12-2021 10:36:31 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:31 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:31 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:32 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:32 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:32-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:32-06:00" level=fatal msg="no configuration paths provided"
Regenerate local agent credentials
time="26-12-2021 10:36:32 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:32 AM" level=fatal msg="no configuration paths provided"
Check if lapi need to register automatically an agent
time="26-12-2021 10:36:32 AM" level=fatal msg="no configuration paths provided"
registration to online API done
time="26-12-2021 10:36:32 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:33-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:33-06:00" level=fatal msg="no configuration paths provided"
Regenerate local agent credentials
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
Check if lapi need to register automatically an agent
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:33 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:33-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:33-06:00" level=fatal msg="no configuration paths provided"
Regenerate local agent credentials
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
Check if lapi need to register automatically an agent
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:34 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:34-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:34-06:00" level=fatal msg="no configuration paths provided"
Regenerate local agent credentials
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
Check if lapi need to register automatically an agent
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:35 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:35-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:35-06:00" level=fatal msg="no configuration paths provided"
Regenerate local agent credentials
time="26-12-2021 10:36:37 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:37 AM" level=fatal msg="no configuration paths provided"
Check if lapi need to register automatically an agent
time="26-12-2021 10:36:38 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:38 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:38 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:38 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:38 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:38-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:38-06:00" level=fatal msg="no configuration paths provided"
Regenerate local agent credentials
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
Check if lapi need to register automatically an agent
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
time="26-12-2021 10:36:41 AM" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:41-06:00" level=fatal msg="no configuration paths provided"
time="2021-12-26T10:36:41-06:00" level=fatal msg="no configuration paths provided"
fredriki commented 2 years ago

I have the exact same issue. Was following this guide: prog.world/securing-docker-compose-stacks-with-crowdsec (but with the latest version of crowdsec) but ended up with the error.

OdinGitDat commented 2 years ago

This seems to happen to me when I use bind mounts instead of volumes for /etc/crowdsec. Without a bind mount I see no possibility of enabling the email plugin.

LaurenceJJones commented 1 year ago

Closing issue, please open an issue on main CrowdSec repository if the issues raised here are still apparent in latest version.